package spotlib

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

Module Monad.MakeSource

Build a full Monad interface of T1 from the minimum specification of S1. Note that it only builds functions. The type is not exported.

Parameters

module M : S1

Signature

include T with type 'a t := 'a M.t
val return : 'a -> 'a M.t
val bind : 'a M.t -> ('a -> 'b M.t) -> 'b M.t
Sourceval fmap : ('a -> 'b) -> 'a M.t -> 'b M.t

fmap in Haskell

Sourceval liftM : ('a -> 'b) -> 'a M.t -> 'b M.t

synonym of fmap

Sourceval fmap2 : ('a -> 'b -> 'c) -> 'a M.t -> 'b M.t -> 'c M.t

fmap2 in Haskell

Sourceval liftM2 : ('a -> 'b -> 'c) -> 'a M.t -> 'b M.t -> 'c M.t

synonym of fmap2

Sourceval void : 'a M.t -> unit M.t
Sourceval seq : 'a M.t list -> 'a list M.t

sequence in Haskell. Not tail recursive.

Sourceval seq_ : unit M.t list -> unit M.t

sequence_ in Haskell. Not tail recursive.

Sourceval mapM : ('a -> 'b M.t) -> 'a list -> 'b list M.t

Not tail recursive by default

Sourceval mapM_ : ('a -> unit M.t) -> 'a list -> unit M.t

Not tail recursive by default

Sourceval iteri : (int -> 'a -> unit M.t) -> 'a list -> unit M.t

Iteration with index starting from 0. Not tail recursive by default

Sourceval for_ : int -> int -> (int -> unit M.t) -> unit M.t

for like iteration. Not tail recursive by default

Sourceval join : 'a M.t M.t -> 'a M.t
Sourcemodule Infix : Infix with type 'a t := 'a M.t
Sourcemodule Syntax : Syntax with type 'a t := 'a M.t