Module type Supply_intf.WRITER

An interface for finite-or-infinite supplies.

type elem

The type of elements.

type init

Initialization data for a writer.

type writer

A value of type writer is a finite-or-infinite supply of elements.

val make : init -> writer

Construct a new writer.

val emit : writer -> (elem, writer) Data.emission

emit w consumes w and returns either

  • Empty if the supply is empty,
  • or Emit (e, w') where e is the next element from the supply and w' is the rest of the supply.