nim_iterator_stream_experiment/stream/loop

Types

Generator[S; T] = Reader[S, T]
  Source Edit
Loop[S; T] = object
  scope: LoopScope[S]
  generator: Generator[S, T]
  Source Edit

Procs

proc mapSteps[SA; SB; T](self: Loop[SA, T]; extractor: SB -> SA;
                      stepperMapper: Stepper[SA] -> Stepper[SB]): Loop[SB, T]
  Source Edit
proc mapSteps[SA; SB; T](self: Loop[SA, T]; extractor: SB -> SA; wrapper: SA -> SB): Loop[SB, T]
  Source Edit
proc run[S](self: Loop[S, Unit]; initial: S): S
  Source Edit
proc runOnce[S; T](self: Loop[S, T]; start: S): RunOnceResult[S, T]
  Source Edit

Funcs

func generator[S; T](g: Reader[S, T]): Generator[S, T]
  Source Edit
func generating[S; T](scope: LoopScope[S]; generator: Generator[S, T]): Loop[S, T]
  Source Edit
func scope[S; T](X: typedesc[Loop[S, T]]): Lens[X, LoopScope[S]]
  Source Edit
func generator[S; A](X: typedesc[Loop[S, A]]; B: typedesc): PLens[X, Generator[S, A],
    Generator[S, B], Loop[S, B]]
  Source Edit
func generator[S; T](X: typedesc[Loop[S, T]]): Lens[X, Generator[S, T]]
  Source Edit
func condition[S; T](X: typedesc[Loop[S, T]]): Lens[X, Condition[S]]
  Source Edit
func stepper[S; T](X: typedesc[Loop[S, T]]): Lens[X, Stepper[S]]
  Source Edit
func merge[SA; A; SB; B](self: Loop[SA, A]; other: Loop[SB, B]): Loop[Pair[SA, SB],
    Pair[A, B]]
Since 0.4.0.   Source Edit
func emptyLoop(S: typedesc; T: typedesc): Loop[S, T]
  Source Edit
func infiniteLoop[S; T](stepper: Stepper[S]; generator: Generator[S, T]): Loop[S, T]
  Source Edit
func infiniteLoop[S; T](stepper: S -> S; generator: Generator[S, T]): Loop[S, T]
  Source Edit
func asReader[S](self: Loop[S, Unit]): Reader[S, S]
  Source Edit
func map[S; A; B](self: Loop[S, A]; f: A -> B): Loop[S, B]
  Source Edit
func dropWhile[S; T](self: Loop[S, T]; predicate: Predicate[T]): Reader[S, S]
  Source Edit

Templates

template stepType[S; T; ](X: typedesc[Loop[S, T]]): typedesc[S]
  Source Edit
template stepType[S; T; ](self: Loop[S, T]): typedesc[S]
  Source Edit
template itemType[S; T; ](X: typedesc[Loop[S, T]]): typedesc[T]
  Source Edit
template itemType[S; T; ](self: Loop[S, T]): typedesc[T]
  Source Edit