Closed funketh closed 2 years ago
This is a GHC 9 change: https://downloads.haskell.org/ghc/9.0.1/docs/html/users_guide/9.0.1-notes.html
Breaking change: Template Haskell splices now act as separation points between constraint solving passes. It is no longer possible to use an instance of a class before a splice and define that instance after a splice. For example, this code now reports a missing instance for C Bool:
class C a where foo :: a bar :: Bool bar = foo $(return []) instance C Bool where foo = True
So the only two options I can think of are:
Data.Random.Distribution.ABC
which imports and reexports Data.Random.Distribution.ABC.Instances
okay so the first approach doesn't really work as some instances require functions which require instances themselves... this whole situation is really unfortunate, I dislike using cyclic modules for this but I don't see an alternative?
we could just expand the TH manually... maybe using DerivingVia and StandaloneDeriving will help shorten this a bit
I think the TH used to generate instances for integral and float types is broken for the newest TH version:
stack.yaml
used: