1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
{-# LANGUAGE GADTs #-} module Main where import Gadt23_AST data Foo = Foo { bar :: Int } convert :: AST a tag -> AST a Foo convert t = case t of Var v -> Tag (Foo 42) $ Var v Tag t e -> Tag (Foo 42) $ convert e main = return ()