[speed up substitution merge
Helmut Grohne <grohne@cs.uni-bonn.de>**20150206101653
 Ignore-this: eba552d97a4952cfd9368ecbcc46b9f1
 
 Instead of using list intersection which is O(n^2), set intersection which is
 O(n log n) can be used. The conversion to set comes for free as sets and maps
 use the same structure.
 
 Benchmarking the test suite confirms a speedup of 1.5%.
] hunk ./src/Syntax/Class/Subst.hs 26
+import qualified Data.Set as S
hunk ./src/Syntax/Class/Subst.hs 62
-                   (on intersect (map fst . assocs) s1 s2)
+                   (S.toList ((S.intersection `on` (M.keysSet . unSubst)) s1 s2))
