import { IterableX } from './iterablex' ; class AnonymousIterable < T > extends IterableX < T > { private _fn : ( ) => Iterator < T > ; constructor ( fn ) { super ( ) ; this . _fn = fn ; } [ Symbol . iterator ] ( ) { return this . _fn ( ) ; } } template T param { ( ( ) => Iterator < T > ) } fn returns { IterableX < T > } export function create < T > ( getIterator ) { return new AnonymousIterable ( getIterator ) ; }