Data.Tuple impoverished

Andreas Abel andreas.abel at ifi.lmu.de
Fri Jun 15 09:59:40 CEST 2012


Hi,

the module Data.Tuple offers a sad collection of 5 functions.  Many 
standard functions are missing.  For instance, I'd expect all the 
functions of

   Data.Tuple.HT  (package utility-th)

to be part of Data.Tuple, which are

   mapPair :: (a -> c, b -> d) -> (a, b) -> (c, d)
   mapFst :: (a -> c) -> (a, b) -> (c, b)
   mapSnd :: (b -> c) -> (a, b) -> (a, c)
   -- swap :: (a, b) -> (b, a)  -- swap is present in Data.Tuple
   forcePair :: (a, b) -> (a, b)
   fst3 :: (a, b, c) -> a
   snd3 :: (a, b, c) -> b
   thd3 :: (a, b, c) -> c
   curry3 :: ((a, b, c) -> d) -> a -> b -> c -> d
   uncurry3 :: (a -> b -> c -> d) -> (a, b, c) -> d

Is there a good reason why they aren't?

Cheers,
Andreas

P.S.: I have reimplemented all these functions for myself, because I use 
them, but I am puzzled why they are not in the standard library.

-- 
Andreas Abel  <><      Du bist der geliebte Mensch.

Theoretical Computer Science, University of Munich
Oettingenstr. 67, D-80538 Munich, GERMANY

andreas.abel at ifi.lmu.de
http://www2.tcs.ifi.lmu.de/~abel/



More information about the Libraries mailing list