Skip to content

Conversation

@Gabriella439
Copy link
Contributor

No description provided.

-- exception will be thrown.
--
-- You can also derive 'FromRow' for your data type using GHC generics, like
-- this:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should one mention Product type? Should we add an instance with TypeError for :+:?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phadej: I think adding new instances is outside of the scope for this pull request (which is just to mention that it even exists)

However, I can update the documentation to mention that it only works for product types and does not support sum types

-- deriving ('GHC.Generics.Generic', 'FromRow')
-- @
--
-- Note that this only works for product types (i.e. records) and does not
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should i.e. be e.g. because data Foo = Foo Int String is a product type, but is not a record.

... as suggested by @phadej
@phadej
Copy link
Collaborator

phadej commented Feb 7, 2019

Thanks!

@phadej phadej merged commit b02bcf7 into haskellari:master Feb 7, 2019
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.

2 participants