fastsum 0.1.1.1 → 0.2.0.0
raw patch · 4 files changed
+16/−4 lines, 4 filesdep ~template-haskellPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: template-haskell
API changes (from Hackage documentation)
- Data.Sum: instance (Data.Sum.Apply Data.Hashable.Class.Hashable1 fs, Data.Hashable.Class.Hashable a) => Data.Hashable.Class.Hashable (Data.Sum.Sum fs a)
- Data.Sum: instance Data.Sum.Apply Data.Hashable.Class.Hashable1 fs => Data.Hashable.Class.Hashable1 (Data.Sum.Sum fs)
+ Data.Sum: [Sum] :: {-# UNPACK #-} !Int -> t v -> Sum r v
+ Data.Sum: instance (Data.Sum.Apply Data.Functor.Classes.Eq1 fs, Data.Sum.Apply Data.Hashable.Class.Hashable1 fs) => Data.Hashable.Class.Hashable1 (Data.Sum.Sum fs)
+ Data.Sum: instance (Data.Sum.Apply Data.Functor.Classes.Eq1 fs, Data.Sum.Apply Data.Hashable.Class.Hashable1 fs, Data.Hashable.Class.Hashable a) => Data.Hashable.Class.Hashable (Data.Sum.Sum fs a)
Files
- ChangeLog.md +6/−0
- fastsum.cabal +4/−2
- src/Data/Sum.hs +2/−2
- src/Data/Sum/Templates.hs +4/−0
ChangeLog.md view
@@ -1,3 +1,9 @@+# v0.2.0.0++Support GHC 9.2 by enabling use of `template-haskell` versions >= 2.19.++Add an `Eq1` constraint to the `Hashable1` constraint to satisfy newer `hashable` versions.+ # v0.1.1.1 Enable use of `template-haskell` versions >= 2.15.
fastsum.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.4 name: fastsum-version: 0.1.1.1+version: 0.2.0.0 synopsis: A fast open-union type suitable for 100+ contained alternatives homepage: https://github.com/patrickt/fastsum#readme license: BSD-3-Clause@@ -17,6 +17,8 @@ GHC == 8.4.3 GHC == 8.6.3 GHC == 8.8.1+ GHC == 8.10.7+ GHC == 9.2.1 description: This package provides Data.Sum, an open-union type, similar to the Union type that powers the implementation of Oleg Kiselyov's extensible-effects library.@@ -42,7 +44,7 @@ , deepseq >= 1.4 && <2 , ghc-prim >= 0.5 && <1 , hashable >= 1.2 && <2- , template-haskell >= 2.12 && < 2.16+ , template-haskell >= 2.12 && < 2.19 default-language: Haskell2010 executable examples
src/Data/Sum.hs view
@@ -238,11 +238,11 @@ {-# INLINABLE showsPrec #-} -instance Apply Hashable1 fs => Hashable1 (Sum fs) where+instance (Apply Eq1 fs, Apply Hashable1 fs) => Hashable1 (Sum fs) where liftHashWithSalt hashWithSalt' salt u@(Sum n _) = salt `hashWithSalt` apply @Hashable1 (liftHashWithSalt hashWithSalt' n) u {-# INLINABLE liftHashWithSalt #-} -instance (Apply Hashable1 fs, Hashable a) => Hashable (Sum fs a) where+instance (Apply Eq1 fs, Apply Hashable1 fs, Hashable a) => Hashable (Sum fs a) where hashWithSalt = hashWithSalt1 {-# INLINABLE hashWithSalt #-}
src/Data/Sum/Templates.hs view
@@ -77,7 +77,11 @@ [applyC, apply, f, r, union] = mkName <$> ["Apply", "apply", "f", "r", "Sum"] [constraint, a] = VarT . mkName <$> ["constraint", "a"] mkClause i nthType = Clause+#if MIN_VERSION_template_haskell(2,18,0)+ [ VarP f, ConP union [] [ LitP (IntegerL i), VarP r ] ]+#else [ VarP f, ConP union [ LitP (IntegerL i), VarP r ] ]+#endif (NormalB (AppE (VarE f) (SigE (AppE (VarE 'unsafeCoerce) (VarE r)) (AppT nthType a)))) []