StreamCell

type Cell<X> = ?(X, ?(() -> Cell<X>))

Partially-inspected, finite stream representation.

Unlike Stream and Iter, represents an inspected stream head/tail.

public func cell<X>(head : X, tail : Cell<X>) : Cell<X>

Construct Cell from existing head and tail

public func make<X>(head : X) : Cell<X>

Construct one-value Cell from head (only)

public func nowLater<X>(now : X, later : () -> Cell<X>) : Cell<X>

Construct Cell from existing data "now" and data "later"

public func now<X>(later : ?(() -> Cell<X>)) : Cell<X>

Advance a cell's "later" half, getting it "now"

public func laterNow<X>(c : Cell<X>) : Cell<X>

Get the later part of the cell, and advance to "now"

public func fromIter<X>(i : Iter.Iter<X>) : Cell<X>

Cell from (more lazy) Iter type.

Necessarily, tries to advance iterator, but (initially) just once.

public func toIter<X>(c : Cell<X>) : Iter.Iter<X>

Iter from (less lazy) Cell type.