package base

  1. Overview
  2. Docs
Full standard library replacement for OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.16.5.tar.gz
md5=109456ad2350671ad3159cbbca993e3e
sha512=445d08b965e0d559e4046b874f611c8f36de47fa5c23a047146f48ee638588c1b73789a7adb5ead235c0ad2f44b56fd513a6d60bcb8b6c9f11566d32fd7760f2

doc/base/Base/Monad/Make_indexed/argument-1-X/index.html

Parameter Make_indexed.X

Indexed monad, in the style of Atkey. The second and third parameters are composed across all computation. To see this more clearly, you can look at the type of bind:

  val bind : ('a, 'i, 'j) t -> f:('a -> ('b, 'j, 'k) t) -> ('b, 'i, 'k) t

and isolate some of the type variables to see their individual behaviors:

  val bind : 'a             -> f:('a ->  'b           ) ->  'b
  val bind :      'i, 'j    ->               'j, 'k     ->     'i, 'k

For more information on Atkey-style indexed monads, see:

  Parameterised Notions of Computation
  Robert Atkey
  http://bentnib.org/paramnotions-jfp.pdf
type ('a, 'i, 'j) t
val bind : ('a, 'i, 'j) t -> f:('a -> ('b, 'j, 'k) t) -> ('b, 'i, 'k) t
val map : [ `Define_using_bind | `Custom of ('a, 'i, 'j) t -> f:('a -> 'b) -> ('b, 'i, 'j) t ]
val return : 'a -> ('a, 'i, 'i) t