2 % (c) The AQUA Project, Glasgow University, 1996-1998
4 \section[PprEnv]{The @PprEnv@ type}
17 #include "HsVersions.h"
19 import Var ( Id, TyVar )
20 import CostCentre ( CostCentre )
25 %************************************************************************
27 \subsection{Public interfaces for Core printing (excluding instances)}
29 %************************************************************************
34 pSCC :: CostCentre -> SDoc,
36 pTyVarO :: TyVar -> SDoc, -- to print tyvar occurrences
37 pTy :: Type -> SDoc, -- to print types
39 pBndr :: BindingSite -> bndr -> SDoc, -- to print value binders
40 pOcc :: Id -> SDoc -- to print value occurrences
44 @BindingSite@ is used to tell the thing that prints binder what
45 language construct is binding the identifier.
48 data BindingSite = LambdaBind | CaseBind | LetBind
53 :: Maybe (CostCentre -> SDoc)
54 -> Maybe (TyVar -> SDoc)
55 -> Maybe (Type -> SDoc)
56 -> Maybe (BindingSite -> bndr -> SDoc)
60 -- you can specify all the printers individually; if
61 -- you don't specify one, you get bottom
63 initPprEnv c tvo ty bndr occ
70 demaybe Nothing = bottom
73 bottom = panic "PprEnv.initPprEnv: unspecified printing function"