<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">They definitely should be in both, since the default implementations of <$> and <$<div class=""><br class=""></div><div class="">f <$> x = pure f <*> x</div><div class="">f <$ x = const f <*> x</div><div class=""><br class=""></div><div class="">may be less efficient than a special implementation having more knowledge about applicative.</div><div class=""><br class=""></div><div class=""> Doaitse</div><div class=""><br class=""></div><div class="">PS: for that reason they are for almost 20 years now member of the class IsParser in <a href="http://hackage.haskell.org/package/uulib-0.9.16/docs/UU-Parsing-Interface.html" class="">http://hackage.haskell.org/package/uulib-0.9.16/docs/UU-Parsing-Interface.html</a> , which inspired the introduction of Applicative and Alternative in the first place.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 27 Feb 2015, at 5:45 , Edward Kmett <<a href="mailto:ekmett@gmail.com" class="">ekmett@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Thu, Feb 26, 2015 at 6:37 PM, Greg Fitzgerald <span dir="ltr" class=""><<a href="mailto:garious@gmail.com" target="_blank" class="">garious@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Those operators are for Power Users - why put them in the Prelude? </blockquote><div class=""><br class=""></div><div class="">.. because without them that whole Applicative thing that we're bringing in as a superclass of Monad with the AMP is cut off at the knees.</div><div class=""><br class=""></div><div class="">Applicative sugar is typically used like</div><div class=""><br class=""></div><div class="">both f (x,y) = (,) <$> x <*> y</div><div class=""><br class=""></div><div class="">or</div><div class=""><br class=""></div><div class="">traverse f (x:xs) = (:) <$> f x <*> traverse f xs<br class=""></div><div class="">traverse f [] = pure []</div><div class=""><br class=""></div><div class="">Without (<$>), (<*>) from Applicative is quite difficult to use. </div><div class=""><br class=""></div><div class="">both f (x,y) = pure (,) <*> x <*> y<br class=""></div><div class=""><br class=""></div><div class="">is much less efficient and</div><div class=""><br class=""></div><div class="">both f (x,y) = fmap (,) x <*> y</div><div class=""><br class=""></div><div class="">is painfully far from idiomatic.</div><div class=""><br class=""></div><div class="">-Edward</div><div class=""><br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888" class="">
-Greg<br class="">
</font></span><div class="HOEnZb"><div class="h5"><br class="">
<br class="">
> Dne út 24. 2. 2015 16:39 uživatel Edward Kmett <<a href="mailto:ekmett@gmail.com" class="">ekmett@gmail.com</a>> napsal:<br class="">
>><br class="">
>> We have a couple of weeks until the third release candidate for GHC 7.10<br class="">
>> goes out the door.<br class="">
>><br class="">
>> Along the way with the last couple of release candidates folks have found<br class="">
>> some problems with the way we implemented the AMP. [1][2]<br class="">
>><br class="">
>> Most notably, we failed to include (<$>) in the Prelude, so the standard<br class="">
>> idiom of<br class="">
>><br class="">
>> foo <$> bar <*> baz <*> quux<br class="">
>><br class="">
>> doesn't work out of the box!<br class="">
>><br class="">
>> I'd like to include (<$>) in the Prelude in RC3.<br class="">
>><br class="">
>> I'd also like to invite discussion about whether folks believe we should<br class="">
>> include (<$) out of the box.<br class="">
>><br class="">
>> (<$) has been a member of Functor for a long time, which is only visible<br class="">
>> if you import it from Data.Functor or bring in Control.Applicative. There is<br class="">
>> an idiom that you use (<*) and (<$) to point to the parts of the structure<br class="">
>> that you want to keep the answers from when building longer such Applicative<br class="">
>> chains.<br class="">
>><br class="">
>> Discussion Period: 2 weeks<br class="">
>><br class="">
>> Thank you,<br class="">
>> -Edward Kmett<br class="">
>><br class="">
>> [1]<br class="">
>> <a href="http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/" target="_blank" class="">http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/</a><br class="">
>> [2] <a href="https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp" target="_blank" class="">https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp</a><br class="">
>> _______________________________________________<br class="">
>> Libraries mailing list<br class="">
>> <a href="mailto:Libraries@haskell.org" class="">Libraries@haskell.org</a><br class="">
>> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" target="_blank" class="">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br class="">
><br class="">
><br class="">
> _______________________________________________<br class="">
> Libraries mailing list<br class="">
> <a href="mailto:Libraries@haskell.org" class="">Libraries@haskell.org</a><br class="">
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" target="_blank" class="">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br class="">
><br class="">
</div></div></blockquote></div><br class=""></div></div>
_______________________________________________<br class="">Libraries mailing list<br class=""><a href="mailto:Libraries@haskell.org" class="">Libraries@haskell.org</a><br class="">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries<br class=""></div></blockquote></div><br class=""></div></body></html>