Skip to content

Conversation

TeofilC
Copy link

@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.

It also lets us drop a lot of compatibility CPP.

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

template-haskell-lift is not compatible with versions of GHC before 9.10, so support for earlier versions would either need to be dropped, or we would need to add some CPP.

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

@TeofilC TeofilC changed the title Wip/th lift Switch from template-haskell to template-haskell-lift Oct 10, 2025
@TeofilC TeofilC force-pushed the wip/th-lift branch 4 times, most recently from 54ef253 to d85e62d Compare October 10, 2025 17:40
@Bodigrim
Copy link
Contributor

We strive for new releases to be backportable to older GHC major series, which do not yet have template-haskell-lift as a boot library. To keep it possible, I imagine you need something like

if impl(ghc>9.15)
  build-depends: template-haskell-lift
else 
  build-depends: template-haskell 

@TeofilC
Copy link
Author

TeofilC commented Oct 10, 2025

Good point. template-haskell-lift itself is buildable with older major versions (where it just re exports tenplate-haskell) but unless we backport it as a boot library to those versions then indeed you wouldn't be able to use the new bytestring as a boot library.

I'll implement what you suggest

@TeofilC TeofilC force-pushed the wip/th-lift branch 3 times, most recently from e1fb704 to 800ee4c Compare October 12, 2025 11:22
@Bodigrim
Copy link
Contributor

@TeofilC please rebase.

@Bodigrim
Copy link
Contributor

@TeofilC could you please raise a draft GHC MR, which updates bytestring submodule to your commit? Otherwise I cannot test it.

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.

2 participants