From b037cbc361da5933e7c37f0117e46fbc07d2594f Mon Sep 17 00:00:00 2001 From: krasimir Date: Tue, 12 May 2009 20:52:18 +0000 Subject: added command ai which prints information about given identifier --- src/PGF/Type.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/PGF') diff --git a/src/PGF/Type.hs b/src/PGF/Type.hs index fec8c0ff2..8c513ffd4 100644 --- a/src/PGF/Type.hs +++ b/src/PGF/Type.hs @@ -1,6 +1,6 @@ module PGF.Type ( Type(..), Hypo(..), readType, showType, - pType, ppType ) where + pType, ppType, ppHypo ) where import PGF.CId import PGF.Expr @@ -67,12 +67,13 @@ ppType d (DTyp ctxt cat args) | null ctxt = ppRes cat args | otherwise = ppParens (d > 0) (foldr ppCtxt (ppRes cat args) ctxt) where - ppCtxt (Hyp x typ) doc - | x == wildCId = ppType 1 typ PP.<+> PP.text "->" PP.<+> doc - | otherwise = PP.parens (PP.text (prCId x) PP.<+> PP.char ':' PP.<+> ppType 0 typ) PP.<+> PP.text "->" PP.<+> doc - + ppCtxt hyp doc = ppHypo hyp PP.<+> PP.text "->" PP.<+> doc ppRes cat es = PP.text (prCId cat) PP.<+> PP.hsep (map (ppExpr 2) es) +ppHypo (Hyp x typ) + | x == wildCId = ppType 1 typ + | otherwise = PP.parens (PP.text (prCId x) PP.<+> PP.char ':' PP.<+> ppType 0 typ) + ppParens :: Bool -> PP.Doc -> PP.Doc ppParens True = PP.parens ppParens False = id -- cgit v1.2.3