Data.Tuple impoverished

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Fri Jun 15 10:02:11 CEST 2012


On 15 June 2012 17:59, Andreas Abel <andreas.abel at ifi.lmu.de> wrote:
> 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)

I believe these are covered by Control.Arrow...

>  -- 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

I wouldn't mind seeing these though.

>
> 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/
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries



-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
http://IvanMiljenovic.wordpress.com



More information about the Libraries mailing list