package lambda_streams

  1. Overview
  2. Docs

Represents a signal that either has data or is terminated. Used for Finite streams.

type 'a t =
  1. | Data of 'a
  2. | EndOfSignal
val pure : 'a -> 'a t
val empty : unit -> 'a t
val default : 'a -> 'a t -> 'a

Get the signal data or the provided default value

val satisfies : ('a -> bool) -> 'a t -> bool

Check whether the signal satisfies the predicate. Returns false if it's EndOfSignal

val map : ('a -> 'b) -> 'a t -> 'b t
val filter : ('a -> bool) -> 'a t -> 'a t
val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a
val from_option : 'a option -> 'a t
val to_option : 'a t -> 'a option