Module Rresult

Result value combinators.

Rresult is a module for handling computation results and errors in an explicit and declarative manner without resorting to exceptions. It defines a result type equal to OCaml 4.03's result type and combinators to operate on these values.

Open the module to use it, this defines the result type, the R.Infix operators R in your scope.

Consult usage guidelines for the type.

v0.6.0 - homepage

Results

type ('a, 'b) result = ('a'b) Result.result =
| Ok of 'a
| Error of 'b

The type for results.

val (>>=) : ('a'b) Result.result -> ('a -> ('c'b) Result.result) -> ('c'b) Result.result

(>>=) is R.( >>= ).

val (>>|) : ('a'b) Result.result -> ('a -> 'c) -> ('c'b) Result.result

(>>|) is R.( >>| ).

module R : sig ... end

Result value combinators.

Usage design guidelines

Error messages

Custom error types