Module type Applicative.S3_kernel
Applicative operations. An applicative abstracts the notion of computations whose results can be combined. An 'a t represents a computation returning 'a.
This module type subsumes the other S*_kernel module types below. It is extended with infix operators in S* below.
Applicative type. 'a is the result type. 'p and 'q are extra parameters unchanged by applicative operations.
val return : 'a 'p 'q. 'a -> ('a, 'p, 'q) tConvert a value to a t.
Applies the functions in one t to the values in another. Well-behaved applicatives satisfy these "laws", using <*> as infix apply:
return Fn.id <*> tis equivalent totreturn Fn.compose <*> tf <*> tg <*> txis equivalent totf <*> (tg <*> tx)return f <*> return xis equivalent toreturn (f x)tf <*> return xis equivalent toreturn (fun f -> f x) <*> tf
Combines values in two ts as tuples. Using <*> as infix apply, equivalent to return (fun a b -> a, b) <*> ta <*> tb.
Transforms the contents of a t. Using <*> as infix apply, equivalent to return f <*> t.
Combines the contents of two ts. Using <*> as infix apply, equivalent to return f <*> ta <*> tb.