Page
Library
Module
Module type
Parameter
Class
Class type
Source
Pidgio_unix.MakeSourcemodule _ : Pidgio.Sigs.JSON_DEVICEinclude Pidgio.Sigs.SERVER with type 'a t = 'aThe main type of the server.
In Channel
Out Channel
The server wrap a Primavera dependency injection on top of the given monad 'a t.
Hold a value of type 'a that needs 'handler to be performed.
Service should return a pidgin expression.
args type describes a heterogeneous list used to generate links associated with a route. It can also serve as a controller parameter.
hole describes an arbitrary value that can be serialized or deserialized. They are used to describe route patterns that introduce variables.
path is a heterogeneous list of patterns (which introduces holes in the final type signature).
param is a prism for dealing with route parameters.
request materialize the incomming request.
Describes a service capable of producing 'handler'-type effects for use in a Primavera context.
error ~code ?message () build a custom error. See Error.custom.
s value describes a Literal pattern, a constant that does not introduce a variable into a pattern.
You can define your own patterns using Hole and Pattern.
Describes a pattern that introduces a variable of type string.
Describes a pattern that introduces a variable of type float.
Describes a pattern that introduces a variable of type char.
Describes a pattern that introduces a variable of type bool.
Describes a potentially empty hole. It use empty to define if a value is present or not in a route path.
Build a prism for validating/producing parameters. You can build complicated param prisms using this function.
route path param_check wrap a path and a Pidgin.Check.t for building a route.
make_request_string ?id route args param constructs the string that corresponds to the query for the given route.
val notify :
?precondition:(pidgin request -> bool) ->
?postcondition:('a args -> 'param -> 'param request -> bool) ->
('a, 'param) route ->
('a args -> 'param -> 'param request -> (unit, 'handler) eff) ->
'handler servicenotify Describes a straight service that does not output anything.
val straight :
?precondition:(pidgin request -> bool) ->
?postcondition:('a args -> 'param -> 'param request -> bool) ->
to_pidgin:('result -> pidgin) ->
('a, 'param) route ->
('a args -> 'param -> 'param request -> ('result, 'handler) eff) ->
'handler servicestraight Describes a service that is not supposed to fail.
val failable :
?precondition:(pidgin request -> bool) ->
?postcondition:('a args -> 'param -> 'param request -> bool) ->
to_pidgin:('result -> pidgin) ->
to_error:('error -> Pidgio.Error.t) ->
('a, 'param) route ->
('a args ->
'param ->
'param request ->
(('result, 'error) result, 'handler) eff) ->
'handler servicefailable Describes a service that can fail.
Some infix operators.
module Infix : sig ... endpath & prism is route path prism.
include module type of Eff.Infixf <$> 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)
module Syntax = Eff.Syntaxlet+ 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)