Proposal: Add (<$>) to Prelude as part of the AMP in GHC 7.10-RC3

wren romano winterkoninkje at
Sun Mar 1 22:40:01 UTC 2015

On Tue, Feb 24, 2015 at 10:39 AM, Edward Kmett <ekmett at> wrote:
> We have a couple of weeks until the third release candidate for GHC 7.10
> goes out the door.
> Along the way with the last couple of release candidates folks have found
> some problems with the way we implemented the AMP. [1][2]
> Most notably, we failed to include (<$>) in the Prelude, so the standard
> idiom of
> foo <$> bar <*> baz <*> quux
> doesn't work out of the box!
> I'd like to include (<$>) in the Prelude in RC3.
> I'd also like to invite discussion about whether folks believe we should
> include (<$) out of the box.

Strong +1 for (<$>).

I often use (<$>) for non-applicative functors whenever it helps
reduce clutter. As far as the comment about encouraging people to use
pure, the whole point of (<$>) being an alias for fmap is that (f <$>
x) can be a significant optimization over (pure f <*> x).

Ambivalent about (<$)

Live well,

More information about the Libraries mailing list