Fwd: [Haskell-beginners] Applicative Composition
Antoine Latter
aslatter at gmail.com
Fri Oct 1 01:15:29 EDT 2010
Forwarding to list - it looks like I forgot to reply-all.
---------- Forwarded message ----------
From: Antoine Latter <aslatter at gmail.com>
Date: Thu, Sep 30, 2010 at 7:17 PM
Subject: Re: [Haskell-beginners] Applicative Composition
To: edgar klerks <edgar.klerks at gmail.com>
On Thu, Sep 30, 2010 at 6:47 PM, edgar klerks <edgar.klerks at gmail.com> wrote:
> 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
More information about the Beginners
mailing list