:: (x -> y) -> (p -> q) -> Either x p -> Either y q 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 _'.