
29 Nov
2010
29 Nov
'10
6:38 a.m.
Hello wren Convention has Bifunctor as this class: class Bifunctor f where bimap :: (a -> x) -> (b -> y) -> f a b -> f x y Personally I'd like to add these two so they can be optimized if required: mapFst :: (a -> x) -> f a b -> f x b mapSnd :: (b -> y) -> f a b -> f a y Though, I'm sanguine about the names. On pairs mapSnd is fmap, however I'd still like mapSnd in addition to fmap - if I'm working with pairs I'd want the symmetric "vocabulary" of pairs not a pidgin of two vocabularies. Bifunctor is a class I'd really like to see in Base. When working with pairs, I much prefer the notation from Bifunctor to the notations from Control.Categrory & Arrows. Best wishes Stephen