
4 Jun
2015
4 Jun
'15
8:07 p.m.
Excerpts from Johan Tibell's message of 2015-06-04 16:52:30 -0700:
I guess we should parse it as T a (~b), just as we have unary minus bind "tighter" with the following token.
Not in all contexts. It is true that if you have 'data SLPair a b = SLP a ~ b' you want to parse 'SLP a (~b)' But if you have 'Maybe a ~ b' you want to parse '(Maybe a) ~ b'. But in GADTs, if you have data SLPair a b where SLP :: a -> ~ b -> SLPair a b you want a -> (~ b) -> SLPair a b If the twiddle is not immediately after an arrow you don't want that, e.g. data T a b where T :: a -> a ~ b -> SLPair a b you want T :: a -> (a ~ b) -> SLPair a b Edward