package preface

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

The Freer Monad API without the Preface_specs.Monad API.

type 'a f

The parametric type (which, unlike a Preface_specs.Free_monad don't need to be a Preface_specs.Functor).

type _ t =
  1. | Return : 'a -> 'a t
  2. | Bind : 'b f * ('b -> 'a t) -> 'a t

The type held by Freer monad.

type ('a, 'b) handle = ('a -> 'b) -> 'a f -> 'b
type 'a handler = {
  1. handler : 'b. ('b, 'a) handle;
}

The handler type. Which is a Natural transformation from the Freer Monad to an unwrapped Identity monad.

val perform : 'a f -> 'a t

Create a new 'a t from a 'a f.

val run : 'a handler -> 'a t -> 'a

Execute a given handler for given data

module To_monad (Monad : Monad.CORE) : TO_MONAD with type 'a t := 'a t and type 'a f := 'a f and type 'a monad := 'a Monad.t