<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">A lot of sum types fall in this category. There's no general way to implement "ap" for coproducts, but "pure" is easy, just pick one. The problem with this law is that it doesn't really help you pick one.<div><br></div><div>What the law says is that "pure a" should not contain any other a's than the one given. But pure cannot get an "a" from somewhere else because of parametricity, so the law always holds.</div><div><br></div><div>Sjoerd</div><div>&nbsp;<br><div><div>On Aug 26, 2013, at 7:54 PM, Dan Burton &lt;<a href="mailto:danburton.email@gmail.com">danburton.email@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">What are some example data types which have a "pure" which obeys this law, but no corresponding law-abiding "ap"? The only compelling reason to split it off is if the separation of abstractions will give us the power to reuse code which was previously not as reusable.</div>

<div class="gmail_extra"><br clear="all"><div>-- Dan Burton</div>
<br><br><div class="gmail_quote">On Mon, Aug 26, 2013 at 10:16 AM, Edward Kmett <span dir="ltr">&lt;<a href="mailto:ekmett@gmail.com" target="_blank">ekmett@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr">There are several uses of Pointed as a separate beast from Applicative. In particular it comes up when we talk about "affine traversals", and would let us refine the type hierarchy of lens, so you'd think I'd be for it.&nbsp;<div>


<br></div><div>However, to move it into its own class would require literally everyone who currently has an Applicative instance to clutter their code with CPPs.<div><br></div><div>Even as the author of the Pointed class, I personally find that the benefit of the change doesn't warrant the impact of the change.</div>

<span class="HOEnZb"><font color="#888888">
<div><br></div><div>-Edward</div></font></span></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Aug 26, 2013 at 12:59 PM, Henning Thielemann <span dir="ltr">&lt;<a href="mailto:schlepptop@henning-thielemann.de" target="_blank">schlepptop@henning-thielemann.de</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">There was a lot of discussion about separating "pure" from Applicative and putting it into a Pointed class. If I remember correctly, the main counter argument was that 'pure' alone does not satisfy interesting laws. There are only such laws in connection with the Applicative class.<br>



<br>
Now, in some situations I liked to have a generalized unfoldr. I can build this from "pure" and "sequenceA" using the State monad:<br>
<br>
unfoldr :: (Pointed t, Traversable t) =&gt; (s -&gt; (a, s)) -&gt; s -&gt; t a<br>
unfoldr = evalState . sequenceA . pure . state<br>
<br>
One could state a law like:<br>
<br>
&nbsp; &nbsp;traverse f (pure a) == traverse id (pure (f a))<br>
<br>
Would this justify to move "pure" into a new Pointed class?<br>
<br>
______________________________<u></u>_________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/<u></u>mailman/listinfo/libraries</a><br>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
<br></blockquote></div><br></div>
_______________________________________________<br>Libraries mailing list<br><a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>http://www.haskell.org/mailman/listinfo/libraries<br></blockquote></div><br></div></body></html>