Skip to content

Switch from template-haskell to template-haskell-lift#105

Merged
RyanGlScott merged 1 commit intoekmett:masterfrom
TeofilC:wip/th-lift
Jan 10, 2026
Merged

Switch from template-haskell to template-haskell-lift#105
RyanGlScott merged 1 commit intoekmett:masterfrom
TeofilC:wip/th-lift

Conversation

@TeofilC
Copy link
Copy Markdown
Contributor

@TeofilC TeofilC commented Oct 10, 2025

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

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

@RyanGlScott
Copy link
Copy Markdown
Collaborator

Let me know when you'd like a full review of this. (It looks like there is still some work to be done to make this pass CI.)

@TeofilC TeofilC force-pushed the wip/th-lift branch 2 times, most recently from ab9c9a9 to 224546d Compare October 16, 2025 22:18
@TeofilC
Copy link
Copy Markdown
Contributor Author

TeofilC commented Oct 16, 2025

@RyanGlScott in the current version I have set things up to only use this library when GHC >=9.14.

template-haskell-lift itself is compatible with GHC>=8.10. But it is only a boot library with GHC>=9.14. So you wouldn't be able to backport new releases of exceptions to older GHCs as a boot lib (they would build fine from Hackage though).

Do you have a preference?
Either we can:

  • raise the minimum GHC version to 8.10, use th-lift, cannot backport to minor versions of GHC before 9.14
  • Add CPP and only use th-lift when GHC is >=9.14

@TeofilC TeofilC force-pushed the wip/th-lift branch 2 times, most recently from e67d2ae to 9fbde92 Compare October 16, 2025 22:53
@RyanGlScott
Copy link
Copy Markdown
Collaborator

Given that exceptions is a boot library, I would like for it to only depend on boot libraries as much as possible. As such, I would prefer the "Add CPP and only use th-lift when GHC is >=9.14" option.

@TeofilC TeofilC marked this pull request as ready for review October 20, 2025 12:14
@TeofilC TeofilC force-pushed the wip/th-lift branch 2 times, most recently from 5078767 to c044d17 Compare October 20, 2025 12:16
@RyanGlScott
Copy link
Copy Markdown
Collaborator

Great!

When would be a good time for merging this? My understanding is that we want this to coincide with GHC 9.14 bundling template-haskell-lift as a boot library. Has this happened yet?

@TeofilC
Copy link
Copy Markdown
Contributor Author

TeofilC commented Oct 20, 2025

Has this happened yet?

Not yet. The MR still needs to be backported to the GHC-9.14 branch.

I think it would be best to wait until 9.14.1 is released and then we can add a proper CI job to test this. And then 9.14.2 could perhaps ship with a version of exception that has this patch.

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
@TeofilC
Copy link
Copy Markdown
Contributor Author

TeofilC commented Jan 10, 2026

This should be ready for review now, since GHC 9.14 is out

Copy link
Copy Markdown
Collaborator

@RyanGlScott RyanGlScott left a comment

Choose a reason for hiding this comment

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

Thanks, @TeofilC!

@RyanGlScott RyanGlScott merged commit b4e6d15 into ekmett:master Jan 10, 2026
14 checks passed
-- this conditional can be dropped
if impl(ghc < 9.14)
build-depends: template-haskell
else
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This broke MicroHS support.

@augustss


Suggested change
else
elif impl(ghc)

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