:: (a -> c) -> (b -> d) -> Either a b -> Either c d package:either-unwrap

The mapBoth function takes two functions and applies the first if iff the value takes the form 'Left _' and the second if the value takes the form 'Right _'.