Skip to content

Type error using makeEqF when OverloadedLists is enabled #22

@patrickt

Description

@patrickt

When -XOverloadedLists is on, the invocation of makeEqF in the following code fails to typecheck:

data Expr a
  = Lit Int
  | Paren a

derive [makeEqF] [''Expr]

with the following error:

    • Couldn't match expected type ‘GHC.Exts.Item (t0 Bool)’
                  with actual type ‘Bool’
      The type variable ‘t0’ is ambiguous
    • In the expression: (x_a6uN == y_a6uO)
      In the first argument of ‘and’, namely ‘[(x_a6uN == y_a6uO)]’
      In the expression: and [(x_a6uN == y_a6uO)]

The workaround is trivial (turn off OverloadedLists), but if this is a fixable issue, it would be nice to have. If not, I'd be happy to file a documentation bug adding this caveat to the makeEqF docstring.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions