package primavera
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=37c94e820b973564844d96a91717684ca909777104cc8cf28ce32ca4fd005225
sha512=524aa638b859ba236793fbb6eb24c5e6315b3a6eede47661e84873c01872579fc4c9fc26e4f380785b79784ab1580c3a9e588f9d6e21419979c3d38d7e5990a8
doc/primavera/Primavera/Result/index.html
Module Primavera.ResultSource
Complete interface built on top of Req.S2.
Types
The type of expression that dependency injection must produce.
The type that describes a calculation that uses dependency injection. 'a is the normal form of the programme and 'handler is the object that describes the set of dependencies.
Running and performing
Performs a function computation with a given handler.
Performs a computation with a given handler.
Convert a regular function (which takes an handler) into an performable effect.
Convert a regular value (which takes an handler) into an performable effect.
local f comp is the contramap (on the environment). This allows it to be changed in a computation.
Regular functions
map f x mapping from f over x. Lift a function from 'a -> 'b to a function from 'a t -> 'b t.
apply f x given f and x apply f on x.
bind x f sequentially apply f on x.
replace x comp discard the result of comp by x.
ignore comp same as regular ignore function but for effectful computation.
zip a b is the monoidal product between a and b.
join comp flatten the result of comp.
val compose :
('a -> ('b, 'e, 'handler) t) ->
('c -> ('a, 'e, 'handler) t) ->
'c ->
('b, 'e, 'handler) tcompose f g x is the kleisli composition of f and g.
val map2 :
('a -> 'b -> 'c) ->
('a, 'e, 'handler) t ->
('b, 'e, 'handler) t ->
('c, 'e, 'handler) tmap2 lift a function 2-arity function.
val map3 :
('a -> 'b -> 'c -> 'd) ->
('a, 'e, 'handler) t ->
('b, 'e, 'handler) t ->
('c, 'e, 'handler) t ->
('d, 'e, 'handler) tmap3 lift a function 3-arity function.
val map4 :
('a -> 'b -> 'c -> 'd -> 'e) ->
('a, 'e1, 'handler) t ->
('b, 'e1, 'handler) t ->
('c, 'e1, 'handler) t ->
('d, 'e1, 'handler) t ->
('e, 'e1, 'handler) tmap4 lift a function 4-arity function.
val map5 :
('a -> 'b -> 'c -> 'd -> 'e -> 'f) ->
('a, 'e1, 'handler) t ->
('b, 'e1, 'handler) t ->
('c, 'e1, 'handler) t ->
('d, 'e1, 'handler) t ->
('e, 'e1, 'handler) t ->
('f, 'e1, 'handler) tmap5 lift a function 5-arity function.
Infix Operators
Binding Operators
Included operators
f <$> x is map f x (infix version of map)
a <$ x is replace a x (infix version of replace)
x $> a is replace a x (infix (flipped) version of replace)
f <*> x is apply f x (infix version of apply)
a <&> b is zip a b (infix version of zip)
a <* b Perform a and b but discard b.
a *> b Perform a and b but discard a.
a << b Sequentially perform a following by b but discard b.
a >> b Sequentially perform a following by b but discard a.
m >>= f is bind m f (infix version of bind)
f =<< m is bind m f (infix (flipped) version of bind)
val (<=<) :
('a -> ('b, 'e, 'handler) t) ->
('c -> ('a, 'e, 'handler) t) ->
'c ->
('b, 'e, 'handler) tf <=< g is compose f g (infix version of compose)
val (>=>) :
('a -> ('b, 'e, 'handler) t) ->
('b -> ('c, 'e, 'handler) t) ->
'a ->
('c, 'e, 'handler) tf >=> g is compose g f (infix (flipped) version of compose)
let+ x = m in f x is map (fun x -> f x) m.
(binding version of map)
let+ x = m and+ y = n in f x y is map (fun (x, y) -> f x y) (zip m n).
(binding version of zip)
let* x = m in f x is bind m (fun x -> f x).
(binding version of bind)
let* x = m and* y = n in f x y is bind (zip m n) (fun (x, y) -> f x y).
(binding version of zip)
Traversable API
module Traversable
(T : Sig.Req.T2 with type ('a, 'b) applicative = ('a, 'b) output) :
Sig.T2
with type 'a foldable := 'a T.foldable
and type ('a, 'e, 'handler) applicative := ('a, 'e, 'handler) tTraversable interface on top of Req.S2 for S2