#lang plait
(define-type AE
[Num (n : Number)]
[Add (l : AE) (r : AE)]
[Sub (l : AE) (r : AE)])
(define (eval expr)
(type-case AE expr
[(Num n) n]
[(Add l r) (+ (eval l) (eval r))]
[(Sub l r) (- (eval l) (eval r))]))
(eval (Add (Num 1) (Num 2)))