Skip to content

GHC tells me to use RankNTypes when it's already enabled

I was stumped for a while today because GHC kept telling me to turn on RankNTypes even when it was already enabled! I eventually realized this was the problem:

{-# LANGUAGE RankNTypes #-}
module Bug where

foo :: foral a. a -> a
foo x = x
$ ghc Bug.hs
[1 of 1] Compiling Bug              ( Bug.hs, Bug.o )

Bug.hs:4:15: error:
    Illegal symbol '.' in type
    Perhaps you intended to use RankNTypes or a similar language
    extension to enable explicit-forall syntax: forall <tvs>. <type>

That is, the real culprit was misspelling forall as foral.

Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
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