[speed up instance Term TExp method equal
Helmut Grohne <grohne@cs.uni-bonn.de>**20150327153749
 Ignore-this: ad7565a7b9de1f2ff0ea12e562b0db9b
 
 Speeds up test suite by about 3%. The key here is to spell out the case for
 TAppE and avoid calling sameTy on TAppE as this computes types. Also avoid
 calling subterms on TAppE which would call unfoldTAppE.
] hunk ./src/Syntax/Expressions.hs 107
-    equal s@(TVarE  sn _ ) t@(TVarE tn _)  = (sameTy s t) && (sn == tn)
-    equal s@(TWildE _ _ ) t                = (sameTy s t)
-    equal s t@(TWildE _ _)                 = (sameTy s t) 
-    equal s t                              = 
-        and $ (sameTy s t)
-            : (sameSymAtRoot s t)
-            : ( ((zipWith equal) `on` subterms) s t )
-       
+    equal (TVarE s1 t1)  (TVarE s2 t2)  = s1 == s2 && equal t1 t2
+    equal s@(TWildE _ _) t              = sameTy s t
+    equal s              t@(TWildE _ _) = sameTy s t
+    equal (TAppE r1 l1)  (TAppE r2 l2)  = equal r1 r2 && equal l1 l2
+    equal (TConE n1 t1)  (TConE n2 t2)  = n1 == n2 && equal t1 t2
+    equal (TLitE l1 t1)  (TLitE l2 t2)  = l1 == l2 && equal t1 t2
+    equal _              _              = False
+