import type { IGen } from "./api.js" ; import { __take } from "./internal/take.js" ; /**
 * Abstract base class for unit gens in this package. Provides
 *  {@link @thi.ng/api#IDeref} to obtain the gen's current value and
 * `Iterable` implementations to use gens as ES6 iterables.
  export abstract class AGen < T > implements IGen < T > { constructor ( protected _val ) { } deref ( ) { return this . _val ; } * [ Symbol . iterator ] ( ) { while ( true ) yield this . next ( ) ; } take ( num , out = [ ] , idx = 0 ) { return __take ( this , num , out , idx ) ; } abstract next ( ) ; }