Skip to content

The ‘Type’ kind is printed without accounting for scope

The Type is printed unqualified:

ghci> :set -XNoStarIsType
ghci> :k (->)
(->) :: Type -> Type -> Type

That is expected behavior. But it becomes incorrect if the user defines their own Type:

ghci> data Type
ghci> :k (->)
(->) :: Type -> Type -> Type

This is misleading. We should qualify Type appropriately in such cases:

ghci> :k (->)
(->) :: GHC.Types.Type -> GHC.Types.Type -> GHC.Types.Type

I was aware of this issue back when I implemented NoStarIsType, but I couldn’t figure out what to do about it. Turns out we have all the machinery in PprStyle!

Fix coming.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information