ImpredicativeTypes vs. LiberalTypeSynonyms
Consider the following module:
{-# LANGUAGE Rank2Types #-}
module RunMud where
import Control.Monad.State
type Mud = StateT MudState IO
data MudState = MudState { mRunMud :: RunMud }
type RunMud = forall a. Mud a -> IO a
getRunMud :: Mud RunMud
getRunMud = do
s <- get
return (mRunMud s)
GHC suggests:
Illegal polymorphic or qualified type: RunMud
Perhaps you intended to use -XImpredicativeTypes
When I add a language pragma for ImpredicativeTypes, GHC stills comes up with the same error message.
Two questions:
-
Can GHC please not suggest enabling extensions that are already enabled? It's very confusing.
-
Can GHC in this specific case suggest LiberalTypeSynonyms? That's the third extension that needed to be on for this example to compile.
Trac metadata
Trac field | Value |
---|---|
Version | 6.10.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |