gadt

Real world use of GADT

Is there any good resource on real use of Generalized Abstract Data Type? The example given in the haskell wikibook is too short to give me an insight of the real possibilities of GADT. Thanks ...

Material for Learning GADT

I started reading about GADT in Haskell Wiki but didn't feel quite comfortable understanding it. Do you recommend a specific book chapter or a blog post explaining GADT for a Haskell beginner? ...

Runtime comparison of types for lifting polymorphic data structures into GADTs.

Suppose we define a GADT for comparison of types: data EQT a b where Witness :: EQT a a Is it then possible to declare a function eqt with the following type signature: eqt :: (Typeable a, Typeable b) => a -> b -> Maybe (EQT a b) ...such that eqt x y evaluates to Just Witness if typeOf x == typeOf y --- and otherwise to Nothing? ...

Transforming untyped representation of a DSL into typed representation

Given a simple language, say data E where ValE :: Typeable a => a -> E AppE :: E -> E -> E is it then possible to transform it into a typed representation: data T a where ValT :: Typeable a => a -> T a AppT :: T (a -> b) -> T a -> T b deriving Typeable I have tried various approaches, e.g. the following: e2t :: Typeable ...