sop-core 0.5.0.1 → 0.5.0.2
raw patch · 7 files changed
+36/−35 lines, 7 filesdep ~basedep ~deepseqPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base, deepseq
API changes (from Hackage documentation)
- Data.SOP: data Proxy (t :: k) :: forall k. () => k -> Type
- Data.SOP.BasicFunctors: instance forall k l (f :: l -> *) (g :: k -> l) (a :: k). Control.DeepSeq.NFData (f (g a)) => Control.DeepSeq.NFData ((Data.SOP.BasicFunctors.:.:) f g a)
- Data.SOP.BasicFunctors: instance forall k l (f :: l -> *) (g :: k -> l) (x :: k). GHC.Base.Monoid (f (g x)) => GHC.Base.Monoid ((Data.SOP.BasicFunctors.:.:) f g x)
- Data.SOP.BasicFunctors: instance forall k l (f :: l -> *) (g :: k -> l) (x :: k). GHC.Base.Semigroup (f (g x)) => GHC.Base.Semigroup ((Data.SOP.BasicFunctors.:.:) f g x)
- Data.SOP.Constraint: instance forall b a (xs :: [a]) (ys :: [b]) (c :: a -> b -> GHC.Types.Constraint). (Data.SOP.Constraint.SListI xs, Data.SOP.Constraint.SListI ys, Data.SOP.Constraint.SameShapeAs xs ys, Data.SOP.Constraint.SameShapeAs ys xs, Data.SOP.Constraint.AllZipF c xs ys) => Data.SOP.Constraint.AllZip c xs ys
- Data.SOP.Constraint: instance forall k1 k2 (f :: k2 -> GHC.Types.Constraint) (g :: k1 -> k2) (x :: k1). f (g x) => Data.SOP.Constraint.Compose f g x
- Data.SOP.Constraint: instance forall k1 k2 k0 (f :: k2 -> k0) (x :: k2) (g :: k1 -> k0) (y :: k1). GHC.Types.Coercible (f x) (g y) => Data.SOP.Constraint.LiftedCoercible f g x y
+ Data.SOP: data Proxy (t :: k)
+ Data.SOP.BasicFunctors: instance forall l k (f :: l -> *) (g :: k -> l) (a :: k). Control.DeepSeq.NFData (f (g a)) => Control.DeepSeq.NFData ((Data.SOP.BasicFunctors.:.:) f g a)
+ Data.SOP.BasicFunctors: instance forall l k (f :: l -> *) (g :: k -> l) (x :: k). GHC.Base.Monoid (f (g x)) => GHC.Base.Monoid ((Data.SOP.BasicFunctors.:.:) f g x)
+ Data.SOP.BasicFunctors: instance forall l k (f :: l -> *) (g :: k -> l) (x :: k). GHC.Base.Semigroup (f (g x)) => GHC.Base.Semigroup ((Data.SOP.BasicFunctors.:.:) f g x)
+ Data.SOP.Constraint: instance forall a b (xs :: [a]) (ys :: [b]) (c :: a -> b -> GHC.Types.Constraint). (Data.SOP.Constraint.SListI xs, Data.SOP.Constraint.SListI ys, Data.SOP.Constraint.SameShapeAs xs ys, Data.SOP.Constraint.SameShapeAs ys xs, Data.SOP.Constraint.AllZipF c xs ys) => Data.SOP.Constraint.AllZip c xs ys
+ Data.SOP.Constraint: instance forall k1 k2 (f :: k1 -> GHC.Types.Constraint) (g :: k2 -> k1) (x :: k2). f (g x) => Data.SOP.Constraint.Compose f g x
+ Data.SOP.Constraint: instance forall k1 k2 k3 (f :: k1 -> k2) (x :: k1) (g :: k3 -> k2) (y :: k3). GHC.Types.Coercible (f x) (g y) => Data.SOP.Constraint.LiftedCoercible f g x y
- Data.SOP: Comp :: f (g p) -> (:.:)
+ Data.SOP: Comp :: f (g p) -> (:.:) (f :: l -> Type) (g :: k -> l) (p :: k)
- Data.SOP: I :: a -> I
+ Data.SOP: I :: a -> I (a :: Type)
- Data.SOP: K :: a -> K
+ Data.SOP: K :: a -> K (a :: Type) (b :: k)
- Data.SOP: POP :: NP (NP f) xss -> POP
+ Data.SOP: POP :: NP (NP f) xss -> POP (f :: k -> Type) (xss :: [[k]])
- Data.SOP: Proxy :: Proxy
+ Data.SOP: Proxy :: Proxy (t :: k)
- Data.SOP: SOP :: NS (NP f) xss -> SOP
+ Data.SOP: SOP :: NS (NP f) xss -> SOP (f :: k -> Type) (xss :: [[k]])
- Data.SOP.BasicFunctors: Comp :: f (g p) -> (:.:)
+ Data.SOP.BasicFunctors: Comp :: f (g p) -> (:.:) (f :: l -> Type) (g :: k -> l) (p :: k)
- Data.SOP.BasicFunctors: I :: a -> I
+ Data.SOP.BasicFunctors: I :: a -> I (a :: Type)
- Data.SOP.BasicFunctors: K :: a -> K
+ Data.SOP.BasicFunctors: K :: a -> K (a :: Type) (b :: k)
- Data.SOP.NP: POP :: NP (NP f) xss -> POP
+ Data.SOP.NP: POP :: NP (NP f) xss -> POP (f :: k -> Type) (xss :: [[k]])
- Data.SOP.NS: SOP :: NS (NP f) xss -> SOP
+ Data.SOP.NS: SOP :: NS (NP f) xss -> SOP (f :: k -> Type) (xss :: [[k]])
Files
- CHANGELOG.md +5/−1
- sop-core.cabal +3/−3
- src/Data/SOP.hsig +0/−7
- src/Data/SOP/BasicFunctors.hs +20/−20
- src/Data/SOP/Classes.hs +3/−3
- src/Data/SOP/Constraint.hs +1/−1
- src/Data/SOP/NP.hs +4/−0
CHANGELOG.md view
@@ -1,6 +1,10 @@+# 0.5.0.2 (2021-01-02)++* Compatibility with GHC-9.0 and GHC-9.2.+ # 0.5.0.1 (2020-03-29) -* Compatiblity with GHC-8.10 (thanks to Ryan Scott).+* Compatibility with GHC-8.10 (thanks to Ryan Scott). # 0.5.0.0 (2019-05-09)
sop-core.cabal view
@@ -1,5 +1,5 @@ name: sop-core-version: 0.5.0.1+version: 0.5.0.2 synopsis: True Sums of Products description: Implementation of n-ary sums and n-ary products.@@ -25,7 +25,7 @@ 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.2, GHC == 8.10.1+tested-with: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.2, GHC == 8.10.4, GHC == 9.0.1, GHC == 9.2.1 source-repository head type: git@@ -41,7 +41,7 @@ Data.SOP.NP Data.SOP.NS Data.SOP.Sing- build-depends: base >= 4.9 && < 4.15,+ build-depends: base >= 4.9 && < 4.17, deepseq >= 1.3 && < 1.5 hs-source-dirs: src default-language: Haskell2010
− src/Data/SOP.hsig
@@ -1,7 +0,0 @@-signature Data.SOP where--data NP :: (k -> Type) -> [k] -> Type where- Nil :: NP f '[]- (:*) :: f x -> NP f xs -> NP f (x ': xs)--infixr 5 :*
src/Data/SOP/BasicFunctors.hs view
@@ -56,6 +56,8 @@ import Control.DeepSeq (NFData1(..), NFData2(..)) #endif +import Data.Coerce (coerce)+ -- * Basic functors -- | The constant type functor.@@ -110,7 +112,9 @@ -- | @since 0.4.0.0 instance Monoid a => Monoid (K a b) where mempty = K mempty+#if !MIN_VERSION_base(4,11,0) mappend (K x) (K y) = K (mappend x y)+#endif instance Monoid a => Applicative (K a) where pure _ = K mempty@@ -134,14 +138,15 @@ -- | @since 0.4.0.0 instance Monoid a => Monoid (I a) where mempty = I mempty+#if !MIN_VERSION_base(4,11,0) mappend (I x) (I y) = I (mappend x y)+#endif instance Applicative I where pure = I I f <*> I x = I (f x) instance Monad I where- return = I I x >>= f = f x @@ -185,7 +190,9 @@ -- | @since 0.4.0.0 instance (Monoid (f (g x))) => Monoid ((f :.: g) x) where mempty = Comp mempty+#if !MIN_VERSION_base(4,11,0) mappend (Comp x) (Comp y) = Comp (mappend x y)+#endif instance (Functor f, Functor g) => Functor (f :.: g) where fmap f (Comp x) = Comp (fmap (fmap f) x)@@ -274,19 +281,12 @@ -- * Mapping functions --- Implementation note:------ All of these functions are just type specializations of--- 'coerce'. However, we currently still support GHC 7.6--- which does not support 'coerce', so we write them--- explicitly.- -- | Lift the given function. -- -- @since 0.2.5.0 -- mapII :: (a -> b) -> I a -> I b-mapII = \ f (I a) -> I (f a)+mapII = coerce {-# INLINE mapII #-} -- | Lift the given function.@@ -294,7 +294,7 @@ -- @since 0.2.5.0 -- mapIK :: (a -> b) -> I a -> K b c-mapIK = \ f (I a) -> K (f a)+mapIK = coerce {-# INLINE mapIK #-} -- | Lift the given function.@@ -302,7 +302,7 @@ -- @since 0.2.5.0 -- mapKI :: (a -> b) -> K a c -> I b-mapKI = \ f (K a) -> I (f a)+mapKI = coerce {-# INLINE mapKI #-} -- | Lift the given function.@@ -310,7 +310,7 @@ -- @since 0.2.5.0 -- mapKK :: (a -> b) -> K a c -> K b d-mapKK = \ f (K a) -> K (f a)+mapKK = coerce {-# INLINE mapKK #-} -- | Lift the given function.@@ -318,7 +318,7 @@ -- @since 0.2.5.0 -- mapIII :: (a -> b -> c) -> I a -> I b -> I c-mapIII = \ f (I a) (I b) -> I (f a b)+mapIII = coerce {-# INLINE mapIII #-} -- | Lift the given function.@@ -326,7 +326,7 @@ -- @since 0.2.5.0 -- mapIIK :: (a -> b -> c) -> I a -> I b -> K c d-mapIIK = \ f (I a) (I b) -> K (f a b)+mapIIK = coerce {-# INLINE mapIIK #-} -- | Lift the given function.@@ -334,7 +334,7 @@ -- @since 0.2.5.0 -- mapIKI :: (a -> b -> c) -> I a -> K b d -> I c-mapIKI = \ f (I a) (K b) -> I (f a b)+mapIKI = coerce {-# INLINE mapIKI #-} -- | Lift the given function.@@ -342,7 +342,7 @@ -- @since 0.2.5.0 -- mapIKK :: (a -> b -> c) -> I a -> K b d -> K c e-mapIKK = \ f (I a) (K b) -> K (f a b)+mapIKK = coerce {-# INLINE mapIKK #-} -- | Lift the given function.@@ -350,7 +350,7 @@ -- @since 0.2.5.0 -- mapKII :: (a -> b -> c) -> K a d -> I b -> I c-mapKII = \ f (K a) (I b) -> I (f a b)+mapKII = coerce {-# INLINE mapKII #-} -- | Lift the given function.@@ -358,7 +358,7 @@ -- @since 0.2.5.0 -- mapKIK :: (a -> b -> c) -> K a d -> I b -> K c e-mapKIK = \ f (K a) (I b) -> K (f a b)+mapKIK = coerce {-# INLINE mapKIK #-} -- | Lift the given function.@@ -366,7 +366,7 @@ -- @since 0.2.5.0 -- mapKKI :: (a -> b -> c) -> K a d -> K b e -> I c-mapKKI = \ f (K a) (K b) -> I (f a b)+mapKKI = coerce {-# INLINE mapKKI #-} -- | Lift the given function.@@ -374,5 +374,5 @@ -- @since 0.2.5.0 -- mapKKK :: (a -> b -> c) -> K a d -> K b e -> K c f-mapKKK = \ f (K a) (K b) -> K (f a b)+mapKKK = coerce {-# INLINE mapKKK #-}
src/Data/SOP/Classes.hs view
@@ -294,7 +294,7 @@ -- hcliftA :: (AllN (Prod h) c xs, HAp h) => proxy c -> (forall a. c a => f a -> f' a) -> h f xs -> h f' xs --- | Variant of 'hcliftA2' that takes a constrained function.+-- | Variant of 'hliftA2' that takes a constrained function. -- -- /Specification:/ --@@ -304,7 +304,7 @@ -- hcliftA2 :: (AllN (Prod h) c xs, HAp h, HAp (Prod h)) => proxy c -> (forall a. c a => f a -> f' a -> f'' a) -> Prod h f xs -> h f' xs -> h f'' xs --- | Variant of 'hcliftA3' that takes a constrained function.+-- | Variant of 'hliftA3' that takes a constrained function. -- -- /Specification:/ --@@ -455,7 +455,7 @@ -- hctraverse' :: (AllN h c xs, Applicative g) => proxy c -> (forall a. c a => f a -> g (f' a)) -> h f xs -> g (h f' xs) - -- | Unconstrained variant of `htraverse'`.+ -- | Unconstrained variant of `hctraverse'`. -- -- /Instances:/ --
src/Data/SOP/Constraint.hs view
@@ -154,7 +154,7 @@ -- -- /Example:/ The constraint ----- > All (~) '[ Int, Bool, Char ] '[ a, b, c ]+-- > AllZip (~) '[ Int, Bool, Char ] '[ a, b, c ] -- -- is equivalent to the constraint --
src/Data/SOP/NP.hs view
@@ -159,7 +159,9 @@ #endif ) => Monoid (NP f xs) where mempty = cpure_NP (Proxy :: Proxy (Monoid `Compose` f)) mempty+#if !MIN_VERSION_base(4,11,0) mappend = czipWith_NP (Proxy :: Proxy (Monoid `Compose` f)) mappend+#endif -- | @since 0.2.5.0 instance All (NFData `Compose` f) xs => NFData (NP f xs) where@@ -193,7 +195,9 @@ -- | @since 0.4.0.0 instance (Monoid (NP (NP f) xss)) => Monoid (POP f xss) where mempty = POP mempty+#if !MIN_VERSION_base(4,11,0) mappend (POP xss) (POP yss) = POP (mappend xss yss)+#endif -- | @since 0.2.5.0 instance (NFData (NP (NP f) xss)) => NFData (POP f xss) where