Skip to content

Conversation

carymrobbins
Copy link
Contributor

This is useful for generalizing over things which can have their FromRow and ToRow instances derived. Specifically, this would enable libraries like generic-override to be able to interop with postgresql-simple's generic machinery.


Without this change, given the following code -

instance (Generic (Override a xs)) => ToRow (Override a xs)

We'll get the following compiler error -

Could not deduce (Database.PostgreSQL.Simple.ToRow.GToRow
                          (Data.Override.Internal.OverrideRep
                             Data.Override.Internal.EmptyInspect xs (Rep a)))
        arising from a use of ‘Database.PostgreSQL.Simple.ToRow.$dmtoRow’

This can be easily fixed by adding the GToRow constraint -

instance (Generic (Override a xs), GToRow (Override a xs)) => ToRow (Override a xs)

However, this can't be done unless the constraint itself is exported.

@carymrobbins
Copy link
Contributor Author

Looks like the checks failed only on AppVeyor, which looks to be a linker error.

@phadej - Are you the one to approve/merge this? Would be good to know if this change would be accepted or if there is some alternative you'd like instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant