Module type Applicative.S
The Alg.Applicative.S
interface extended with a way of generating arbitrary QCheck
values for S.t
.
include Alg.Applicative.S
include Alg.Applicative.Seed
include Alg_structs.Functor.S
include Alg_structs.Functor.Seed
type 'a t
The principle type.
The type constructor
t
is the mapping of objects taking every type'a
to a type'a t
.
val map : f:('a -> 'b) -> 'a t -> 'b t
map ~f
maps the functionf : 'a -> 'b
to a function'f T : 'a T -> 'b T
.As an example, if
T (x : u) : u t
thenmap ~(f:u -> v) (T x)
isT (f x) : v t
. As a result,map
is often thought of as applyingf
"in"T
.The function
map
is the mapping of arrows, taking every arrow'a -> 'b
to an arrow'a t -> 'b t
.
val map2 : 'a t -> 'b t -> f:('a -> 'b -> 'c) -> 'c t
map2 ~f x y
isreturn f <*> x <*> y
, i.e.,f
"lifted" in tot
and then applied to bothx
andy
.
val both : 'a t -> 'b t -> ('a * 'b) t
both (F a) (F b)
isF (a, b)
, i.e., it is the product ofa
andb
inF
module Let_bind : sig ... end
Binding operators for use with the OCaml 4.08 extension. See the OCaml docs on binding operators for more information.
val name : string
val arbitrary : 'a QCheck.arbitrary -> 'a t QCheck.arbitrary