<div dir="ltr">Honestly the main reason that &#39;semigroupoids&#39; exist is that DataKinds are pretty much broken at this point in GHC due to the addition of Any and lack of eta reduction rules.<div><br></div><div>While I can define a product semigroupoid a product category is still beyond GHC and I needed them for something I was working on at the time, so I just ran with it and defined the rest of the relevant hierarchy to explore what was possible. ;)<div style>
<br></div><div style>I also realize you were going for hyperbole but Actions would require an MPTC+FD or type family, both are unlikely for anything under consideration for inclusion in base. ;)</div><div style><br></div>
<div style>In a &#39;perfect language&#39; we might have classes for affine, relevant and/or linear traversals, and similarly restricted folds, but Haskell is not that language. I&#39;m not going to sit down and define up to 4 restricted variants of &#39;traverse&#39; for every data type I define with no real code-reuse between them.</div>
<div style><br></div><div style>My experience with the Apply and Bind (semi-applicative and semi-monad) classes is that they are very rarely worth their weight. I use them in the linear package so we can have diagonals of sparse matrices use the &#39;semi-monad&#39; join for IntMap, etc. but that is pretty much the limit of their utility, unless you want to introduce non-empty traversals in the lens sense. </div>
<div style><br></div><div style>Even if Semigroup was talked into base -- which is sounding rather unlikely at least in the short term -- I&#39;d still be against bringing Apply/Semiapplicative and Bind/Semimonad into the mix. They&#39;d require a much bigger change to user code, including requiring lots of CPP noise for little benefit. </div>
<div style><br></div><div style>Interestingly each of the &quot;major&quot; current changes under discussion won&#39;t require CPP for almost all users who want to continue to support older versions. I&#39;m generally willing to put them all over my own code, but tastes vary.</div>
<div style><br></div><div style>Haskell&#39;s typeclass system is actually remarkably bad at dealing with overly fine grained class distinctions, because you get very little OOP-style code reuse as you move down the hierarchy. This tends to cause me to err on the side of the pragmatists for core library design while still trying to rectify the situation in my own libraries.</div>
<div style><br></div><div style>-Edward<br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 12, 2013 at 9:24 PM, Gabriel Gonzalez <span dir="ltr">&lt;<a href="mailto:gabriel439@gmail.com" target="_blank">gabriel439@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 class="HOEnZb"><div class="h5"><p dir="ltr"><br>
On Jun 12, 2013 6:03 PM, &quot;Conrad Parker&quot; &lt;<a href="mailto:conrad@metadecks.org" target="_blank">conrad@metadecks.org</a>&gt; wrote:<br>
&gt;<br>
&gt; On 13 June 2013 05:31, Gabriel Gonzalez &lt;<a href="mailto:gabriel439@gmail.com" target="_blank">gabriel439@gmail.com</a>&gt; wrote:<br>
&gt; &gt; Forgot to copy `libraries` on my answer to your question:<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; On Wed, Jun 12, 2013 at 3:28 AM, Herbert Valerio Riedel &lt;<a href="mailto:hvr@gnu.org" target="_blank">hvr@gnu.org</a>&gt; wrote:<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; On 2013-06-12 at 00:04:04 +0200, Gabriel Gonzalez wrote:<br>
&gt; &gt;&gt; &gt; I think types that lack an empty element are a misfeature.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; ...so having a data-type for representing non-empty lists (on which<br>
&gt; &gt;&gt; operation such as head/last/minimum/maximum et. al can be proper<br>
&gt; &gt;&gt; statically guaranteed total functions as opposed to resorting to<br>
&gt; &gt;&gt; &#39;Maybe&#39;-wrapped results which need to be checked dynamically at runtime)<br>
&gt; &gt;&gt; is a misfeature?<br>
&gt; &gt;&gt;<br>
&gt; &gt;<br>
&gt; &gt; I phrased that poorly.  Non-empty data types are useful, but having a<br>
&gt; &gt; combining operation on those types of type:<br>
&gt; &gt;<br>
&gt; &gt; A -&gt; A -&gt; A<br>
&gt; &gt;<br>
&gt; &gt; ... is not.<br>
&gt; &gt;<br>
&gt; &gt; The very example you gave (non-empty lists) shows why.  If you combine two<br>
&gt; &gt; non-empty lists you can actually prove a stronger result, that the combined<br>
&gt; &gt; list has at least two elements.  However, you lose that information if you<br>
&gt; &gt; use the `mappend` operation.  I&#39;m not saying that non-empty lists shouldn&#39;t<br>
&gt; &gt; have a combining operation, but rather that `mappend` is not the appropriate<br>
&gt; &gt; operation for the task.<br>
&gt;<br>
&gt; This is a &quot;perfect world&quot; argument: that there is no point in doing<br>
&gt; small step X because in a perfect world, Haskell would be a different<br>
&gt; language with generalized feature Y which subsumes X.<br>
&gt;<br>
&gt; Here, X is &quot;have semigroup&quot; and Y is &quot;having dependent types&quot;.<br>
&gt;</p>
</div></div><p dir="ltr">No.  I&#39;m saying that even if we had dependent types this would still be a bad idea because the type of the result will differ from the input types.</p><div class="im">
<p dir="ltr">&gt; I think this style of reasoning is counterproductive for the libraries<br>
&gt; list. There are good reasons for being conservative about libraries<br>
&gt; changes, but appeal to a perfect world is not a good reason.<br>
&gt;</p>
</div><p dir="ltr">Anybody who has used the &quot;Edward platform&quot; knows exactly what I am talking about where the moment you add Semigroup you also have to add Semigroupoid, Apply, Bind, all just to preserve this entirely parallel ecosystem of things that are not empty.  It infects everything downstream of it.</p>


<p dir="ltr">Besides, I&#39;m not saying that you can&#39;t define an operator that concatenates two Nonempty lists and produces a Nonempty list.  You can, but don&#39;t put it in base.  Just because there is a mathematical name for it doesn&#39;t mean it is worth adding to our collective cognitive overhead, otherwise we&#39;d also have Magmas and Actions, too.<br>


</p>
<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>