Pattern Synonym Signature Confusion
svenpanne at gmail.com
Thu Oct 1 17:12:43 UTC 2015
2015-10-01 13:23 GMT+02:00 Matthew Pickering <matthewtpickering at gmail.com>:
> I think that the current state of pattern synonym signatures is quite
> confusing, especially regarding the constraints. [...]
Thanks to an off-list email from Matthew (thanks for that!) I found out that
pattern FOO = 1234 :: Int
behaves differently from
pattern FOO :: Int
pattern FOO = 1234
In the former case one has to use ScopedTypeVariables, in the latter case
it works without it. This is not really intuitive, although I'll have to
admit that I've had only a cursory look at the "Typing of pattern synonyms"
section in the GHC manual. But even after re-reading it, it's not really
clear where the difference in the above example comes from.
So in a nutshell: +1 for the "quite confusing" argument.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ghc-devs