fsprojects / Chessie

Railway-oriented programming for .NET
http://fsprojects.github.io/Chessie/
The Unlicense
188 stars 43 forks source link

Added a function and C# extension method for mapping over the failure type #36

Closed battermann closed 8 years ago

battermann commented 8 years ago

mapFailure maps a function over the existing error messages in case of failure. In case of success, the message type will be changed and warnings will be discarded.

This is handy when we get a Result from another domain and we want to convert it to be compatible with our domain message type.

It is also helpful when we convert a Choice into a Result to match the type of Choice2Of2 with our domain message type.