package lambda_streams

  1. Overview
  2. Docs

Module Lambda_streams.AsyncSource

Sourcetype 'a t = private ('a -> unit) -> unit

Generalizes the notion of an asynchronous stream.

Sourcetype 'a input = 'a t
Sourcetype 'a output = 'a t

Asynchronous output streams are repesented identically to input streams (push-based) .

Sourcetype 'a connection = ('a input, unit Sync.output) Connection.t

Represents a connection-based input stream with a synchronous output stream to close it.

Sourcetype 'a connection' = ('a input, unit output) Connection.t

Represents a connection-based input stream with an asynchronous output stream to close it.

Sourceval make : (('a -> unit) -> unit) -> 'a t
Sourceval listen : ('a -> unit) -> 'a t -> unit

Listens for values from an asynchronous stream, somewhat similar to Sync.next but push-based instead of pull-based.

Sourceval pure : 'a -> '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
Sourcemodule type INTERVAL = sig ... end

This functor is for cross-platform compatibility. The functionality needs to work like Js.Global.setInterval.

Sourcemodule Interval (I : INTERVAL) : sig ... end
OCaml

Innovation. Community. Security.