pa-ba / compdata

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

Doesn't compile with ghc 8.2 #24

Closed aphorisme closed 6 years ago

aphorisme commented 7 years ago

First of all, thanks a lot for compdata!

I've recently changed to the current nightly resolver from stackage.org which comes with GHC 8.2.Adding compdata-0.11 to the extra dependencies, I get the following errors:

    /private/var/folders/tt/49nz_hms09zfppmm8gpxxpdw0000gn/T/stack18071/compdata-0.11/src/Data/Comp/Derive/Utils.hs:53:45: error:
        • Couldn't match type ‘DerivClause’ with ‘Type’
          Expected type: Cxt
            Actual type: [DerivClause]
        • In the fifth argument of ‘DataInfo’, namely ‘derive’
          In the first argument of ‘Just’, namely
            ‘(DataInfo cxt name args [constr] derive)’
          In the expression: Just (DataInfo cxt name args [constr] derive)
       |
    53 |     = Just (DataInfo cxt name args [constr] derive)
       |                                             ^^^^^^

    /private/var/folders/tt/49nz_hms09zfppmm8gpxxpdw0000gn/T/stack18071/compdata-0.11/src/Data/Comp/Derive/Utils.hs:55:44: error:
        • Couldn't match type ‘DerivClause’ with ‘Type’
          Expected type: Cxt
            Actual type: [DerivClause]
        • In the fifth argument of ‘DataInfo’, namely ‘derive’
          In the first argument of ‘Just’, namely
            ‘(DataInfo cxt name args constrs derive)’
          In the expression: Just (DataInfo cxt name args constrs derive)
       |
    55 |     = Just (DataInfo cxt name args constrs derive)
       |  

As far as I can see, this comes with the change from template-haskell-2.11.0 to template-haskell-2.12.0. This leads to a new definition of the DataD constructor of Dec:

From: DataD Cxt Name [TyVarBndr] (Maybe Kind) [Con] Cxt To: DataD Cxt Name [TyVarBndr] (Maybe Kind) [Con] [DerivClause]

Unfortunately I don't find time to dive into the source of compdata to grasp where the derive clauses come into play. But at least I wanted to report it.

emilaxelsson commented 7 years ago

Consider using one of these packages for backwards compatibility: