in the ai command don't show the fun keyword if there aren't any functions.

This commit is contained in:
krasimir
2009-06-18 17:44:29 +00:00
parent a33f1bd3c5
commit b0283d31a2

View File

@@ -610,9 +610,11 @@ allCommands cod env@(pgf, mos) = Map.fromList [
Nothing -> case Map.lookup id (cats (abstract pgf)) of Nothing -> case Map.lookup id (cats (abstract pgf)) of
Just hyps -> do return $ fromString $ Just hyps -> do return $ fromString $
render (text "cat" <+> text (prCId id) <+> hsep (map ppHypo hyps) $$ render (text "cat" <+> text (prCId id) <+> hsep (map ppHypo hyps) $$
space $$ if null (functionsToCat pgf id)
text "fun" <+> vcat [text (prCId fid) <+> colon <+> ppType 0 ty then empty
| (fid,ty) <- functionsToCat pgf id]) else space $$
text "fun" <+> vcat [text (prCId fid) <+> colon <+> ppType 0 ty
| (fid,ty) <- functionsToCat pgf id])
Nothing -> do putStrLn "unknown identifier" Nothing -> do putStrLn "unknown identifier"
return void return void
_ -> do putStrLn "a single identifier is expected from the command" _ -> do putStrLn "a single identifier is expected from the command"