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

Neil Mitchell ndmitchell at gmail.com
Tue Feb 24 20:08:07 UTC 2015


+1 to <$>. To me, Applicative means pure/<$>/<*>. Having 2/3rds of
that in the Prelude seems weird.

If we hadn't put things like *> in the Prelude, then I'd vote -1 for
<$. But given the Prelude operator creep has begun, I can see why <$
lives on the other side of the line, given if I'm not particularly in
favor of where the line lies.

Thanks, Neil

On Tue, Feb 24, 2015 at 7:06 PM, Milan Straka <fox at ucw.cz> wrote:
> Hi all,
>
> +1 on both <$> and <$ .
>
> Cheers,
> Milan Straka
>
>> -----Original message-----
>> From: Edward Kmett <ekmett at gmail.com>
>> Sent: 24 Feb 2015, 10:39
>>
>> 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.
>>
>> (<$) has been a member of Functor for a long time, which is only visible if
>> you import it from Data.Functor or bring in Control.Applicative. There is
>> an idiom that you use (<*) and (<$) to point to the parts of the structure
>> that you want to keep the answers from when building longer such
>> Applicative chains.
>>
>> Discussion Period: 2 weeks
>>
>> Thank you,
>> -Edward Kmett
>>
>> [1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/
>> [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp
>
>> _______________________________________________
>> Libraries mailing list
>> Libraries at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries


More information about the Libraries mailing list