Skip to content

Commit

Permalink
Make version 0.1.1.1 compile with ghc-9.8
Browse files Browse the repository at this point in the history
The `plutus-core` package currently has:
```
    , dependent-sum               >=0.7.1.0
    , dependent-sum-template      <0.1.2
```
This commit takes the commit that was tagged as version 0.1.1.1 and
fixes it for ghc-9.8.

See: obsidiansystems#9
  • Loading branch information
erikd committed Sep 25, 2023
1 parent 827d548 commit adb6550
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Data/Dependent/Sum/TH/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ classHeadToParams t = (h, reverse reversedParams)
deriveForDec :: Name -> (Q Type -> Q Type) -> ([TyVarBndrSpec] -> [Con] -> Q Dec) -> Dec -> Q [Dec]
deriveForDec className makeClassHead f dec = deriveForDec' className makeClassHead (f . changeTVFlags specifiedSpec) dec

deriveForDec' :: Name -> (Q Type -> Q Type) -> ([TyVarBndrUnit] -> [Con] -> Q Dec) -> Dec -> Q [Dec]
deriveForDec' :: Name -> (Q Type -> Q Type)
#if __GLASGOW_HASKELL__ >= 908
-> ([TyVarBndr BndrVis] -> [Con] -> Q Dec)
#else
-> ([TyVarBndrUnit] -> [Con] -> Q Dec)
#endif
-> Dec -> Q [Dec]
deriveForDec' className _ f (InstanceD overlaps cxt classHead decs) = do
let (givenClassName, firstParam : _) = classHeadToParams classHead
when (givenClassName /= className) $
Expand Down Expand Up @@ -60,7 +66,9 @@ deriveForDec' className makeClassHead f (DataInstD dataCxt name tyArgs _ cons _)
clhead = makeClassHead $ foldl1 appT (map return $ (ConT name : init tyArgs))
#endif

#if __GLASGOW_HASKELL__ >= 900
#if __GLASGOW_HASKELL__ >= 908
bndrs = [PlainTV v BndrReq | PlainTV v _x <- maybe [] id tvBndrs]
#elif __GLASGOW_HASKELL__ >= 900
bndrs = [PlainTV v x | PlainTV v x <- maybe [] id tvBndrs]
#elif __GLASGOW_HASKELL__ >= 808
bndrs = [PlainTV v | PlainTV v <- maybe [] id tvBndrs]
Expand Down

0 comments on commit adb6550

Please sign in to comment.