diff options
Diffstat (limited to 'transfer/examples')
| -rw-r--r-- | transfer/examples/tricky-type-checking.tra | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/transfer/examples/tricky-type-checking.tra b/transfer/examples/tricky-type-checking.tra index 4cc8037ba..ad69c33db 100644 --- a/transfer/examples/tricky-type-checking.tra +++ b/transfer/examples/tricky-type-checking.tra @@ -8,6 +8,12 @@ data Tree : Type -> Type where EInt : Integer -> Tree Integer EFoo : (A:Type) -> A -> Tree A +eval : (B : Type) -> Tree B -> Tree B +eval _ t = case t of + EAdd x y -> EInt (x+y) + EInt i -> EInt i + EFoo T x -> EFoo T x + strip : (B : Type) -> Tree B -> B strip _ t = case t of EAdd x y -> x+y |
