Skip to content

Couldn't match type ListTable Result (SomeData Result) with [SomeData Result] #321

@abigailalice

Description

@abigailalice

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions