Module Support.Seq

exception ForcedTwice

This exception is raised by oneshot and by several other functions that internally depend on oneshot.

val oneshot : ('a -> 'b) -> 'a -> 'b

oneshot transforms a function into a one-shot function. A one-shot function raises ForcedTwice if it is invoked twice.

val affine : 'a Stdlib.Seq.t -> 'a Stdlib.Seq.t

affine transforms a sequence into an affine sequence. An affine sequence raises ForcedTwice if it is forced twice.

val to_option : 'a Stdlib.Seq.t -> ('a * 'a Stdlib.Seq.t) option

to_option forces a sequence and converts its head to an option.

val list_to_affine_seq : 'a list -> 'a Stdlib.Seq.t

list_to_affine_seq transforms a list into an affine sequence. An affine sequence raises ForcedTwice if forced twice.