[GHC] #10581: Recommend ScopedTypeVariables
GHC
ghc-devs at haskell.org
Fri Jun 26 20:22:51 UTC 2015
#10581: Recommend ScopedTypeVariables
-------------------------------------+-------------------------------------
Reporter: goldfire | Owner:
Type: feature | Status: new
request | Milestone:
Priority: normal | Version: 7.10.1
Component: Compiler | Operating System: Unknown/Multiple
Keywords: | Type of failure: None/Unknown
Architecture: | Blocked By:
Unknown/Multiple | Related Tickets:
Test Case: |
Blocking: |
Differential Revisions: |
-------------------------------------+-------------------------------------
The !ScopedTypeVariables extension is one of the few that doesn't
recommend itself when it should be used.
I recognize that this may be hard to do, but here is a strawman proposal:
Always behave as if !ScopedTypeVariables is on at binding sites for type
variables (in an annotation with `forall`). Then, at ''occurrences'' of
type variables, check if the extension is on. If a type variable is in
scope but the extension is off, remember that the user probably wants the
extension, but then rename the type variable occurrence away from the in-
scope one. If a type error ensues, we've remembered that the lack of
!ScopedTypeVariables may be to blame, and we recommend turning it on.
There may be better approaches, too.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10581>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list