package github-hooks
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=bd92e6d3b8f6106e65851ebb0e8d56f8f87dd2d7cf09ecaae2ea5f5ed422f4c9
sha512=13620ae004c2b56b974ffbd76f9a0627a63967636bc834809f82a39abb1abf75491f0f17858445fbeb292faf5ed4cb0b9e343023d4794e6a0860311e9bff9cc2
doc/github-hooks/Github_hooks/Make/argument-2-Github/Monad/index.html
Module Github.Monad
All API requests are bound through this monad which encapsulates an Lwt cooperative thread and includes some state which may be set via API
functions.
val return : 'a -> 'a t
return x
is the value x
wrapped in a state-sensitive Lwt thread.
bind m f
is the eventual value of f
applied to the contents of m
. Its argument order is designed for currying.
map f m
is bind
m (fun x -> return (f x))
. Its argument order is designed for currying.
val (>>~) : 'a Response.t t -> ('a -> 'b t) -> 'b t
m >>~ f
is m >|= {!Response.value} >>= f
.
catch try with
is the result of trying try
. If try
succeeds, its result is returned. If try
raises an exception, with
is applied to the exception and the result of with
is returned.
val fail : exn -> 'a t
fail exn
raises exception exn
inside of the monad.
run m
is the Lwt thread corresponding to the sequence of API actions represented by m
. Once a t
has been run
, any GitHub API state such as associated default security tokens or declared user agent string will not be available in subsequently bound functions.