iterate<A> static method

ILazyList<A> iterate<A>(
  1. Function0<A> start,
  2. Function1<A, A> f
)

Returns an infinite lazy list produced by repeatedly applying f, starting from the value start().

Implementation

static ILazyList<A> iterate<A>(Function0<A> start, Function1<A, A> f) => _newLL(() {
  final head = start();
  return _sCons(head, iterate(() => f(head), f));
});