Closed istathar closed 2 years ago
Huh, yeah, that's an odd error. No idea what changed and it seems correct to have a type in that location as opposed to an expression. I'll have to poke around to see what's going on.
Meanwhile, looks like the Nix tests failed in CI too, but the logs were truncated. I'm going to push a changed version of the workflow config to fix that and see what's up.
I merged 'stage' into this branch but still the same build failure. I updated the code snippet above (it has qualified imports now) but it's the same error message.
I'm not sure if it's worth mentioning explicitly that this is built against latest avro version 0.6.1.0 and latest Stackage resolver lts-19.2
.
Pretty odd. Haven't been working much on Theta this week, but I should be able to update my setup for GHC 9 and reproduce the problem locally over the next few days.
Turns out the problem was with type application syntax. I guess in theta @ $(...)
, @
got parsed as an operator. In normal Haskell I would not have a space after @
, but in theta @$(...)
the @$
gets parsed as an operator :P.
Pulling the type application outside the quasiquote solved the problem robustly:
where thetaType = TH.appTypeE [e|theta|] (TH.conT type_)
@TikhonJelvis What a glitch! I've heard older Haskell hands complain about language extensions changing the result of parsing, but this is the first time I've actually run into it. Huh!
Thanks very much for sorting this out. I think this was the last hurtle I'm going to go see if we can build with GHC 9.0 now!
Interesting thought. I had assumed that @
was a valid operator before TypeApplications
, but seems like @
doesn't parse as a normal infix operator and hasn't for at least a few years. It's a reserveop
in the grammar going back at least to Haskell '98, but I don't know exactly how older GHCs handled it. As far as I understand it, this means that enabling TypeApplications
could make previously invalid code parse correctly, but it should never change the meaning of expressions that parsed without it.
So, knowing that, there's no reason for TH to expect the righthand side of a @
to be an expression: with TypeApplications
enabled it has to be a type and without the extension it should be a parse error.
Not entirely certain, but this could be a bug introduced into TH somewhere between GHC 8.10.7 and 9.0.2.
So I started working theta-idl towards compiling on GHC 9.0
So far so good:
lts-18.x
are now available inlts-19.0
so I've tidied that up.I've hit an actual code bug, though, related either to avro or our use of its Template Haskell facilities:
can't say as how I've got much idea what's going on in there, but perhaps you'll recognize that part of the code and have a notion of where to go from here (I get that Q Exp is expressions and Q Type is yeah, I'm just not sure why that would have changed).