
15 Jun
2012
15 Jun
'12
6:25 a.m.
Ivan Lazar Miljenovic
mapPair :: (a -> c, b -> d) -> (a, b) -> (c, d) mapFst :: (a -> c) -> (a, b) -> (c, b) mapSnd :: (b -> c) -> (a, b) -> (a, c)
I believe these are covered by Control.Arrow...
I'm not sure those are really equivalent, as the ones from "Data.Tuple.HT" use lazy pattern matching, e.g.: mapPair ~(f,g) ~(x,y) = (f x, g y) mapFst f ~(a,b) = (f a, b) mapSnd f ~(a,b) = (a, f b) --