Adding swap/compose functions to Data.Tuple and Data.Function

John Wiegley johnw at
Tue Nov 20 20:16:22 CET 2012

>>>>> John Wiegley <johnw at> writes:

>     swap :: (a,b) -> (b,a)
>     swap = snd &&& fst

> Fairly obvious, but strangely missing.

I'm sorry, I missed that this is already in Data.Tuple, as Hoogle does not
find it.

John Wiegley
FP Complete                         Haskell tools, training and consulting               johnw on #haskell/

More information about the Libraries mailing list