[project @ 2004-01-04 01:48:04 by igloo]
authorigloo <unknown>
Sun, 4 Jan 2004 01:48:07 +0000 (01:48 +0000)
committerigloo <unknown>
Sun, 4 Jan 2004 01:48:07 +0000 (01:48 +0000)
Split the pretty-printer out - pprint will now give you pretty much
anything you are likely to want to pretty-print as a String. For a Doc
you need (to_HPJ_Doc . ppr), which could be made nicer if it is widely
used.

Also took the opportunity to do a bit of module renaming and fixed the
odd typo here and there.

ghc/compiler/deSugar/DsMeta.hs
ghc/compiler/hsSyn/Convert.lhs
ghc/compiler/typecheck/TcSplice.lhs

index 288885d..31a8a0d 100644 (file)
@@ -1154,7 +1154,7 @@ repOverloadedLiteral :: HsOverLit -> DsM (Core TH.Lit)
 repOverloadedLiteral (HsIntegral i _)   = do { lit <- mk_integer  i; repLiteral lit }
 repOverloadedLiteral (HsFractional f _) = do { lit <- mk_rational f; repLiteral lit }
        -- The type Rational will be in the environment, becuase 
-       -- the smart constructor 'THSyntax.rationalL' uses it in its type,
+       -- the smart constructor 'TH.Syntax.rationalL' uses it in its type,
        -- and rationalL is sucked in when any TH stuff is used
               
 --------------- Miscellaneous -------------------
@@ -1271,11 +1271,11 @@ templateHaskellNames = [
     varStrictTypeQTyConName, typeQTyConName, expTyConName, decTyConName,
     typeTyConName, matchTyConName, clauseTyConName]
 
-tH_SYN_Name = mkModuleName "Language.Haskell.TH.THSyntax"
-tH_LIB_Name = mkModuleName "Language.Haskell.TH.THLib"
+tH_SYN_Name = mkModuleName "Language.Haskell.TH.Syntax"
+tH_LIB_Name = mkModuleName "Language.Haskell.TH.Lib"
 
 thSyn :: Module
--- NB: the THSyntax module comes from the "haskell-src" package
+-- NB: the TH.Syntax module comes from the "haskell-src" package
 thSyn = mkModule thPackage  tH_SYN_Name
 thLib = mkModule thPackage  tH_LIB_Name
 
@@ -1288,7 +1288,7 @@ libTc  = mk_known_key_name thLib OccName.tcName
 thFun  = mk_known_key_name thSyn OccName.varName
 thTc   = mk_known_key_name thSyn OccName.tcName
 
--------------------- THSyntax -----------------------
+-------------------- TH.Syntax -----------------------
 qTyConName        = thTc FSLIT("Q")             qTyConKey
 nameTyConName      = thTc FSLIT("Name")           nameTyConKey
 fieldExpTyConName = thTc FSLIT("FieldExp")      fieldExpTyConKey
@@ -1312,7 +1312,7 @@ mkNameG_tcName = thFun FSLIT("mkNameG_tc") mkNameG_tcIdKey
 mkNameUName    = thFun FSLIT("mkNameU")    mkNameUIdKey
 
 
--------------------- THLib -----------------------
+-------------------- TH.Lib -----------------------
 -- data Lit = ...
 charLName       = libFun FSLIT("charL")       charLIdKey
 stringLName     = libFun FSLIT("stringL")     stringLIdKey
index 9fd060a..fc724de 100644 (file)
@@ -10,8 +10,8 @@ module Convert( convertToHsExpr, convertToHsDecls, convertToHsType ) where
 
 #include "HsVersions.h"
 
-import Language.Haskell.TH.THSyntax as TH
-import Language.Haskell.TH.THLib    as TH      -- Pretty printing
+import Language.Haskell.TH as TH
+import Language.Haskell.TH.Syntax as TH
 
 import HsSyn as Hs
 import RdrName ( RdrName, mkRdrUnqual, mkRdrQual, mkOrig, nameRdrName, getRdrName )
index 1a48821..11f4a6a 100644 (file)
@@ -13,9 +13,9 @@ import TcRnDriver     ( tcTopSrcDecls )
        -- These imports are the reason that TcSplice 
        -- is very high up the module hierarchy
 
-import qualified Language.Haskell.TH.THSyntax as TH
-import qualified Language.Haskell.TH.THLib    as TH
+import qualified Language.Haskell.TH as TH
 -- THSyntax gives access to internal functions and data types
+import qualified Language.Haskell.TH.Syntax as TH
 
 import HsSyn           ( HsBracket(..), HsExpr(..), HsSplice(..), LHsExpr, LHsDecl, 
                          HsType, LHsType )