package lsp

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module State.MakeSource

Parameters

module S : sig ... end
module M : Monad.S

Signature

include Monad.S
Sourcetype 'a t
Sourceval return : 'a -> 'a t
Sourceval bind : 'a t -> f:('a -> 'b t) -> 'b t
Sourceval map : 'a t -> f:('a -> 'b) -> 'b t
Sourcemodule O : sig ... end
Sourceval run : 'a t -> S.t -> (S.t * 'a) M.t

run t state runs computation t with state as the initial state. The final state and the computed result are returned

Sourceval get : S.t t

get returns the current state

Sourceval set : S.t -> unit t

set s sets the current state to s

Sourceval lift : 'a M.t -> 'a t

lift m lifts m into the transformer

Sourceval modify : (S.t -> S.t) -> unit t

modify f lifts f into the monad. f is executed with the current state to produce a new state.

OCaml

Innovation. Community. Security.