On Tue, Nov 20, 2012 at 2:14 PM, John Wiegley <johnw@fpcomplete.com> wrote:
Moving discussion from http://hackage.haskell.org/trac/ghc/ticket/7435:
I propose adding the following three functions to Data.Tuple and
Data.Function, respectively:
swap :: (a,b) -> (b,a)
swap = snd &&& fst
Fairly obvious, but strangely missing.
compose :: [(a -> a)] -> a -> a
compose = foldr (.) id
composeM :: [(a -> m a)] -> a -> m a
composeM = foldr (<=<) return