Closed galenhuntington closed 3 years ago
you might want to try using the head hackage setup... it may have some patch set already setup so things build fine
I'll try to add GHC 9 to Travis CI and see if we can reproduce it there.
I can get it to type check (using template-haskell 2.17) and build by putting examineCode
(from Language.Haskell.TH.Syntax
) in front of all the [|| ||]
expressions, but because $$( )
now expects a Code
type, this package no longer works as documented:
Network.URI.Static> $$(staticURI "http://www.google.com/")
<interactive>:8:4: error:
• Couldn't match type: Language.Haskell.TH.Syntax.Q
(Language.Haskell.TH.Syntax.TExp Network.URI.URI)
with: Language.Haskell.TH.Syntax.Code
Language.Haskell.TH.Syntax.Q p0
Expected: Language.Haskell.TH.Syntax.Code
Language.Haskell.TH.Syntax.Q p0
Actual: Language.Haskell.TH.Lib.Internal.TExpQ Network.URI.URI
• In the expression: staticURI "http://www.google.com/"
In the Template Haskell splice
$$(staticURI "http://www.google.com/")
In the expression: $$(staticURI "http://www.google.com/")
So it seems the solution is for staticURI
and so on to have different types when used with GHC 9. That might not be pretty. Maybe type aliases and CPP.
Yes, looks like a bit of a nuisance... I'm working on setting up a GHC 9 that I can experiment with.
There's an as-yet-unreleased WIP compatibility package th-compat
, which appears to export the needed type alias, called SpliceQ
. So maybe it's best to hold off putting effort into this till that package is out.
Using GHC 9.0.1-rc1 I'm getting the same errors than in the OP.
Blocking https://github.com/agda/agda/issues/4955.
OK, I'll check this out again today.
To test with unreleased GHC 9, do I need to build my own GHC?
No. You can download a binary distribution from https://downloads.haskell.org/ghc/9.0.1-rc1/.
I just posted my first effort at GHC 9 compatibility here: #58.
I just found there is a patch fixing this issue without using additional libraries in https://gitlab.haskell.org/ghc/head.hackage/-/blob/master/patches/network-uri-2.6.3.0.patch.
Right, but the goal of th-compat
is to provide a compatibility layer that can be used without resorting to repetitive CPP.
In https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3358, a bunch of types were changed involving
TExp
and so on. As a result, this package fails to build under GHC 9.0 due to type errors, at least inNetwork.URI.Static
:I made an effort to fix this myself, but I don't understand TH and its panoply of types very well and didn't really get anywhere.