module Result: sig
.. end
Used for representing results of various actions where a success or failure can occur. Contains helper functions to implement a monadic and functorial interface.
type 'a
result =
| |
Success of 'a |
| |
Failure of string |
Stores the return value if a function succeeded or a string if the function failed
val return : 'a -> 'a result
Raise a normal value into a Success : result
val default : 'a -> 'a result -> 'a
Take the value of the result, if it succeeded, or the other argument by default and return that
val (>>=) : 'a result ->
('a -> 'b result) -> 'b result
Bind Success
es through the given function
val (<$>) : ('a -> 'b) -> 'a result -> 'b result
Map Success
es through the given function