package lambda_streams

  1. Overview
  2. Docs

Module Finite.AsyncSource

Represents the finite version of an Lambda_streams.Async stream.

Sourcetype 'a t = 'a Signal.t Async.t
Sourceval pure : 'a -> 'a t
Sourceval empty : unit -> 'a t
Sourceval from_list : 'a list -> 'a t
Sourceval map : ('a -> 'b) -> 'a t -> 'b t
Sourceval filter : ('a -> bool) -> 'a t -> 'a t
Sourceval scan : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'b t
Sourceval take : int -> 'a t -> 'a t
Sourceval 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.

OCaml

Innovation. Community. Security.