* Couldn't match type `PGjsonb' with `PGjson'
arising from the overloaded label `#vals'
* In the second argument of `(<*>)', namely `#vals'
In the expression: (,) <$> #id <*> #vals
In an equation for `decode': decode = (,) <$> #id <*> #vals
which confuses me. The schema says the field is PGjsonb, the query typechecks and the value is PGjsonb, so where does PGjson come in? How do I convert a PGjsonb field to an Aeson.Value? I’m clearly missing something here, but what?
(I originally posted this question here, but thought I’d widen the audience a bit.)
I think this is not quite enough context to properly trouble shoot the issue but my hunch is that a fundep (or type family, for that matter) associates PGjson with Aeson and you would need to wrap Value in a newtype wrapper s.t. it works with the overloaded labels.