- print (BoolExpr b) = [toString b]
- print (FunExpr fc) = print fc
- print EmptyListExpr = ["[]"]
- print (TupleExpr (e1, e2)) = ["(":print e1] ++ [",":print e2] ++ [")"]
+ print (BoolExpr _ b) = [toString b]
+ print (FunExpr _ id as fs) = printFunCall id as ++ printSelectors fs
+ print (EmptyListExpr _) = ["[]"]
+ print (TupleExpr _ (e1, e2)) = ["(":print e1] ++ [",":print e2] ++ [")"]
+
+printSelectors :: [FieldSelector] -> [String]
+printSelectors x = case x of [] = [""]; _ = [".":printersperse "." x]
+
+printFunCall :: String [Expr] -> [String]
+printFunCall s args = [s, "(":printersperse "," args] ++ [")"]
+
+derive gEq Op2
+instance == Op2 where (==) o1 o2 = gEq{|*|} o1 o2