2 % (c) The AQUA Project, Glasgow University, 1996-1998
4 \section[PprEnv]{The @PprEnv@ type}
13 pCon, pBndr, pOcc, pSCC,
17 #include "HsVersions.h"
19 import {-# SOURCE #-} Const ( Con )
21 import Var ( Id, TyVar )
22 import CostCentre ( CostCentre )
27 %************************************************************************
29 \subsection{Public interfaces for Core printing (excluding instances)}
31 %************************************************************************
37 pSCC :: CostCentre -> SDoc,
39 pTyVarO :: TyVar -> SDoc, -- to print tyvar occurrences
40 pTy :: Type -> SDoc, -- to print types
42 pBndr :: BindingSite -> bndr -> SDoc, -- to print value binders
43 pOcc :: Id -> SDoc -- to print value occurrences
47 @BindingSite@ is used to tell the thing that prints binder what
48 language construct is binding the identifier.
51 data BindingSite = LambdaBind | CaseBind | LetBind
56 :: Maybe (Con -> SDoc)
57 -> Maybe (CostCentre -> SDoc)
58 -> Maybe (TyVar -> SDoc)
59 -> Maybe (Type -> SDoc)
60 -> Maybe (BindingSite -> bndr -> SDoc)
64 -- you can specify all the printers individually; if
65 -- you don't specify one, you get bottom
67 initPprEnv p c tvo ty bndr occ
75 demaybe Nothing = bottom
78 bottom = panic "PprEnv.initPprEnv: unspecified printing function"