#6032: HEAD (7.5.20120421) requires RankNTypes for a rank-2 type
---------------------------------+------------------------------------------
    Reporter:  dreixel           |       Owner:                  
        Type:  bug               |      Status:  new             
    Priority:  normal            |   Milestone:                  
   Component:  Compiler          |     Version:  7.5             
    Keywords:                    |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown    
  Difficulty:  Unknown           |    Testcase:                  
   Blockedby:                    |    Blocking:                  
     Related:                    |  
---------------------------------+------------------------------------------
Changes (by simonpj):

  * difficulty:  => Unknown


Comment:

 The difficulty is this
  * The argument of a rank-2 arrow type should have rank 1
  * A vanilla H98 type sig has rank 1
  * But technically `(Int -> forall a. a->a)` is rank 1, although it is not
 H98.

 GHC currently has the (somewhat ad-hoc) restriction that a rank-1 type
 must have all its foralls at the front, which is why this program is
 rejected.  And yes that's a change in behaviour.  (A different bug report
 said that `(Int -> forall a. a->a)` was accepted despite no higher-rank
 flags being on.

 Perhaps it'd be better to always accept foralls to the right of an arrow.
 After all, you need at least `-XForAllTypes` to be able to write them.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to