Hm. "~" 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"><<a href="mailto:sjoerd@w3future.com" target="_blank">sjoerd@w3future.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">+1. Making ":" the signal for type variables would break even more code, f.e. fclabels.<br>
<br>
"~" almost means "variable", so I'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 <<a href="mailto:cgibbard@gmail.com">cgibbard@gmail.com</a>> wrote:<br>
<br>
> There's a fair amount of code out there which uses (~>) as a type<br>
> variable (we have ~10k lines of heavy arrow code at iPwn). It would be<br>
> *really* nice if that could be accommodated somehow. But the proposal<br>
> you just gave at least would allow for a textual substitution, so not<br>
> quite so bad as having to change everything to prefix notation.<br>
><br>
> On 14 September 2012 19:26, Simon Peyton-Jones <<a href="mailto:simonpj@microsoft.com">simonpj@microsoft.com</a>> wrote:<br>
>> Fair point. So you are saying it’d be ok to say<br>
>><br>
>><br>
>><br>
>> data T (.->) = MkT (Int .-> Int)<br>
>><br>
>><br>
>><br>
>> where (.+) is a type variable? Leaving ordinary (+) available for type<br>
>> constructors.<br>
>><br>
>><br>
>><br>
>> If we are inverting the convention I wonder whether we might invert it<br>
>> completely and use “:” as the “I’m different” herald as we do for<br>
>> *constructor* operators in terms. Thus<br>
>><br>
>><br>
>><br>
>> data T (:->) = MkT (Int :-> Int)<br>
>><br>
>><br>
>><br>
>> That seems symmetrical, and perhaps nicer than having a new notation.<br>
>><br>
>><br>
>><br>
>> In terms In types<br>
>><br>
>> -----------------------------------------------------------------------<br>
>><br>
>> a Term variable Type variable<br>
>><br>
>> A Data constructor Type constructor<br>
>><br>
>> + Term variable operator Type constructor operator<br>
>><br>
>> :+ Data constructor operator Type variable operator<br>
>><br>
>><br>
>><br>
>> Any other opinions?<br>
>><br>
>><br>
>><br>
>> Simon<br>
>><br>
>><br>
>><br>
>> 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>
>> Conal Elliott<br>
>> Sent: 06 September 2012 23:59<br>
>> To: Simon Peyton-Jones<br>
>> Cc: GHC users<br>
>> Subject: Re: Type operators in GHC<br>
>><br>
>><br>
>><br>
>> Oh dear. I'm very sorry to have missed this discussion back in January. I'd<br>
>> be awfully sad to lose pretty infix notation for type variables of kind * -><br>
>> * -> *. I use them extensively in my libraries and projects, and pretty<br>
>> notation matters.<br>
>><br>
>> I'd be okay switching to some convention other than lack of leading ':' for<br>
>> signaling that a symbol is a type variable rather than constructor, e.g.,<br>
>> the *presence* of a leading character such as '.'.<br>
>><br>
>> Given the increasing use of arrow-ish techniques and of type-level<br>
>> programming, I would not classify the up-to-7.4 behavior as a "foolish<br>
>> consistency", especially going forward.<br>
>><br>
>> -- Conal<br>
>><br>
>> On Wed, Jan 18, 2012 at 6:27 AM, Simon Peyton-Jones <<a href="mailto:simonpj@microsoft.com">simonpj@microsoft.com</a>><br>
>> wrote:<br>
>><br>
>> Dear GHC users<br>
>><br>
>> As part of beefing up the kind system, we plan to implement the "Type<br>
>> 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<br>
>> ALL operators, allowing<br>
>> data a + b = Left a | Right b<br>
>><br>
>> Although this technically inconsistent the value page (as the wiki page<br>
>> discussed), I think the payoff is huge. (And "A foolish consistency is the<br>
>> hobgoblin of little minds", Emerson)<br>
>><br>
>><br>
>> This email is (a) to highlight the plan, and (b) to ask about flags. Our<br>
>> preferred approach is to *change* what -XTypeOperators does, to allow type<br>
>> operators that do not start with :. But that will mean that *some*<br>
>> (strange) programs will stop working. The only example I have seen in tc192<br>
>> 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<br>
>> *constructor* rather than (as now) a type *variable*. Of course it's easily<br>
>> 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.<br>
>> 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>
>><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>
>><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>
<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>