package lambda_streams

  1. Overview
  2. Docs

Represents the finite version of an Lambda_streams.Async stream.

type 'a t = 'a Signal.t Async.t
val pure : 'a -> 'a t
val empty : unit -> 'a t
val from_list : 'a list -> 'a t
val map : ('a -> 'b) -> 'a t -> 'b t
val filter : ('a -> bool) -> 'a t -> 'a t
val scan : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'b t
val take : int -> 'a t -> 'a t
val take' : ?close:unit Sync.output -> int -> 'a Async.t -> 'a t

Takes n elements from an infinite stream and converts it to a finite one. Optionally takes an output stream (?close) to close the connection at Signal.t.EndOfSignal if the async stream is connection-based.