6 :: BM a b = {t :: a -> b, f :: b -> a}
11 | (+.) infixl 6 (Expr a) (Expr a)
12 | (*.) infixl 6 (Expr a) (Expr a)
15 | XOR (Expr Bool) (Expr Bool)
17 | E.b: Eq (Expr b) ( Expr b) & == b
19 | Try (Expr a) (Expr a)
21 class show a :: a [String] -> [String]
22 instance show (Expr a) where
23 show (Lit x) l = [toString x:l]
24 show (x1 +. x2) l = show x1 ["+":show x2 l]
25 show (x1 *. x2) l = show x1 ["*":show x2 l]
26 show Read l = ["Read":l]
27 show (Write x) l = ["Write (":show x [")":l]]
28 show (XOR x1 x2) l = show x1 ["XOR":show x2 l]
29 show (Not x) l = ["Not":show x l]
30 show (Eq x1 x2) l = show x1 ["==":show x2 l]
31 show Throw l = ["throw":l]
32 show (Try x1 x2) l = ["Try":show x1 ["Except":show x2 l]]