[make specialization handle rank-n types properly
John Meacham <john@repetae.net>**20060217021744] hunk ./E/FromHs.hs 460
-    spec g s e = ct (gg g s)  e  where
-        ct ts e = foldl eAp e $ map ty $ snds ts
-        gg a b = snubFst $ gg' a b
-        gg' (TAp t1 t2) (TAp ta tb) = gg' t1 ta ++ gg' t2 tb
-        gg' (TArrow t1 t2) (TArrow ta tb) = gg' t1 ta ++ gg' t2 tb
-        gg' (TCon a) (TCon b) = if a /= b then error "constructors don't match." else []
-        gg' _ (TGen _ _) = error "Something impossible happened!"
-        gg' (TGen n _) t = [(n,t)]
-        gg' (TVar a) (TVar b) | a == b = []
-        gg' (TMetaVar a) (TMetaVar b) | a == b = []
-        gg' a b = error $ "specialization: " <> parens  (prettyPrintType a) <+> parens (prettyPrintType b) <+> "\nin spec\n" <+> vcat (map parens [prettyPrintType g, prettyPrintType s, show e])
hunk ./E/FromHs.hs 488
+    gg' (TForAll as (_ :=> ta)) (TForAll bs (_ :=> tb)) | length as == length bs = gg' ta tb -- assume names are unique