
Forwarding to list - it looks like I forgot to reply-all.
---------- Forwarded message ----------
From: Antoine Latter
Hi All,
I was wondering, why there isn't a composition operator for applicative functors. Of course it is rather trivial to implement, but it is a useful feature:
{-# LANGUAGE FlexibleInstances, UndecidableInstances #-} module ApplicativeComposition where import Control.Applicative
class (Applicative f) => ApplicativeComposition f where (<.>) :: f (b -> c) -> f (a -> b) -> f (a -> c)
instance (Applicative f) => ApplicativeComposition f where (<.>) f g = pure (.) <*> f <*> g
Can this be added to later versions of haskell?
Here's the last time this topic came up on the lists: http://www.haskell.org/pipermail/libraries/2010-August/013992.html Here's the corresponding library proposal ticket: http://hackage.haskell.org/trac/ghc/ticket/4189 There were a few folks against it for a few different reasons. Antoine