package linksem
Install
Dune Dependency
Authors
Maintainers
Sources
md5=2075c56715539b3b8f54ae65cc808b8c
sha512=f7c16e4036a1440a6a8d13707a43f0f9f9db0c68489215f948cc300b6a164dba5bf852e58f89503e9d9f38180ee658d9478156ca1a1ef64d6861eec5f9cf43d2
doc/linksem_zarith/Error/index.html
Module Error
Source
error
is a type used to represent potentially failing computations. Success
* marks a successful completion of a computation, whilst Fail err
marks a failure, * with err
as the reason.
return
is the monadic lifting function for error
, representing a successful * computation.
fail err
represents a failing computation, with error message err
.
(>>=)
is the monadic binding function for error
.
as_maybe e
drops an error
value into a maybe
value, throwing away * error information.
repeatM count action
fails if action
is a failing computation, or * successfully produces a list count
elements long, where each element is * the value successfully returned by action
.
repeatM' count seed action
is a variant of repeatM
that acts like repeatM
* apart from any successful result returns a tuple whose second component is seed
* and whose first component is the same as would be returned by repeatM
.
mapM f xs
maps f
across xs
, failing if f
fails on any element of xs
.
foldM f e xs
performs a monadic right fold of f
across xs
using e
* as the base case. Fails if any application of f
fails.
string_of_error err
produces a string representation of err
.