Pattern Synonym Signature Confusion

Sven Panne 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.

Cheers,
   S.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20151001/98df4cca/attachment.html>


More information about the ghc-devs mailing list