Skip to content

Commit

Permalink
Support GHC 9.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hsenag committed Oct 10, 2023
1 parent f5dd349 commit dbd4375
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
10 changes: 5 additions & 5 deletions generics-sop/generics-sop.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ category: Generics
build-type: Simple
cabal-version: >=1.10
extra-source-files: CHANGELOG.md doctest.sh
tested-with: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.7, GHC == 9.4.4, GHC == 9.6.1
tested-with: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.7, GHC == 9.4.4, GHC == 9.6.1, GHC == 9.8.1

source-repository head
type: git
Expand All @@ -65,11 +65,11 @@ library
Generics.SOP.NP
Generics.SOP.NS
Generics.SOP.Sing
build-depends: base >= 4.9 && < 4.19,
build-depends: base >= 4.9 && < 4.20,
sop-core == 0.5.0.*,
template-haskell >= 2.8 && < 2.21,
th-abstraction >= 0.4 && < 0.6,
ghc-prim >= 0.3 && < 0.11
template-haskell >= 2.8 && < 2.22,
th-abstraction >= 0.6 && < 0.7,
ghc-prim >= 0.3 && < 0.12
hs-source-dirs: src
default-language: Haskell2010
ghc-options: -Wall
Expand Down
1 change: 1 addition & 0 deletions generics-sop/src/Generics/SOP/Instances.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{-# LANGUAGE EmptyCase #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE UnboxedTuples #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# OPTIONS_GHC -freduction-depth=100 #-}
{-# OPTIONS_GHC -fno-warn-deprecations #-}
Expand Down
11 changes: 6 additions & 5 deletions generics-sop/src/Generics/SOP/TH.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import Data.Proxy
import Language.Haskell.TH.Datatype.TyVarBndr
import Language.Haskell.TH
import Language.Haskell.TH.Datatype as TH
import Language.Haskell.TH.Datatype.TyVarBndr

import Generics.SOP.BasicFunctors
import qualified Generics.SOP.Metadata as SOP
Expand Down Expand Up @@ -190,7 +191,7 @@ deriveMetadataType n datatypeInfoName = do
[ tySynD datatypeInfoName' [] (metadataType' variant name cons) ]

deriveGenericForDataDec ::
(Name -> Q Type) -> DatatypeVariant -> Cxt -> Name -> [TyVarBndrUnit] -> [Type] -> [TH.ConstructorInfo] -> Q [Dec]
(Name -> Q Type) -> DatatypeVariant -> Cxt -> Name -> [TyVarBndrVis] -> [Type] -> [TH.ConstructorInfo] -> Q [Dec]
deriveGenericForDataDec f _variant _cxt name _bndrs instTys cons = do
let typ = appTysSubst f name instTys
deriveGenericForDataType f typ cons
Expand All @@ -205,7 +206,7 @@ deriveGenericForDataType f typ cons = do
return [inst]

deriveMetadataForDataDec ::
(Name -> Q Type) -> DatatypeVariant -> Cxt -> Name -> [TyVarBndrUnit] -> [Type] -> [TH.ConstructorInfo] -> Q [Dec]
(Name -> Q Type) -> DatatypeVariant -> Cxt -> Name -> [TyVarBndrVis] -> [Type] -> [TH.ConstructorInfo] -> Q [Dec]
deriveMetadataForDataDec f variant _cxt name _bndrs instTys cons = do
let typ = appTysSubst f name instTys
deriveMetadataForDataType variant name typ cons
Expand Down Expand Up @@ -512,7 +513,7 @@ promotedTypeListSubst f (t:ts) = [t| $promotedConsT $(t >>= substType f) $(promo
appsT :: Name -> [Q Type] -> Q Type
appsT n = foldl' appT (conT n)

appTyVars :: (Name -> Q Type) -> Name -> [TyVarBndrUnit] -> Q Type
appTyVars :: (Name -> Q Type) -> Name -> [TyVarBndrVis] -> Q Type
appTyVars f n bndrs =
appsT n (map (f . tvName) bndrs)

Expand Down Expand Up @@ -549,7 +550,7 @@ withDataDec :: TH.DatatypeInfo
-- The datatype context
-> Name
-- The data type's name
-> [TyVarBndrUnit]
-> [TyVarBndrVis]
-- The datatype's type variable binders, both implicit and explicit.
-- Examples:
--
Expand Down Expand Up @@ -582,7 +583,7 @@ withDataDec (TH.DatatypeInfo { datatypeContext = ctxt
, datatypeVariant = variant
, datatypeCons = cons }) f =
checkForTypeData variant $
f variant ctxt name bndrs instTypes cons
f variant ctxt name (changeTVFlags bndrReq bndrs) instTypes cons

checkForTypeData :: DatatypeVariant -> Q a -> Q a
checkForTypeData variant q = do
Expand Down
6 changes: 3 additions & 3 deletions sop-core/sop-core.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ category: Data
build-type: Simple
cabal-version: >=1.10
extra-source-files: CHANGELOG.md doctest.sh
tested-with: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.7, GHC == 9.4.4, GHC == 9.6.1
tested-with: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.7, GHC == 9.4.4, GHC == 9.6.1, GHC == 9.8.1

source-repository head
type: git
Expand All @@ -41,8 +41,8 @@ library
Data.SOP.NP
Data.SOP.NS
Data.SOP.Sing
build-depends: base >= 4.9 && < 4.19,
deepseq >= 1.3 && < 1.5
build-depends: base >= 4.9 && < 4.20,
deepseq >= 1.3 && < 1.6
hs-source-dirs: src
default-language: Haskell2010
ghc-options: -Wall
Expand Down

0 comments on commit dbd4375

Please sign in to comment.