pa-ba / compdata

Haskell library implementing "Data Types a la Carte"
http://hackage.haskell.org/package/compdata
Other
89 stars 27 forks source link

Type error using makeEqF when OverloadedLists is enabled #22

Open patrickt opened 7 years ago

patrickt commented 7 years ago

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.