From: sof Date: Mon, 26 May 1997 04:48:40 +0000 (+0000) Subject: [project @ 1997-05-26 04:48:18 by sof] X-Git-Tag: Approximately_1000_patches_recorded~486 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=77537a03cbeca8cde5d6b0a19f4352e6b76221f0;p=ghc-hetmet.git [project @ 1997-05-26 04:48:18 by sof] Updated imports; improved ppr --- diff --git a/ghc/compiler/deSugar/DsMonad.lhs b/ghc/compiler/deSugar/DsMonad.lhs index a29cc5a..ce408a4 100644 --- a/ghc/compiler/deSugar/DsMonad.lhs +++ b/ghc/compiler/deSugar/DsMonad.lhs @@ -29,7 +29,7 @@ module DsMonad ( IMP_Ubiq() import Bag ( emptyBag, snocBag, bagToList, Bag ) -import CmdLineOpts ( opt_SccGroup ) +import CmdLineOpts ( opt_SccGroup, opt_PprUserLength ) import CoreSyn ( SYN_IE(CoreExpr) ) import CoreUtils ( substCoreExpr ) import HsSyn ( OutPat ) @@ -38,8 +38,7 @@ import Id ( mkSysLocal, mkIdWithNewUniq, SYN_IE(Id) ) import PprType ( GenType, GenTyVar ) -import PprStyle ( PprStyle(..) ) -import Outputable ( pprQuote, Outputable(..) ) +import Outputable ( pprQuote, Outputable(..), PprStyle(..) ) import Pretty import SrcLoc ( noSrcLoc, SrcLoc ) import TcHsSyn ( SYN_IE(TypecheckedPat) ) @@ -251,7 +250,7 @@ pprDsWarnings sty warns Incomplete -> ptext SLIT("possibly incomplete")] pp_warn (flavour, DsMatchContext kind pats loc) - = hang (hcat [ppr PprForUser loc, ptext SLIT(": ")]) + = hang (hcat [ppr (PprForUser opt_PprUserLength) loc, ptext SLIT(": ")]) 4 (hang msg 4 (pp_match kind pats)) where diff --git a/ghc/compiler/deSugar/DsUtils.lhs b/ghc/compiler/deSugar/DsUtils.lhs index 67863c9..8a508a5 100644 --- a/ghc/compiler/deSugar/DsUtils.lhs +++ b/ghc/compiler/deSugar/DsUtils.lhs @@ -35,12 +35,12 @@ import HsSyn ( HsExpr(..), OutPat(..), HsLit(..), Fixity, Match, HsBinds, Stmt, DoOrListComp, HsType, ArithSeqInfo ) import TcHsSyn ( SYN_IE(TypecheckedPat) ) import DsHsSyn ( outPatType, collectTypedPatBinders ) +import CmdLineOpts ( opt_PprUserLength ) import CoreSyn import DsMonad import CoreUtils ( coreExprType, mkCoreIfThenElse ) -import PprStyle ( PprStyle(..) ) import PrelVals ( iRREFUT_PAT_ERROR_ID, voidId ) import Pretty ( Doc, hcat, text ) import Id ( idType, dataConArgTys, @@ -62,9 +62,8 @@ import Util ( panic, assertPanic{-, pprTrace ToDo:rm-} ) import Unique ( Unique ) import Usage ( SYN_IE(UVar) ) import SrcLoc ( SrcLoc {- instance Outputable -} ) -#if __GLASGOW_HASKELL__ >= 202 + import Outputable -#endif \end{code} @@ -346,7 +345,7 @@ mkErrorAppDs :: Id -- The error function mkErrorAppDs err_id ty msg = getSrcLocDs `thenDs` \ src_loc -> let - full_msg = show (hcat [ppr PprForUser src_loc, text "|", text msg]) + full_msg = show (hcat [ppr (PprForUser opt_PprUserLength) src_loc, text "|", text msg]) msg_lit = NoRepStr (_PK_ full_msg) in returnDs (mkApp (Var err_id) [] [ty] [LitArg msg_lit]) @@ -402,7 +401,7 @@ mkSelectorBinds pat val_expr is_var_pat (VarPat v) = True is_var_pat other = False -- Even wild-card patterns aren't acceptable - pat_string = show (ppr PprForUser pat) + pat_string = show (ppr (PprForUser opt_PprUserLength) pat) \end{code}