Skip to content

Conversation

@TeofilC
Copy link
Contributor

@TeofilC TeofilC commented Oct 10, 2025

We switch our dependency on template-haskell to a dependency on template-haskell-lift. This smaller library is more stabler and if we can remove the template-haskell dependency from all boot libraries then template-haskell will be much easier to re-install since it no longer needs to be in GHC's dependency closure.

For more information see the GHC proposal that introduced this library: ghc-proposals/ghc-proposals#696

This GHC MR tests this PR against GHC-HEAD: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/14978

@Lysxia
Copy link
Contributor

Lysxia commented Dec 15, 2025

What's the status of this?

@TeofilC
Copy link
Contributor Author

TeofilC commented Dec 15, 2025

What's the status of this?

I'm currently waiting for GHC-9.14 to be released. And then I'll update all the PRs for boot libs.

If we want new releases of text to be backportable to older GHCs then I will need to introduce some CPP to allow building with GHC when th-lift isn't a boot lib (note that end users can build th-lift with older GHCs but we can't add new boot libs in a minor version of GHC). LMK if you'd prefer that to the current version.

@Bodigrim
Copy link
Contributor

If we want new releases of text to be backportable to older GHCs then I will need to introduce some CPP to allow building with GHC when th-lift isn't a boot lib (note that end users can build th-lift with older GHCs but we can't add new boot libs in a minor version of GHC). LMK if you'd prefer that to the current version.

Yes please. We can always rip off CPP once last GHC releases in 9.10 and 9.12 series are out.

@TeofilC TeofilC force-pushed the wip/th-lift branch 5 times, most recently from 3740ed5 to fabfb34 Compare January 10, 2026 22:07
@TeofilC TeofilC marked this pull request as ready for review January 10, 2026 22:15
text.cabal Outdated
-- once we no longer wish to backport releases to older major releases of GHC,
-- this conditional can be dropped
if impl(ghc < 9.14)
build-depends: template-haskell
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it pass cabal check without warnings? Could we add a dummy upper bound, like < 3?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot. I have restored the previous bounds

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make it < 3, otherwise cabal outdated will keep flagging it in future. (It has no notion of a dependency upper bound being implicitly guarded by GHC version)

This new boot library should be more stable than template-haskell and
should eventually allow us to remove much of the CPP around TH.

It will also make it easier for end-users to reinstall template-haskell
as it will no longer be used by any boot libraries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants