[Haskell-cafe] Pattern synonyms and explicit forall.

Anthony Clayden anthony.d.clayden at gmail.com
Sun Sep 19 03:59:06 UTC 2021


> And there's not a mention in the docos that this is even a thing.

To moderate myself ...

There's one example pattern sig with explicit `forall`s, and it's wrt
existentials/GADTs.
https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/pattern_synonyms.html?highlight=pattern%20synonym#typing-of-pattern-synonyms,
bullet wrt lexically-scoped tyvars.

It doesn't say you can have a dangling `forall` quantifying nothing --
indeed that you need such a thing in this case.

It looks like if you want to constrain the existential, you have to declare
that in the datatype, then repeat it in the sig for the pattern.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20210919/bc353944/attachment.html>


More information about the Haskell-Cafe mailing list