Hm. &quot;~&quot; is a sometimes-fine prefix for abstracting over arrowish things, but perhaps not so appealing for others doing pairish, sumish etc abstractions.<br><br>-- Conal<br><br><div class="gmail_quote">On Sat, Sep 15, 2012 at 4:47 AM, Sjoerd Visscher <span dir="ltr">&lt;<a href="mailto:sjoerd@w3future.com" target="_blank">sjoerd@w3future.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">+1. Making &quot;:&quot; the signal for type variables would break even more code, f.e. fclabels.<br>
<br>
&quot;~&quot; almost means &quot;variable&quot;, so I&#39;d like that as a prefix.<br>
<br>
Sjoerd<br>
<div><div class="h5"><br>
On Sep 15, 2012, at 2:09 AM, Cale Gibbard &lt;<a href="mailto:cgibbard@gmail.com">cgibbard@gmail.com</a>&gt; wrote:<br>
<br>
&gt; There&#39;s a fair amount of code out there which uses (~&gt;) as a type<br>
&gt; variable (we have ~10k lines of heavy arrow code at iPwn). It would be<br>
&gt; *really* nice if that could be accommodated somehow. But the proposal<br>
&gt; you just gave at least would allow for a textual substitution, so not<br>
&gt; quite so bad as having to change everything to prefix notation.<br>
&gt;<br>
&gt; On 14 September 2012 19:26, Simon Peyton-Jones &lt;<a href="mailto:simonpj@microsoft.com">simonpj@microsoft.com</a>&gt; wrote:<br>
&gt;&gt; Fair point.  So you are saying it’d be ok to say<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;  data T (.-&gt;)  = MkT (Int .-&gt; Int)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; where (.+) is a type variable?   Leaving ordinary (+) available for type<br>
&gt;&gt; constructors.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; If we are inverting the convention I wonder whether we might invert it<br>
&gt;&gt; completely and use “:” as the “I’m different” herald as we do for<br>
&gt;&gt; *constructor* operators in terms.  Thus<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;  data T (:-&gt;)  = MkT (Int :-&gt; Int)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; That seems symmetrical, and perhaps nicer than having a new notation.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;         In terms                                      In types<br>
&gt;&gt;<br>
&gt;&gt; -----------------------------------------------------------------------<br>
&gt;&gt;<br>
&gt;&gt; a        Term variable                             Type variable<br>
&gt;&gt;<br>
&gt;&gt; A        Data constructor                         Type constructor<br>
&gt;&gt;<br>
&gt;&gt; +        Term variable operator               Type constructor operator<br>
&gt;&gt;<br>
&gt;&gt; :+      Data constructor operator           Type variable operator<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Any other opinions?<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Simon<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; From: <a href="mailto:conal.elliott@gmail.com">conal.elliott@gmail.com</a> [mailto:<a href="mailto:conal.elliott@gmail.com">conal.elliott@gmail.com</a>] On Behalf Of<br>
&gt;&gt; Conal Elliott<br>
&gt;&gt; Sent: 06 September 2012 23:59<br>
&gt;&gt; To: Simon Peyton-Jones<br>
&gt;&gt; Cc: GHC users<br>
&gt;&gt; Subject: Re: Type operators in GHC<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Oh dear. I&#39;m very sorry to have missed this discussion back in January. I&#39;d<br>
&gt;&gt; be awfully sad to lose pretty infix notation for type variables of kind * -&gt;<br>
&gt;&gt; * -&gt; *. I use them extensively in my libraries and projects, and pretty<br>
&gt;&gt; notation matters.<br>
&gt;&gt;<br>
&gt;&gt; I&#39;d be okay switching to some convention other than lack of leading &#39;:&#39; for<br>
&gt;&gt; signaling that a symbol is a type variable rather than constructor, e.g.,<br>
&gt;&gt; the *presence* of a leading character such as &#39;.&#39;.<br>
&gt;&gt;<br>
&gt;&gt; Given the increasing use of arrow-ish techniques and of type-level<br>
&gt;&gt; programming, I would not classify the up-to-7.4 behavior as a &quot;foolish<br>
&gt;&gt; consistency&quot;, especially going forward.<br>
&gt;&gt;<br>
&gt;&gt; -- Conal<br>
&gt;&gt;<br>
&gt;&gt; On Wed, Jan 18, 2012 at 6:27 AM, Simon Peyton-Jones &lt;<a href="mailto:simonpj@microsoft.com">simonpj@microsoft.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Dear GHC users<br>
&gt;&gt;<br>
&gt;&gt; As part of beefing up the kind system, we plan to implement the &quot;Type<br>
&gt;&gt; operators&quot; proposal for Haskell Prime<br>
&gt;&gt; <a href="http://hackage.haskell.org/trac/haskell-prime/wiki/InfixTypeConstructors" target="_blank">http://hackage.haskell.org/trac/haskell-prime/wiki/InfixTypeConstructors</a><br>
&gt;&gt;<br>
&gt;&gt; GHC has had type operators for some kind, so you can say<br>
&gt;&gt;        data a :+: b = Left a | Right b<br>
&gt;&gt; but you can only do that for operators which start with &quot;:&quot;.<br>
&gt;&gt;<br>
&gt;&gt; As part of the above wiki page you can see the proposal to broaden this to<br>
&gt;&gt; ALL operators, allowing<br>
&gt;&gt;        data a + b = Left a | Right b<br>
&gt;&gt;<br>
&gt;&gt; Although this technically inconsistent the value page (as the wiki page<br>
&gt;&gt; discussed), I think the payoff is huge. (And &quot;A foolish consistency is the<br>
&gt;&gt; hobgoblin of little minds&quot;, Emerson)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; This email is (a) to highlight the plan, and (b) to ask about flags.  Our<br>
&gt;&gt; preferred approach is to *change* what -XTypeOperators does, to allow type<br>
&gt;&gt; operators that do not start with :.  But that will mean that *some*<br>
&gt;&gt; (strange) programs will stop working. The only example I have seen in tc192<br>
&gt;&gt; of GHC&#39;s test suite<br>
&gt;&gt;        {-# LANGUAGE TypeOperators #-}<br>
&gt;&gt;        comp :: Arrow (~&gt;) =&gt; (b~&gt;c, c~&gt;d)~&gt;(b~&gt;d)<br>
&gt;&gt;      comp = arr (uncurry (&gt;&gt;&gt;))<br>
&gt;&gt;<br>
&gt;&gt; Written more conventionally, the signature would look like<br>
&gt;&gt;        comp :: Arrow arr =&gt; arr (arr b c, arr c d) (arr b d)<br>
&gt;&gt;      comp = arr (uncurry (&gt;&gt;&gt;))<br>
&gt;&gt; or, in infix notation<br>
&gt;&gt;        {-# LANGUAGE TypeOperators #-}<br>
&gt;&gt;        comp :: Arrow arr =&gt; (b `arr` c, c `arr` d) `arr` (b `arr` d)<br>
&gt;&gt;      comp = arr (uncurry (&gt;&gt;&gt;))<br>
&gt;&gt;<br>
&gt;&gt; But tc192 as it stands would become ILLEGAL, because (~&gt;) would be a type<br>
&gt;&gt; *constructor* rather than (as now) a type *variable*.  Of course it&#39;s easily<br>
&gt;&gt; fixed, as above, but still a breakage is a breakage.<br>
&gt;&gt;<br>
&gt;&gt; It would be possible to have two flags, so as to get<br>
&gt;&gt;  - Haskell 98 behaviour<br>
&gt;&gt;  - Current TypeOperator behaviuor<br>
&gt;&gt;  - New TypeOperator behaviour<br>
&gt;&gt; but it turns out to be Quite Tiresome to do so, and I would much rather not.<br>
&gt;&gt; Can you live with that?<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; <a href="http://chrisdone.com/posts/2010-10-07-haskelldb-and-typeoperator-madness.html" target="_blank">http://chrisdone.com/posts/2010-10-07-haskelldb-and-typeoperator-madness.html</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Glasgow-haskell-users mailing list<br>
&gt;&gt; <a href="mailto:Glasgow-haskell-users@haskell.org">Glasgow-haskell-users@haskell.org</a><br>
&gt;&gt; <a href="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users" target="_blank">http://www.haskell.org/mailman/listinfo/glasgow-haskell-users</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Glasgow-haskell-users mailing list<br>
&gt;&gt; <a href="mailto:Glasgow-haskell-users@haskell.org">Glasgow-haskell-users@haskell.org</a><br>
&gt;&gt; <a href="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users" target="_blank">http://www.haskell.org/mailman/listinfo/glasgow-haskell-users</a><br>
&gt;&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Glasgow-haskell-users mailing list<br>
&gt; <a href="mailto:Glasgow-haskell-users@haskell.org">Glasgow-haskell-users@haskell.org</a><br>
&gt; <a href="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users" target="_blank">http://www.haskell.org/mailman/listinfo/glasgow-haskell-users</a><br>
<br>
</div></div>--<br>
Sjoerd Visscher<br>
<a href="https://github.com/sjoerdvisscher/blog" target="_blank">https://github.com/sjoerdvisscher/blog</a><br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Glasgow-haskell-users mailing list<br>
<a href="mailto:Glasgow-haskell-users@haskell.org">Glasgow-haskell-users@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users" target="_blank">http://www.haskell.org/mailman/listinfo/glasgow-haskell-users</a><br>
</div></div></blockquote></div><br>