As Conor states, this is not directly possible. You can, however, define data K a = ... | C a Then this promotes to C :: a -> K a If you then use K *, you can achieve what you want. ...

haskell,polymorphism,dependent-type,data-kinds,type-kinds

There is no1 such thing as "types with kinds other than *". Kind * is the kind for types, much like Int is the type for machine-sized numbers; other kinds may contain stuff that resembles types or can be converted to types or is used to index types or whatever...

haskell,types,deriving,data-kinds

Yes, you can use the AutoDeriveTypeable extension. For the other part, the closest thing I could think of was to put Typeable c => inside the GADT definition as follows: {-# LANGUAGE AutoDeriveTypeable #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE DataKinds #-} import Data.Typeable import qualified Data.Map as M type...

haskell,existential-type,data-kinds

If you want to do runtime case analysis on the existential type, you need a singleton representation too: {-# LANGUAGE DataKinds, GADTs, KindSignatures, ScopedTypeVariables #-} data K = A | B -- runtime version of K. data SK (k :: K) where SA :: SK A SB :: SK B...

haskell,gadt,type-families,data-kinds,constraint-kinds

I see now that the question is how to write a proof of (All p xs, All p ys) => All p (xs :++: ys). The answer is, by induction, of course! The type of the function we really want to write is allAppend :: (p :: Constraint) -> (xs...

You can use existentials: {-# LANGUAGE GADTs, DataKinds, PolyKinds #-} data Exists :: (k -> *) -> * where This :: p x -> Exists p data JSExp :: Bool -> * where ... JSArray :: [Exists JSExp] -> JSExp False test = let aref = JSReference "a" in JSArray...

haskell,dependent-type,data-kinds,type-kinds

In current GHC (7.8 at time of writing), one cannot separate the declaration of a fresh kind from the declaration of its type-level inhabitants.