Re: [GHC] #4426: Simplify the rules for implicit quantification

#4426: Simplify the rules for implicit quantification -------------------------------------+------------------------------------ Reporter: simonpj | Owner: Type: feature request | Status: patch Priority: low | Milestone: 7.6.2 Component: Compiler | Version: 6.12.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: #7880 -------------------------------------+------------------------------------ Changes (by monoidal): * status: new => patch Comment: Patch attached. It adds a new warning `-fwarn-context-quantification` that reports when a variable is quantified only because it under a "=>" arrow. Later, as the proposal says, this warning will be made an out-of-scope error. Normally, `HsForAll` is either `HsForAll Implicit` or `HsForAll Explicit`, and a context `T => R` inserts `HsForAll Implicit`. This patch adds a new value, `HsForAll Qualified`, which is completely equivalent to `HsForAll Implicit` save for the warning message. Later, its behavior will be changed and the renamer will not do implicit quantification for variables under `HsForAll Quantified`. I made `-Wall` not imply this flag, in (doubtful) case there is still time to merge this to GHC 7.8. In this case, there is full backwards compatibility: no change in behavior except if the flag is explicitly supplied. However, the API is slightly changed and I had to make a tiny change to Haddock. If it's too late, in GHC 7.10 I'd like `-Wall` to enable `-fwarn-context-quantification`, so I'll amend the patch. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/4426#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC