Ben Gamari pushed to branch ghc-9.14 at Glasgow Haskell Compiler / GHC Commits: c514bb16 by Teo Camarasu at 2025-10-27T18:52:10-04:00 Add submodules for template-haskell-lift and template-haskell-quasiquoter These two new boot libraries expose stable subsets of the template-haskell interface. This is an implemenation of the GHC proposal https://github.com/ghc-proposals/ghc-proposals/pull/696 Work towards #25262 (cherry picked from commit 4be32153febff94f9c89f7f74971da3721d19c87) - - - - - 7 changed files: - .gitmodules - hadrian/src/Packages.hs - hadrian/src/Settings/Default.hs - libraries/ghc-internal/src/GHC/Internal/TH/Lift.hs - libraries/ghc-internal/src/GHC/Internal/TH/Quote.hs - + libraries/template-haskell-lift - + libraries/template-haskell-quasiquoter Changes: ===================================== .gitmodules ===================================== @@ -118,3 +118,9 @@ [submodule "libraries/file-io"] path = libraries/file-io url = https://gitlab.haskell.org/ghc/packages/file-io.git +[submodule "libraries/template-haskell-lift"] + path = libraries/template-haskell-lift + url = https://gitlab.haskell.org/ghc/template-haskell-lift.git +[submodule "libraries/template-haskell-quasiquoter"] + path = libraries/template-haskell-quasiquoter + url = https://gitlab.haskell.org/ghc/template-haskell-quasiquoter.git ===================================== hadrian/src/Packages.hs ===================================== @@ -9,7 +9,7 @@ module Packages ( ghcToolchain, ghcToolchainBin, haddockApi, haddockLibrary, haddock, haskeline, hsc2hs, hp2ps, hpc, hpcBin, integerGmp, iserv, iservProxy, libffi, mtl, osString, parsec, pretty, primitive, process, remoteIserv, rts, - runGhc, semaphoreCompat, stm, templateHaskell, terminfo, text, time, timeout, + runGhc, semaphoreCompat, stm, templateHaskell, thLift, thQuasiquoter, terminfo, text, time, timeout, transformers, unlit, unix, win32, xhtml, lintersCommon, lintNotes, lintCodes, lintCommitMsg, lintSubmoduleRefs, lintWhitespace, ghcPackages, isGhcPackage, @@ -39,7 +39,7 @@ ghcPackages = , ghcCompact, ghcConfig, ghcExperimental, ghcHeap, ghcInternal, ghci, ghciWrapper, ghcPkg, ghcPrim , ghcToolchain, ghcToolchainBin, haddockApi, haddockLibrary, haddock, haskeline, hsc2hs , hp2ps, hpc, hpcBin, integerGmp, iserv, libffi, mtl, osString - , parsec, pretty, process, rts, runGhc, stm, semaphoreCompat, templateHaskell + , parsec, pretty, process, rts, runGhc, stm, semaphoreCompat, templateHaskell, thLift, thQuasiquoter , terminfo, text, time, transformers, unlit, unix, win32, xhtml, fileio , timeout , lintersCommon @@ -56,7 +56,7 @@ array, base, binary, bytestring, cabalSyntax, cabal, checkPpr, checkExact, count ghcCompact, ghcConfig, ghcExperimental, ghcHeap, ghci, ghcInternal, ghciWrapper, ghcPkg, ghcPrim, ghcToolchain, ghcToolchainBin, haddockLibrary, haddockApi, haddock, haskeline, hsc2hs, hp2ps, hpc, hpcBin, integerGmp, iserv, iservProxy, remoteIserv, libffi, mtl, - osString, parsec, pretty, primitive, process, rts, runGhc, semaphoreCompat, stm, templateHaskell, + osString, parsec, pretty, primitive, process, rts, runGhc, semaphoreCompat, stm, templateHaskell, thLift, thQuasiquoter, terminfo, text, time, transformers, unlit, unix, win32, xhtml, timeout, lintersCommon, lintNotes, lintCodes, lintCommitMsg, lintSubmoduleRefs, lintWhitespace @@ -124,6 +124,8 @@ runGhc = util "runghc" semaphoreCompat = lib "semaphore-compat" stm = lib "stm" templateHaskell = lib "template-haskell" +thLift = lib "template-haskell-lift" +thQuasiquoter = lib "template-haskell-quasiquoter" terminfo = lib "terminfo" text = lib "text" time = lib "time" ===================================== hadrian/src/Settings/Default.hs ===================================== @@ -106,6 +106,8 @@ stage0Packages = do , runGhc , semaphoreCompat -- depends on , time -- depends on win32 + , thLift -- new library not yet present for boot compilers + , thQuasiquoter -- new library not yet present for boot compilers , unlit , if windowsHost then win32 else unix -- We must use the in-tree `Win32` as the version ===================================== libraries/ghc-internal/src/GHC/Internal/TH/Lift.hs ===================================== @@ -20,7 +20,7 @@ -- | This module gives the definition of the 'Lift' class. -- -- This is an internal module. --- Please import "Language.Haskell.TH" or "Language.Haskell.TH.Syntax" instead! +-- Please import "Language.Haskell.TH.Lift", "Language.Haskell.TH" or "Language.Haskell.TH.Syntax" instead! module GHC.Internal.TH.Lift ( Lift(..) @@ -70,6 +70,9 @@ import GHC.Internal.ForeignPtr -- > deriving Lift -- -- Representation-polymorphic since /template-haskell-2.16.0.0/. +-- +-- This is exposed both from the @template-haskell-lift@ and @template-haskell@ packages. +-- Consider importing it from the more stable @template-haskell-lift@ if you don't need the full breadth of the @template-haskell@ interface. class Lift (t :: TYPE r) where -- | Turn a value into a Template Haskell expression, suitable for use in -- a splice. ===================================== libraries/ghc-internal/src/GHC/Internal/TH/Quote.hs ===================================== @@ -30,6 +30,9 @@ import GHC.Internal.Base hiding (Type) -- in defining a quasiquoter to be used for expressions, you would -- define a 'QuasiQuoter' with only 'quoteExp', and leave the other -- fields stubbed out with errors. +-- +-- This is exposed both from the @template-haskell-quasiquoter@ and @template-haskell@ packages. +-- Consider importing it from the more stable @template-haskell-quasiquoter@ if you don't need the full breadth of the @template-haskell@ interface. data QuasiQuoter = QuasiQuoter { -- | Quasi-quoter for expressions, invoked by quotes like @lhs = $[q|...]@ quoteExp :: String -> Q Exp, ===================================== libraries/template-haskell-lift ===================================== @@ -0,0 +1 @@ +Subproject commit 06c18dfc2d689baabf0e923e3fb9483ac89b8d01 ===================================== libraries/template-haskell-quasiquoter ===================================== @@ -0,0 +1 @@ +Subproject commit 65246071e82819aa27922c1172861ba346612230 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c514bb1661564d05a0a7b3cdea05b48c... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c514bb1661564d05a0a7b3cdea05b48c... You're receiving this email because of your account on gitlab.haskell.org.