summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/GF/Command/Commands.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/GF/Command/Commands.hs b/src/GF/Command/Commands.hs
index 2c30b89d0..7ea046cbb 100644
--- a/src/GF/Command/Commands.hs
+++ b/src/GF/Command/Commands.hs
@@ -610,9 +610,11 @@ allCommands cod env@(pgf, mos) = Map.fromList [
Nothing -> case Map.lookup id (cats (abstract pgf)) of
Just hyps -> do return $ fromString $
render (text "cat" <+> text (prCId id) <+> hsep (map ppHypo hyps) $$
- space $$
- text "fun" <+> vcat [text (prCId fid) <+> colon <+> ppType 0 ty
- | (fid,ty) <- functionsToCat pgf id])
+ if null (functionsToCat pgf id)
+ then empty
+ else space $$
+ text "fun" <+> vcat [text (prCId fid) <+> colon <+> ppType 0 ty
+ | (fid,ty) <- functionsToCat pgf id])
Nothing -> do putStrLn "unknown identifier"
return void
_ -> do putStrLn "a single identifier is expected from the command"