Module Unstring_engine.Fast_sequenceSource

A more defunctionalised, and faster, parsing-oriented alternative to Sequence.t.

Operations are represented as data constructors where possible, and zero/one element cases are special-cased. Supports memoization via cache.

Sourcetype 'a t
Sourceval sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t
Sourceval next : 'a t -> ('a * 'a t) option
Sourceval cache : 'a t -> 'a t

cache t returns a sequence that otherwise produces the same stream of values, but which caches any values observed, so that they don't need to be recomputed again.

Constructors

Sourceval empty : 'a t
Sourceval return : 'a -> 'a t
Sourceval cons : 'a -> 'a t Core.Lazy.t -> 'a t
Sourceval map : 'a t -> f:('a -> 'b) -> 'b t
Sourceval bind : 'a t -> f:('a -> 'b t) -> 'b t
Sourceval of_list : 'a list -> 'a t
Sourceval of_list_map : 'a list -> f:('a -> 'b) -> 'b t
Sourceval concat : 'a t list -> 'a t
Sourceval recurse : init:'acc -> f:('acc -> [ `Finish of 'a | `Continue of 'acc ] t) -> 'a t