Code translated from Oleg's original Haskell.
This library illustrates the use of the Cats library to support different evaluation strategies, such as call-by-need. For example:
def map[B](f: A => B): FairStream[B] = this match {
case Empty() => empty
case One(a) => FairStream(f(a))
case Cons(a, t) => Cons(f(a), Wait(Later(t map f)))
case Wait(next) => Wait(next.map(_ map f))
}
uses Later
from Eval
.