Commit 6da2fdc8 authored by igloo's avatar igloo
Browse files

[project @ 2004-01-04 01:48:04 by igloo]

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.
parent 1b75cf97
......@@ -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
......
......@@ -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 )
......
......@@ -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 )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment