From 7db4b641ce6abe90dd404459cd5eccb6e67f618c Mon Sep 17 00:00:00 2001 From: krasimir Date: Wed, 20 May 2009 21:03:56 +0000 Subject: refactor the PGF.Expr type and the evaluation of abstract expressions --- src/GF/Command/Commands.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/GF/Command/Commands.hs') diff --git a/src/GF/Command/Commands.hs b/src/GF/Command/Commands.hs index fff9e011d..f29fd3d41 100644 --- a/src/GF/Command/Commands.hs +++ b/src/GF/Command/Commands.hs @@ -600,11 +600,11 @@ allCommands cod env@(pgf, mos) = Map.fromList [ exec = \opts arg -> do case arg of [Fun id []] -> case Map.lookup id (funs (abstract pgf)) of - Just (ty,def) -> return $ fromString $ + Just (ty,eqs) -> return $ fromString $ render (text "fun" <+> text (prCId id) <+> colon <+> ppType 0 ty $$ - if def == EEq [] + if null eqs then empty - else text "def" <+> text (prCId id) <+> char '=' <+> ppExpr 0 def) + else text "def" <+> vcat [text (prCId id) <+> hsep (map (ppPatt 9) patts) <+> char '=' <+> ppExpr 0 res | Equ patts res <- eqs]) Nothing -> case Map.lookup id (cats (abstract pgf)) of Just hyps -> do return $ fromString $ render (text "cat" <+> text (prCId id) <+> hsep (map ppHypo hyps) $$ -- cgit v1.2.3