6 :: BM a b = {t :: a -> b, f :: b -> a}
11 | Add (BM a Int) (Expr a) (Expr a)
12 | Mul (BM a Int) (Expr a) (Expr a)
14 | Write (BM a a) (Expr a)
15 | XOR (BM a a) (Expr a) (Expr a)
16 | Not (BM a a) (Expr a)
17 | E.b: Eq (BM b a) (Expr b) (Expr b) & == b
19 | Try (BM a a) (BM a a)
22 show :: (a t) [String] -> [String] | toString t
24 instance show Expr where
25 show (Lit bm x) xs = [toString x:xs]
26 show (Add bm x y) xs = show x ["+":show y xs]
27 show (Mul bm x y) xs = show x ["*":show y xs]
28 show Read xs = ["read":xs]
29 show (Write bm x) xs = ["write":show x xs]
30 show (XOR bm x y) xs = show x ["XOR":show y xs]
31 show (Not bm x) xs = show x xs
32 show (Eq bm x y) xs = show x ["==":show y xs]
33 show Throw xs = ["throw":xs]
34 show (Try x y) xs = ["try":show x ["catch":show y xs]]