Preface_specs.ApplyAn Apply is a functor with lifting and sequencing capabilities. Apply is more general (and by extension weaker) than a Applicative. An Apply is also a Functor.
To have a predictable behaviour, the instance of Apply must obey some laws.
apply = lift2 idlift2 f x y = f <$> x <*> yu *> v = (id <$ u) <*> vu <* v = lift2 const u vlift2 p (lift2 q u v) = lift2 f u % lift2 g vmodule type WITH_PRODUCT = sig ... endMinimal interface using product.
module type WITH_APPLY = sig ... endMinimal interface using apply.
module type WITH_LIFT2 = sig ... endMinimal interface using lift2.
module type WITH_MAP_AND_PRODUCT = sig ... endMinimal interface using map and product.
module type WITH_MAP_AND_APPLY = sig ... endMinimal interface using map and product.
module type WITH_MAP_AND_LIFT2 = sig ... endMinimal interface using map and lift2.
module type CORE = sig ... endBasis operations.
module type OPERATION = sig ... endAdditional operations.
module type SYNTAX = sig ... endSyntax extensions.
module type INFIX = sig ... endInfix operators.
module type API = sig ... endThe complete interface of an Apply.