Partially promoted data types
Consider
{-# LANGUAGE DataKinds, PolyKinds #-}
data D a where
D1 :: a -> D a
D2 :: (a~Int) => D a
D3 :: forall (a:k). Proxy a -> D b
Is D
a promoted type?
Well, D1
is promotable, but D2
is not because of constraints in its type, and neither is D3
because it uses kind polymorphism. It's a bit odd to promote only one of the three constructors, but that is what happens right now.
We should probably check for promotability of all data constructors, and promote all or none. A bit of fiddling around is need to do this, so I'm opening a ticket. It's not terribly pressing.