package algaeff

  1. Overview
  2. Docs

Effects for constructing a Seq.t.

  • since 0.2
module S = Algaeff.Sequencer.Make (struct type elt = int end)

(* The sequence corresponding to [[1; 2; 3]]. *)
let seq : int Seq.t = S.run @@ fun () -> S.yield 1; S.yield 2; S.yield 3

(* An implementation of [List.to_seq]. *)
let to_seq l : int Seq.t = S.run @@ fun () -> List.iter S.yield l

The sequencers are generators for Seq.t.

module type Param = sig ... end

Parameters of sequencing effects.

module type S = sig ... end

Signatures of sequencing effects.

module Make (P : Param) : S with type elt = P.elt

The implementation of sequencing effects.

OCaml

Innovation. Community. Security.