<div dir="ltr"><span style="font-size:13px">> If it makes sense to apply a "Foo of functions" to a value, </span><div><br></div><div>That's just a functor. "fmap ($ value) foos".</div><div><br></div><div>But yes, if you want to do this with more than one foo (or functions inside a foo), then you need applicative.</div><div><br></div><div>e.g.</div><div><br></div><div>(+) <$> [1,2,3] <*> [10,20,30]<br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 15, 2016 at 10:29 AM, John Wiegley <span dir="ltr"><<a href="mailto:johnw@newartisans.com" target="_blank">johnw@newartisans.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">>>>>> martin <<a href="mailto:martin.drautzburg@web.de">martin.drautzburg@web.de</a>> writes:<br>
<br>
> I am at a stage, where I can use some of the Monads and Applicatives which<br>
> are out there. But I hardly ever wrote my own instances. I am curious to<br>
> learn about the thought processes which lead to the insight "hey that can be<br>
> written nicely as an Applicative Functor"<br>
<br>
When I realize Monad might be useful:<br>
<br>
If it makes sense for a "Foo of Foos" (over some type) to be reduced to a<br>
Foo.<br>
<br>
When I realize Applicative might be useful:<br>
<br>
If it makes sense to apply a "Foo of functions" to a value, or a function<br>
taking two or more arguments to two or more Foos, throughout those Foos.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F<br>
<a href="http://newartisans.com" rel="noreferrer" target="_blank">http://newartisans.com</a> 60E1 46C4 BD1A 7AC1 4BA2<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
</font></span></blockquote></div><br></div></div></div>