containers icon indicating copy to clipboard operation
containers copied to clipboard

Switch from template-haskell to template-haskell-lift

Open TeofilC opened this issue 4 months ago • 4 comments

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

TeofilC avatar Oct 10 '25 17:10 TeofilC

Why doesn't the new package support older GHC versions? The CPP seems a bit blecherous.

treeowl avatar Oct 16 '25 22:10 treeowl

template-haskell-lift 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 containers to older GHCs as a boot lib (they would build fine from Hackage though).

Let me know what you'd prefer. Either we can:

  • raise 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

Eventually though, template-haskell-lift should let us remove all the TH CPP since that should all in that package.

TeofilC avatar Oct 16 '25 22:10 TeofilC

That's only a potential issue for new releases on old GHC branches, right? I suppose it would be okay to have some CPP temporarily to support that as long as such branches are "supported" by GHC HQ. But wouldn't it be cleaner to just add template-haskell-lift as a boot package in those releases?

treeowl avatar Oct 16 '25 23:10 treeowl

Yeah I agree that would be optimal. Unfortunately I don't think we can add new boot libs in minor releases (but I'll ask) since that can be disruptive.

I can commit to removing this CPP when it's no longer necessary though.

TeofilC avatar Oct 17 '25 10:10 TeofilC

Now that GHC-9.14 is released we can test this.

TeofilC avatar Jan 10 '26 20:01 TeofilC

Any idea what's going wrong with MucroHs? It smells like a CPP formatting issue, but I can't find it.

treeowl avatar Jan 10 '26 21:01 treeowl

Any idea what's going wrong with MucroHs? It smells like a CPP formatting issue, but I can't find it.

I think that it doesn't like the elif syntax in the .cabal file? I'm not sure though

TeofilC avatar Jan 10 '26 22:01 TeofilC