:instances returns ill kinded result when combined with QuantifiedConstraints
If I load the following module into GHCi:
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE QuantifiedConstraints #-}
{-# LANGUAGE UndecidableInstances #-}
module Bug where
import Data.Kind
import Data.Proxy
class (forall (z :: k). Show (Proxy z)) => ShowProxy (k :: Type)
instance (forall (z :: k). Show (Proxy z)) => ShowProxy (k :: Type)
data T :: Type -> Type
And then run the following GHCi command, here is what I get:
$ ghci Bug.hs
GHCi, version 8.10.1: https://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/rgscott/.ghci
[1 of 1] Compiling Bug ( Bug.hs, interpreted )
Ok, one module loaded.
λ> :instances T
instance [safe] ShowProxy T -- Defined at Bug.hs:11:10
instance ShowProxy T
is utter nonsense, and that won't even kind-check:
λ> :kind ShowProxy T
<interactive>:1:11: error:
• Expecting one more argument to ‘T’
Expected a type, but ‘T’ has kind ‘* -> *’
• In the first argument of ‘ShowProxy’, namely ‘T’
In the type ‘ShowProxy T’
So I have no idea how :instances
is coming up with that. cc @xldenis