On Thu, May 30, 2013 at 10:56 PM, Tony Morris <tmorris@tmorris.net> wrote:

class BinaryFunctor f where
  bimap :: (a -> c) -> (b -> d) -> f a b -> f c d

mapFst = (`bimap id`)
mapSnd = bimap id


There's a bifunctors package with:

class Bifunctor f where 
    bimap :: ...
    first :: a -> b -> f a c -> f b c
    second :: b -> c -> f a b -> f a c