Transform an Err
value. For example, say the errors we get have too much
information:
parseInt : String -> Result ParseError Int
type alias ParseError =
{ message : String
, code : Int
, position : (Int,Int)
}
mapError .message (parseInt "123") == Ok 123
mapError .message (parseInt "abc") == Err "char 'a' is not a number"
Generated using TypeDoc
A
Result
is eitherOk
meaning the computation succeeded, or it is anErr
meaning that there was some failure.