Definitions
The Result type represents either a success with a value of `ok` or an error with value `error`.
mapError {A E1 E2} (f : E1 -> E2) : Result E1 A -> Result E2 ASource#
Apply a function to the error value of a Result.
mapOk {E A C} (f : A -> C) : Result E A -> Result E CSource#
Apply a function to the ok value of a Result.
fromError {E A} (default : E) : Result E A -> ESource#
Return the contents of an error value, otherwise return a default.
fromOk {E A} (default : A) : Result E A -> ASource#
Return the contents of an ok value, otherwise return a default.
resultToMaybe {E A} : Result E A -> Maybe ASource#
Convert a Result to a Maybe. An error value becomes `nothing`.
maybeToResult {E A} (defaultError : E) : Maybe A -> Result E ASource#
Convert a Maybe to a Result. A nothing value becomes `error defaultError`.