Skip to content

Commit 7da7ab7

Browse files
authored
Merge pull request #7 from sumo/master
Update to use GHC 9.4.8 to 9.12.1. I did not realize I was an admin of this package.
2 parents 0d93cd6 + e95a2d4 commit 7da7ab7

File tree

5 files changed

+39
-46
lines changed

5 files changed

+39
-46
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ dist
55
*~
66
cabal.sandbox.config
77

8+
cabal.project.local

ixset.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Name: ixset
2-
Version: 1.1.1.2
2+
Version: 1.1.1.3
33
Synopsis: Efficient relational queries on Haskell sets.
44
Description:
55
Create and query sets that are indexed by multiple indices.
@@ -11,7 +11,7 @@ homepage: http://happstack.com
1111
Category: Data Structures
1212
Build-Type: Simple
1313
Cabal-Version: >= 1.10
14-
tested-with: GHC == 7.8.4, GHC == 7.10.3, 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.2
14+
tested-with: GHC == 9.4.8, GHC == 9.6.6, GHC == 9.8.2, GHC == 9.8.4, GHC == 9.10.1, GHC == 9.12.1
1515

1616
source-repository head
1717
type: git
@@ -26,7 +26,7 @@ Library
2626
Build-Depends: containers >=0.5.5.1,
2727
safecopy,
2828
template-haskell,
29-
syb-with-class >= 0.6.1
29+
syb-with-class >=0.6.1.15
3030

3131
hs-source-dirs: src
3232
Exposed-modules:

src/Data/IxSet.hs

Lines changed: 31 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{-# LANGUAGE UndecidableInstances, OverlappingInstances, FlexibleContexts, FlexibleInstances,
1+
{-# LANGUAGE UndecidableInstances, FlexibleContexts, FlexibleInstances,
22
MultiParamTypeClasses, TemplateHaskell, RankNTypes,
33
FunctionalDependencies, DeriveDataTypeable,
44
GADTs, CPP, ScopedTypeVariables #-}
@@ -86,7 +86,6 @@ module Data.IxSet
8686
-- * Set type
8787
IxSet,
8888
Indexable(..),
89-
Proxy(..),
9089
noCalcs,
9190
inferIxSet,
9291
ixSet,
@@ -167,24 +166,33 @@ import qualified Data.List as List
167166
import Data.Map (Map)
168167
import qualified Data.Map as Map
169168
import Data.Maybe (fromMaybe)
170-
import Data.Monoid (Monoid(mempty, mappend))
171169
import Data.SafeCopy (SafeCopy(..), contain, safeGet, safePut)
172170
import Data.Set (Set)
173171
import qualified Data.Set as Set
174-
import Data.Typeable (Typeable, cast, typeOf)
175-
import Language.Haskell.TH as TH
176-
import Data.Semigroup
177-
178-
-------------------------------------------------
179-
-- Type proxies
180-
181-
data Proxy a = Proxy
182-
183-
mkProxy :: a -> Proxy a
184-
mkProxy _ = Proxy
185-
186-
asProxyType :: a -> Proxy a -> a
187-
asProxyType a _ = a
172+
import Data.Typeable (Typeable, cast, typeOf, Proxy)
173+
import Language.Haskell.TH as TH
174+
( mkName,
175+
varP,
176+
varE,
177+
conE,
178+
appE,
179+
listE,
180+
sigE,
181+
normalB,
182+
valD,
183+
varT,
184+
conT,
185+
appT,
186+
Q,
187+
Dec(TySynD, DataD, NewtypeD),
188+
Name,
189+
forallT,
190+
tySynD,
191+
instanceD,
192+
reify,
193+
Info(VarI, TyConI),
194+
Specificity(SpecifiedSpec),
195+
TyVarBndr(..) )
188196

189197
-- the core datatypes
190198

@@ -345,30 +353,27 @@ inferIxSet ixset typeName calName entryPoints
345353
names = map tyVarBndrToName binders
346354

347355
typeCon = List.foldl' appT (conT typeName) (map varT names)
348-
#if MIN_VERSION_template_haskell(2,4,0)
349-
mkCtx = classP
350-
#else
356+
#if MIN_VERSION_template_haskell(2,10,0)
351357
-- mkType :: Name -> [TypeQ] -> TypeQ
352358
mkType con = foldl appT (conT con)
353359

354360
mkCtx = mkType
361+
#else
362+
mkCtx = classP
355363
#endif
356364
dataCtxConQ = [mkCtx ''Data [varT name] | name <- names]
357365
fullContext = do
358366
dataCtxCon <- sequence dataCtxConQ
359367
return (context ++ dataCtxCon)
360368
case calInfo of
361369
#if MIN_VERSION_template_haskell(2,11,0)
362-
VarI _ t _ ->
370+
VarI _ _ _ ->
363371
#else
364372
VarI _ t _ _ ->
365373
#endif
366-
let calType = getCalType t
367-
getCalType (ForallT _names _ t') = getCalType t'
368-
getCalType (AppT (AppT ArrowT _) t') = t'
369-
getCalType t' = error ("Unexpected type in getCalType: " ++ pprint t')
374+
let
370375
#if MIN_VERSION_template_haskell(2,17,0)
371-
binders' = map (fmap (\() -> SpecifiedSpec)) (binders :: [TyVarBndr ()])
376+
binders' = map (fmap (\_ -> SpecifiedSpec)) binders
372377
#else
373378
binders' = binders
374379
#endif
@@ -385,18 +390,7 @@ inferIxSet ixset typeName calName entryPoints
385390
return $ [i, ixType'] -- ++ d
386391
_ -> error "IxSet.inferIxSet calInfo unexpected match"
387392

388-
-- | Version of 'instanceD' that takes in a Q [Dec] instead of a [Q Dec]
389-
-- and filters out signatures from the list of declarations.
390-
instanceD' :: CxtQ -> TypeQ -> Q [Dec] -> DecQ
391-
instanceD' ctxt ty decs =
392-
do decs' <- decs
393-
let decs'' = filter (not . isSigD) decs'
394-
instanceD ctxt ty (map return decs'')
395393

396-
-- | Returns true if the Dec matches a SigD constructor.
397-
isSigD :: Dec -> Bool
398-
isSigD (SigD _ _) = True
399-
isSigD _ = False
400394

401395
#if MIN_VERSION_template_haskell(2,17,0)
402396
tyVarBndrToName :: TyVarBndr a -> Name
@@ -809,7 +803,6 @@ instance (Indexable a, Typeable a, Ord a) => Semigroup (IxSet a) where
809803

810804
instance (Indexable a, Typeable a, Ord a) => Monoid (IxSet a) where
811805
mempty = empty
812-
mappend = union
813806

814807
-- | Statistics about 'IxSet'. This function returns quadruple
815808
-- consisting of 1. total number of elements in the set 2. number of

src/Data/IxSet/Ix.hs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{-# LANGUAGE UndecidableInstances, OverlappingInstances, FlexibleContexts, FlexibleInstances,
1+
{-# LANGUAGE UndecidableInstances, FlexibleContexts, FlexibleInstances,
22
MultiParamTypeClasses, TemplateHaskell, PolymorphicComponents,
33
DeriveDataTypeable,ExistentialQuantification #-}
44

@@ -21,11 +21,11 @@ module Data.IxSet.Ix
2121

2222
import Data.Generics hiding (GT)
2323
import qualified Data.Generics.SYB.WithClass.Basics as SYBWC
24-
import Data.List (foldl')
2524
import Data.Map (Map)
2625
import qualified Data.Map.Strict as Map
2726
import Data.Set (Set)
2827
import qualified Data.Set as Set
28+
import Data.Foldable (foldl')
2929

3030
-- the core datatypes
3131

@@ -52,8 +52,7 @@ ixConstr = SYBWC.mkConstr ixDataType "Ix" [] SYBWC.Prefix
5252
ixDataType :: SYBWC.DataType
5353
ixDataType = SYBWC.mkDataType "Ix" [ixConstr]
5454

55-
instance (SYBWC.Typeable Ix, SYBWC.Data ctx a, SYBWC.Sat (ctx (Ix a)))
56-
=> SYBWC.Data ctx (Ix a) where
55+
instance (SYBWC.Sat (ctx (Ix a)), Typeable a) => SYBWC.Data ctx (Ix a) where
5756
gfoldl _ _ _ _ = error "gfoldl Ix" :: w (Ix a)
5857
toConstr _ (Ix _ _) = ixConstr
5958
gunfold _ _ _ _ = error "gunfold Ix" :: c (Ix a)

tests/Data/IxSet/Tests.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{-# LANGUAGE DeriveDataTypeable, TemplateHaskell, OverlappingInstances, UndecidableInstances, TemplateHaskell, KindSignatures #-}
1+
{-# LANGUAGE DeriveDataTypeable, TemplateHaskell, UndecidableInstances, TemplateHaskell, KindSignatures #-}
22

33
-- Check that the SYBWC Data instance for IxSet works, by testing
44
-- that going to and from XML works.

0 commit comments

Comments
 (0)