
On Tue, Feb 19, 2013 at 9:28 PM, Anton Kholomiov
Do you think the approach can be extended for non-regular (nested)
algebraic types (where the recursive data type is sometimes at a different type instance)? For instance, it's very handy to use GADTs to capture embedded language types in host language (Haskell) types, which leads to non-regularity.
I'm not sure I understand the case you are talking about. Can you write a simple example of the types like this?
Here's an example of a type-embedded DSEL, represented as a GADT:
data E :: * -> * where Lit :: Show a => a -> E a Op :: Op a -> E a App :: E (a -> b) -> E a -> E b ...
data Op :: * -> * where Add :: Num a => E (a -> a -> a) Mul :: Num a => E (a -> a -> a) Neg :: Num a => E (a -> a) ...
-- Conal