I encountered this type error recently while trying to store a ListTable within one of my table schemas, defined sort of like
data SomeTable f = SomeTable
{ someId :: Column f SomeId
, nested :: ListTable f (SomeData f)
}
This was kind of confusing, as I'd assumed these were the same types. I was still able to get my code to work, simply by splitting up the SomeTable data type into its individual fields after selecting it with each, and returning them in a tuple, rather than in the SomeTable constructor.
My main question is is this working by design, or something preventing type inference, or something else? I've used many plenty to returned nested tables, and never encountered any issues, which is why I thought the types were equivalent. Though this is the first time I've ever stored a ListTable within a schema, which seems relevant, since it's only when I tried to work with a SomeTable Result that the ListTable Result stopped being a list.