From 6ab2245cd1b0953f53995501b6d7961e3020daca Mon Sep 17 00:00:00 2001 From: igloo Date: Thu, 15 Jan 2004 14:43:25 +0000 Subject: [PATCH] [project @ 2004-01-15 14:43:17 by igloo] Split Template Haskell out to its own package and update docs and tests. --- ghc/compiler/Makefile | 4 ++-- ghc/compiler/deSugar/DsMeta.hs | 2 +- ghc/compiler/ghci/Linker.lhs | 2 +- ghc/compiler/main/Packages.lhs | 2 +- ghc/docs/comm/exts/th.html | 12 ++++++------ mk/bootstrap.mk | 9 +++++---- 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/ghc/compiler/Makefile b/ghc/compiler/Makefile index 271011f..d8c210f 100644 --- a/ghc/compiler/Makefile +++ b/ghc/compiler/Makefile @@ -271,8 +271,8 @@ endif # Only include GHCi if we're bootstrapping with at least version 411 ifeq "$(GhcWithInterpreter) $(bootstrapped)" "YES YES" -# Yes, include the interepreter, readline, and Template Haskell extensions -SRC_HC_OPTS += -DGHCI -package haskell-src +# Yes, include the interpreter, readline, and Template Haskell extensions +SRC_HC_OPTS += -DGHCI -package template-haskell -package haskell-src ifneq "$(TARGETPLATFORM)" "i386-unknown-mingw32" SRC_HC_OPTS += -package unix ifeq "$(GhcLibsWithReadline)" "YES" diff --git a/ghc/compiler/deSugar/DsMeta.hs b/ghc/compiler/deSugar/DsMeta.hs index 4bcb32e..614ad3b 100644 --- a/ghc/compiler/deSugar/DsMeta.hs +++ b/ghc/compiler/deSugar/DsMeta.hs @@ -1279,7 +1279,7 @@ tH_SYN_Name = mkModuleName "Language.Haskell.TH.Syntax" tH_LIB_Name = mkModuleName "Language.Haskell.TH.Lib" thSyn :: Module --- NB: the TH.Syntax module comes from the "haskell-src" package +-- NB: the TH.Syntax module comes from the "template-haskell" package thSyn = mkModule thPackage tH_SYN_Name thLib = mkModule thPackage tH_LIB_Name diff --git a/ghc/compiler/ghci/Linker.lhs b/ghc/compiler/ghci/Linker.lhs index f8e6175..f8237dc 100644 --- a/ghc/compiler/ghci/Linker.lhs +++ b/ghc/compiler/ghci/Linker.lhs @@ -705,7 +705,7 @@ partOfGHCi # if defined(mingw32_TARGET_OS) || defined(darwin_TARGET_OS) = [ ] # else - = [ "base", "haskell98", "haskell-src", "readline" ] + = [ "base", "haskell98", "template-haskell", "readline" ] # endif showLS (Object nm) = "(static) " ++ nm diff --git a/ghc/compiler/main/Packages.lhs b/ghc/compiler/main/Packages.lhs index ef4a6e4..72b3cf8 100644 --- a/ghc/compiler/main/Packages.lhs +++ b/ghc/compiler/main/Packages.lhs @@ -60,7 +60,7 @@ rtsPackage, basePackage, haskell98Package, thPackage :: PackageName basePackage = FSLIT("base") rtsPackage = FSLIT("rts") haskell98Package = FSLIT("haskell98") -thPackage = FSLIT("haskell-src") -- Template Haskell libraries in here +thPackage = FSLIT("template-haskell") -- Template Haskell libraries in here packageDependents :: PackageConfig -> [PackageName] -- Impedence matcher, because PackageConfig has Strings diff --git a/ghc/docs/comm/exts/th.html b/ghc/docs/comm/exts/th.html index 2c75b9a..dbb168a 100644 --- a/ghc/docs/comm/exts/th.html +++ b/ghc/docs/comm/exts/th.html @@ -35,7 +35,7 @@ A term in quasi-quote brackets needs to be translated into Core code that, when executed, yields a representation of that term in the form of the abstract syntax trees defined in Language.Haskell.THSyntax. + href="http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/libraries/template-haskell/Language/Haskell/TH/Syntax.hs">Language.Haskell.TH.Syntax. Within DsMeta, this is achieved by four functions corresponding to the four types of quasi-quote brackets: repE (for [|...|]), repP (for @@ -63,12 +63,12 @@ type parameter to constrain the contexts in which they are applicable. For example, a function that builds a Core expression that evaluates to a TH type representation, which has type - Language.Haskell.THSyntax.Type, would return a value of + Language.Haskell.TH.Syntax.Type, would return a value of type

-Core Language.Haskell.THSyntax.Type
+Core Language.Haskell.TH.Syntax.Type

Desugaring of Reification Operators

@@ -82,9 +82,9 @@ Core Language.Haskell.THSyntax.Type The operator reifyType receives the name of a function or data constructor as its argument and yields a representation of this entity's type in the form of a value of type - THSyntax.Type. Similarly, reifyDecl receives + TH.Syntax.Type. Similarly, reifyDecl receives the name of a type and yields a representation of the type's declaration - as a value of type THSyntax.Decl. The name of the reified + as a value of type TH.Syntax.Decl. The name of the reified entity is mapped to the GHC-internal representation of the entity by using the function lookupOcc on the name.

@@ -177,7 +177,7 @@ in repTyClD and repC.

During the construction of representations, the desugarer needs to use a large number of functions defined in the library - Language.Haskell.THSyntax. The names of these functions + Language.Haskell.TH.Syntax. The names of these functions need to be made available to the compiler in the way outlined Primitives and the Prelude. Unfortunately, any change to