#9072 closed bug (invalid)

RankNTypes composition now requires ImpredicativeTypes

Reported by: gelisam Owned by:
Priority: normal Milestone:
Component: Compiler (Type checker) Version: 7.8.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: GHC rejects valid program Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:


{-# LANGUAGE RankNTypes #-}

instantiateId :: (forall a. a -> a) -> Int -> Int
instantiateId f = f

passes :: [Int] -> [Int]
passes = map (instantiateId id)

-- Couldn't match type ‘a0 -> a0’ with ‘forall a. a -> a’
fails :: [Int] -> [Int]
fails = (map . instantiateId) id

works with ghc 7.6, fails with ghc 7.8, works with ghc 7.8 + ImpredicativeTypes.

Change History (1)

comment:1 Changed 15 months ago by simonpj

  • Resolution set to invalid
  • Status changed from new to closed

This is, I guess, a bug in 7.6. You really do need impredicative instantiation for the application of (.) to work. So I don't think this is a bug in 7.8. Yell if you disagree.


Note: See TracTickets for help on using tickets.