[Haskell-cafe] Counterintuitive ScopedTypeVariables behaviour
Richard Eisenberg
rae at richarde.dev
Tue Sep 8 18:16:28 UTC 2020
> On Sep 7, 2020, at 8:04 AM, Tom Ellis <tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk> wrote:
>
> On the
> other hand I'm still somewhat concerned that the meaning of the syntax
> can vary depending on whether the type variable is in scope or not.
Yes. This has been a spot of discomfort for some time (at least for me, and I know I'm not completely alone).
A recent accepted, unimplemented proposal (https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0285-no-implicit-binds.rst) describes -XNoPatternSignatureBinds, which disallows not-in-scope variables from appearing in pattern signatures. Instead, the variable must come into scope some other way. That "other way" depends on proposals not yet completely formed/accepted, but once the dust has settled, I think you'll get what you want with -XNoPatternSignatureBinds.
Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20200908/0678597c/attachment.html>
More information about the Haskell-Cafe
mailing list