[Haskell-cafe] mapFst and mapSnd

Alexander Solla alex.solla at gmail.com
Sat Jun 1 02:18:14 CEST 2013


On Thu, May 30, 2013 at 10:56 PM, Tony Morris <tmorris at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130531/144d43b2/attachment.htm>


More information about the Haskell-Cafe mailing list