package algaeff

  1. Overview
  2. Docs

Module Algaeff.SequencerSource

Effects for constructing a Seq.t.

  • since 0.2
  module S = Algaeff.Sequencer.Make (Int)

  (* 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.

Sourcemodule type S = sig ... end

Signatures of sequencing effects.

Sourcemodule Make (Elt : Sigs.Type) : S with type elt := Elt.t

The implementation of sequencing effects.

OCaml

Innovation. Community. Security.