summaryrefslogtreecommitdiff
path: root/src/runtime/haskell/PGF/Printer.hs
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2010-01-29 21:10:14 +0000
committerkrasimir <krasimir@chalmers.se>2010-01-29 21:10:14 +0000
commit3b7e39fa4ab2dcfc6ec9591be6476b4240baf671 (patch)
tree4a82a254abbf1e801c98964d6e25e20dd132f0f3 /src/runtime/haskell/PGF/Printer.hs
parente5de8ea9fe981a11ffd2672dd047d107e65b63a0 (diff)
bugfix in the PGF typechecker and more test cases
Diffstat (limited to 'src/runtime/haskell/PGF/Printer.hs')
-rw-r--r--src/runtime/haskell/PGF/Printer.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/runtime/haskell/PGF/Printer.hs b/src/runtime/haskell/PGF/Printer.hs
index ee0fd4070..d458eb1a7 100644
--- a/src/runtime/haskell/PGF/Printer.hs
+++ b/src/runtime/haskell/PGF/Printer.hs
@@ -27,12 +27,13 @@ ppAbs name a = text "abstract" <+> ppCId name <+> char '{' $$
ppCat :: CId -> [Hypo] -> Doc
ppCat c hyps = text "cat" <+> ppCId c <+> hsep (snd (mapAccumL ppHypo [] hyps))
-ppFun :: CId -> (Type,Int,[Equation]) -> Doc
-ppFun f (t,_,eqs) = text "fun" <+> ppCId f <+> colon <+> ppType 0 [] t $$
- if null eqs
- then empty
- else text "def" <+> vcat [let (scope,ds) = mapAccumL (ppPatt 9) [] patts
- in ppCId f <+> hsep ds <+> char '=' <+> ppExpr 0 scope res | Equ patts res <- eqs]
+ppFun :: CId -> (Type,Int,Maybe [Equation]) -> Doc
+ppFun f (t,_,Just eqs) = text "fun" <+> ppCId f <+> colon <+> ppType 0 [] t $$
+ if null eqs
+ then empty
+ else text "def" <+> vcat [let (scope,ds) = mapAccumL (ppPatt 9) [] patts
+ in ppCId f <+> hsep ds <+> char '=' <+> ppExpr 0 scope res | Equ patts res <- eqs]
+ppFun f (t,_,Nothing) = text "data" <+> ppCId f <+> colon <+> ppType 0 [] t
ppCnc :: Language -> Concr -> Doc
ppCnc name cnc =