package algaeff

  1. Overview
  2. Docs

The implementation of state effects.

Signatures of read effects.

Parameters

module P : Param

Signature

include Param with type state = P.state
type state = P.state

The type of states.

val get : unit -> state

get () reads the current state.

val set : state -> unit

set x makes x the new state.

val modify : (state -> state) -> unit

modify f applies f to the current state and then set the result as the new state.

val run : init:state -> (unit -> 'a) -> 'a

run t runs the thunk t which may perform state effects.

OCaml

Innovation. Community. Security.