akind :: { IfaceKind }
: '*' { ifaceLiftedTypeKind }
| '#' { ifaceUnliftedTypeKind }
| '?' { ifaceOpenTypeKind }
| '(' kind ')' { $2 }
kind :: { IfaceKind }
: akind { $1 }
| akind '->' kind { ifaceArrow $1 $3 }
However, I don’t know how to get GHC to accept ‘#’ or ‘?’ in a kind annotation. Are these kinds really available to source programs.
I see that undefined has an open-kinded type:
*Main> :i undefined
undefined :: forall (a :: OpenKind). a -- Defined in ‘GHC.Err’
Looking in the GHC.Err source, I just see the following:
undefined :: a
undefined = error "Prelude.undefined"
However, if I try similarly,
q :: a
q = error "q"
I don’t see a similar type:
*X> :i q
q :: forall a. a -- Defined at ../test/X.hs:12:1