[print out type synonym expansions in jhci
John Meacham <john@repetae.net>**20051204040953] {
hunk ./FrontEnd/TypeSynonyms.hs 5
-    TypeSynonyms
+    TypeSynonyms,
+    showSynonym
hunk ./FrontEnd/TypeSynonyms.hs 27
+
+showSynonym :: (DocLike d,Monad m) => (HsType -> d) -> Name -> TypeSynonyms -> m d
+showSynonym pprint n (TypeSynonyms m) = do
+    (ns, t, _) <- Map.lookup n m
+    return $ hsep (tshow n:map tshow ns) <+> text "=" <+> pprint t
hunk ./Interactive.hs 12
-import FrontEnd.HsParser(parseHsStmt)
-import FrontEnd.ParseMonad
hunk ./Interactive.hs 15
+import FrontEnd.HsParser(parseHsStmt)
+import FrontEnd.KindInfer
+import FrontEnd.ParseMonad
hunk ./Interactive.hs 24
+import Representation
+import TypeSynonyms(showSynonym)
hunk ./Interactive.hs 80
-            Just rx -> mapM_ putStrLn $ sort [ nameTag (nameType v):' ':show v <+> "::" <+> ptype v  | v <- Map.keys (hoDefs ho), isJust (matchRegex rx (show v)), nameTag (nameType v) `elem` opt ]
+            --Just rx -> mapM_ putStrLn $ sort [ nameTag (nameType v):' ':show v <+> "::" <+> ptype v  | v <- Map.keys (hoDefs ho), isJust (matchRegex rx (show v)), nameTag (nameType v) `elem` opt ]
+            Just rx -> mapM_ putStrLn $ sort [ pshow opt v  | v <- Map.keys (hoDefs ho), isJust (matchRegex rx (show v)), nameTag (nameType v) `elem` opt ]
hunk ./Interactive.hs 89
+    pshow _opt v
+        | Just d <- showSynonym (show . (pprint :: Type -> PP.Doc) . aHsTypeToType (hoKinds ho)) v (hoTypeSynonyms ho) = nameTag (nameType v):' ':d
+        | otherwise = nameTag (nameType v):' ':show v <+> "::" <+> ptype v
}
