Module Qcheck_extra.Monad

Monad extends the Applicative type class with a new function join. join takes a value in a nested context a t t and joins them together so that we have a single context a t.

We can define let* in terms of join and vice versa:

let ( let* ) x f = join (map f x)
let join x =
  let* y = x in
  y

assuming

( let* ) = bind .

A Monad should satisfy:

assuming

( let* ) = bind .

and

f >=> g =
fun x ->
  let* y = f x in
  let* z = g y in
  return z
module type S = sig ... end
module Syntax (M : S) : sig ... end

Utility to import let-syntax for any Monad.