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