swap (x, y)

Neil Mitchell ndmitchell at gmail.com
Mon Mar 10 08:11:40 EDT 2008


Hi Serge,

> I define and use   swap (x, y) = (y, x)
>
>  because do not find such in the standard library.

You can search for it in the standard libraries using Hoogle:

http://haskell.org/hoogle/?q=(a,b)->(b,a)

>  Please, can people point at it, in the standard library, or at least
>  in GHC?

And as it turns out, it isn't anywhere in the standard libraries. I
think this would be a useful function to add to Data.Tuple, so feel
free to propose it for addition.

Thanks

Neil


More information about the Glasgow-haskell-users mailing list