Adding swap/compose functions to Data.Tuple and Data.Function
bertram.felgenhauer at googlemail.com
Fri Nov 23 16:43:02 CET 2012
John Wiegley wrote:
> Fairly obvious, but strangely missing.
> compose :: [(a -> a)] -> a -> a
> compose = foldr (.) id
> composeM :: [(a -> m a)] -> a -> m a
> composeM = foldr (<=<) return
For some reason I would actually expect foldr (>=>) return. Either
variant is bound to cause confusion for some people.
More information about the Libraries