seasonedcc / composable-functions

Types and functions to make composition easy and safe
MIT License
653 stars 13 forks source link

Add mapError combinator #13

Closed diogob closed 2 years ago

diogob commented 2 years ago

Purpose

Oftentimes is useful to transform errors produced in a domain function. This PR introduces the mapError combinator, very similar to the existing map but operates on the error side of the Result type.

Technical details

Just like mapLeft but for domain functions.