Oh dear. I'm very sorry to have missed this discussion back in January. I'd be awfully sad to lose pretty infix notation for type variables of kind * -> * -> *. I use them extensively in my libraries and projects, and pretty notation matters.<br>
<br>I'd be okay switching to some convention other than lack of leading ':' for signaling that a symbol is a type variable rather than constructor, e.g., the *presence* of a leading character such as '.'.<br>
<br>Given the increasing use of arrow-ish techniques and of type-level programming, I would not classify the up-to-7.4 behavior as a "foolish consistency", especially going forward.<br><br>-- Conal<br><br><br><div class="gmail_quote">
On Wed, Jan 18, 2012 at 6:27 AM, Simon Peyton-Jones <span dir="ltr"><<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear GHC users<br>
<br>
As part of beefing up the kind system, we plan to implement the "Type operators" proposal for Haskell Prime<br>
<a href="http://hackage.haskell.org/trac/haskell-prime/wiki/InfixTypeConstructors" target="_blank">http://hackage.haskell.org/trac/haskell-prime/wiki/InfixTypeConstructors</a><br>
<br>
GHC has had type operators for some kind, so you can say<br>
data a :+: b = Left a | Right b<br>
but you can only do that for operators which start with ":".<br>
<br>
As part of the above wiki page you can see the proposal to broaden this to ALL operators, allowing<br>
data a + b = Left a | Right b<br>
<br>
Although this technically inconsistent the value page (as the wiki page discussed), I think the payoff is huge. (And "A foolish consistency is the hobgoblin of little minds", Emerson)<br>
<br>
<br>
This email is (a) to highlight the plan, and (b) to ask about flags. Our preferred approach is to *change* what -XTypeOperators does, to allow type operators that do not start with :. But that will mean that *some* (strange) programs will stop working. The only example I have seen in tc192 of GHC's test suite<br>
{-# LANGUAGE TypeOperators #-}<br>
comp :: Arrow (~>) => (b~>c, c~>d)~>(b~>d)<br>
comp = arr (uncurry (>>>))<br>
<br>
Written more conventionally, the signature would look like<br>
comp :: Arrow arr => arr (arr b c, arr c d) (arr b d)<br>
comp = arr (uncurry (>>>))<br>
or, in infix notation<br>
{-# LANGUAGE TypeOperators #-}<br>
comp :: Arrow arr => (b `arr` c, c `arr` d) `arr` (b `arr` d)<br>
comp = arr (uncurry (>>>))<br>
<br>
But tc192 as it stands would become ILLEGAL, because (~>) would be a type *constructor* rather than (as now) a type *variable*. Of course it's easily fixed, as above, but still a breakage is a breakage.<br>
<br>
It would be possible to have two flags, so as to get<br>
- Haskell 98 behaviour<br>
- Current TypeOperator behaviuor<br>
- New TypeOperator behaviour<br>
but it turns out to be Quite Tiresome to do so, and I would much rather not. Can you live with that?<br>
<br>
<br>
<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>
<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>
</blockquote></div><br>