Skip to content

Mention GHC generics support in documentation - #6

Merged
phadej merged 3 commits into
haskellari:masterfrom
Gabriella439:gabriel/derive
Feb 7, 2019
Merged

phadej merged 3 commits into
haskellari:masterfrom
Gabriella439:gabriel/derive

Conversation

@Gabriella439

Copy link
Copy Markdown
Contributor

No description provided.

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

phadej commented Feb 7, 2019

Copy link
Copy Markdown
Collaborator

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