[GHC] #10281: Type error with Rank-n-types

GHC ghc-devs at haskell.org
Thu Apr 9 20:37:06 UTC 2015


#10281: Type error with Rank-n-types
-------------------------------------+-------------------------------------
        Reporter:  rhjl              |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler (Type    |                 Version:  7.10.1
  checker)                           |                Keywords:
      Resolution:                    |            Architecture:
Operating System:  Unknown/Multiple  |  Unknown/Multiple
 Type of failure:  GHC rejects       |               Test Case:
  valid program                      |  Peirce_eq_LEM.hs
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by rhjl):

 I just confirmed that the issue persists in version 7.10.1;  additionally,
 the following code, also part of the attached file, now produces an error.

 {{{#!hs
 type DNE = ∀ 𝑎. Not (Not 𝑎) → 𝑎

 peirce_implies_dne ∷ Peirce → DNE
 peirce_implies_dne peirce = \dn → peirce dn
 }}}

 The error is:
 {{{
 67:42:
     Couldn't match type ‘𝑏0’ with ‘𝑎1’
       because type variable ‘𝑎1’ would escape its scope
     This (rigid, skolem) type variable is bound by
       a type expected by the context: 𝑎 -> 𝑎1
       at Peirce_eq_LEM.hs:67:42-43
     Expected type: (𝑎 -> 𝑏0) -> 𝑎
       Actual type: Not 𝑎 -> 𝑎
     In the first argument of ‘peirce’, namely ‘dn’
     In the expression: peirce dn
 }}}

 This seems less confusing than the error in the original report;
 nevertheless I found it curious, because it is new in version 7.10.1, and
 because the expression naively unifies to the correct type.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10281#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list