Surprising behavior with unused kind variable binders in TLKSs
GHC accepts the following:
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TopLevelKindSignatures #-}
module Bug where
import Data.Kind
data D :: forall a. Type
Naturally, I thought it would have been straightforward to turn this explicit return kind into a TLKS:
type D :: forall a. Type
data D
To my surprise, this is not accepted:
[1 of 1] Compiling Bug ( ../Bug.hs, ../Bug.o )
../Bug.hs:9:1: error:
• Expected a type, but
found something with kind
‘forall k (a :: k). *’
• In the data type declaration for ‘D’
|
9 | data D
| ^^^^^^