Impredicativity behavior in `:k` command in GHCi
In GHCi, the following command works:
Prelude> :set -XRankNTypes Prelude> :k (Maybe (forall a. a -> a)) (Maybe (forall a. a -> a)) :: *
Note here the type argument of
Maybe is a polymorphic type.
However the following would be (correctly) rejected:
Prelude> let f :: (Maybe (forall a. a -> a)) -> Int; f _ = 1 <interactive>:4:10: error: • Illegal polymorphic type: forall a. a -> a GHC doesn't yet support impredicative polymorphism • In the type signature: f :: (Maybe (forall a. a -> a)) -> Int
Question: why does
:k behave differently and is it what is expected?
I think if we have #14859 (closed) those are both acceptable though?