[GHC] #7888: Impredicativity flag needed more often
GHC
cvs-ghc at haskell.org
Wed May 15 15:25:17 CEST 2013
#7888: Impredicativity flag needed more often
------------------------------------------------+---------------------------
Reporter: monoidal | Owner:
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler (Type checker) | Version: 7.6.3
Resolution: fixed | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: Incorrect warning at compile-time | Difficulty: Unknown
Testcase: typecheck/should_compile/T7888 | Blockedby:
Blocking: | Related:
------------------------------------------------+---------------------------
Changes (by simonpj):
* status: new => closed
* difficulty: => Unknown
* resolution: => fixed
* testcase: => typecheck/should_compile/T7888
Comment:
There really is a reason for this. The elaborated definition would be
{{{
f :: forall b. (forall a. a) -> b
= /\b. undefined @((forall a. a) -> b)
}}}
So we need to instantiate `undefined` at a polytype, which isn't usually
allowed. But it is for `error` and there's no reason not to allow
`undefined` too.
See the commit comments above. Both for `error` and `undefined`, it's a
bit of a hack.
Simon
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7888#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list