Skip to main content

Error.map_error

map_errorf

Documentation

Transforms an error.

If self is a non-error value it is returned unchanged. However, if self is an error, the error is transformed using the provided function

Arguments

  • f: The function used to transform the error.

Examples

Transforming an error value.

      import Standard.Examples

example_map_error =
map = Examples.map
map.at 10 . map_error (_ -> "The element 10 was not found.")