Module SESSION.Reader

The interface for the reader, which receives elements from the writer.

type elem = elem

The type of elements.

type init

Initialization data for a reader.

type output

The type of the reader's final output after processing the supply.

type reader

A value of type reader is an agent that processes a supply of elements, and may at any point decide to return an output value and shutdown.

val make : init -> reader

Construct a new reader.

val recv : reader -> elem -> (reader, output) Data.verdict

If e is the next element from the supply, then recv r e consumes r and returns either

  • Continue r' to request further elements from the supply as r',
  • or Return x to return the output value x and shutdown.
val shutdown : reader -> output

shutdown r consumes r returns an output value.