Skip to content

HEAD (7.5.20120421) requires RankNTypes for a rank-2 type

While building syb with HEAD, Ian reported that he needed to use RankNTypes instead of Rank2Types. I minimized the problem to:

{-# LANGUAGE Rank2Types #-}

module Rank2 where

f :: (forall a. a -> (forall b. b)) -> c
f = undefined

g :: (forall a b. a -> b) -> c
g = undefined
  1. 4 accepts both f and g. HEAD complains on the signature of f:
    Illegal polymorphic or qualified type: forall b. b
    Perhaps you intended to use -XRankNTypes or -XRank2Types
    In the type signature for `f':
      f :: (forall a. a -> (forall b. b)) -> c

It doesn't complain about g, but I think the signatures are equivalent. Ian further reports that the change in behavior seems to have occurred after 7.5.20120401.

Trac metadata
Trac field Value
Version 7.5
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information