Up

Module Applicative

Signature

include module type of Applicative_intf
module type Basic = sig .. end
module type S = sig .. end
module type Args = sig .. end
argument lists and associated N-ary map and apply functions
module type Basic2 = sig .. end
module type S2 = sig .. end
module S_to_S2 (X : S) : S2 with type ('a, 'e) t = 'a X.t
This module serves mostly as a partial check that S2 and S are in sync, but actually calling it is occasionally useful.
module S2_to_S (X : S2) : S with type 'a t = ('a, unit) X.t
module type Args2 = sig .. end
module Args_to_Args2 (X : Args) : Args2 with type ('a, 'e) arg = 'a X.arg with type ('f, 'r, 'e) t = ('f, 'r) X.t
module Make (X : Basic) : S with type 'a t := 'a X.t
module Make2 (X : Basic2) : S2 with type ('a, 'e) t := ('a, 'e) X.t
module Make_args (X : S) : Args with type 'a arg := 'a X.t
module Make_args2 (X : S2) : Args2 with type ('a, 'e) arg := ('a, 'e) X.t

The following functors give a sense of what Applicatives one can define.

Of these, Of_monad is likely the most useful. The others are mostly didactic.

module Of_monad (M : Monad.S) : S with type 'a t := 'a M.t
Every monad is Applicative via:
module Compose (F : S) (G : S) : S with type 'a t = 'a F.t G.t
module Pair (F : S) (G : S) : S with type 'a t = 'a F.t * 'a G.t
module Const (Monoid : sig .. end) : S with type 'a t = Monoid.t
Every monoid gives rise to a constant Applicative.