Skip to content

A way to get a Generic instance equivalent to that of plain haskell record? #148

Description

@YPares

Currently, the Generic instance of Rec is oblivious of the functor wrapping the fields. This means the Generic instance it provides cannot be equivalent to that of an equivalent Haskell record.

Would there be a way to have:

newtype RecWithGeneric rs = RecWithGeneric (Rec ElField rs)

type Person1 = RecWithGeneric '["firstname" ::: Text, "lastname" ::: Text]

data Person2 = Person2
  { firstname :: Text
  , lastname :: Text }               

that ensures the Generic instances for Person1 and Person2 can be used instead of one another?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions