
8 Aug
2013
8 Aug
'13
7:09 a.m.
On Thu, 8 Aug 2013, David Luposchainsky wrote:
On 2013-08-07 19:13, Erik Hesselink wrote:
mapEither :: (l -> l') -> (r -> r') -> Either l r -> Either l' r' mapEither fl fr = either (Left . fl) (Right . fr)
This function is hidden in Control.Arrow as (+++).
I didn't know about those functions, and it seems everything I wanted is in there somewhere. However, I'm not sure what to think of Control.Arrow, I've always (ab)used it as an extended Data.Tuple, and as of today probably for its Either API functions.
For me using the arrow functions as Data.Tuple and Data.Either utility functions is abuse. Control.Arrow is meant to generalize (->). If you call maybeLeft and MaybeRight this is certainly not your intention.