generic-data-functions 0.3.0 → 0.3.1
raw patch · 4 files changed
+22/−21 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Generic.Data.Function.FoldMap: genericFoldMapNonSum :: forall {cd} {f} asserts tag {m} a. (Generic a, Rep a ~ D1 cd f, m ~ GenericFoldMapM tag, GFoldMapNonSum tag f, ApplyGCAsserts asserts f) => a -> m
+ Generic.Data.Function.FoldMap: genericFoldMapNonSum :: forall {cd} {gf} asserts tag a. (Generic a, Rep a ~ D1 cd gf, GFoldMapNonSum tag gf, ApplyGCAsserts asserts gf) => a -> GenericFoldMapM tag
- Generic.Data.Function.FoldMap: genericFoldMapSum :: forall {cd} {f} opts asserts tag {m} a. (Generic a, Rep a ~ D1 cd f, m ~ GenericFoldMapM tag, GFoldMapSum opts tag f, ApplyGCAsserts asserts f) => (String -> m) -> a -> m
+ Generic.Data.Function.FoldMap: genericFoldMapSum :: forall {cd} {gf} opts asserts tag a. (Generic a, Rep a ~ D1 cd gf, GFoldMapSum opts tag gf, ApplyGCAsserts asserts gf) => (String -> GenericFoldMapM tag) -> a -> GenericFoldMapM tag
- Generic.Data.Function.FoldMap: genericFoldMapSumConsByte :: forall tag {m} a. (m ~ GenericFoldMapM tag, Generic a, GFoldMapSumConsByte tag (Rep a)) => (Word8 -> m) -> a -> m
+ Generic.Data.Function.FoldMap: genericFoldMapSumConsByte :: forall tag a. (Generic a, GFoldMapSumConsByte tag (Rep a)) => (Word8 -> GenericFoldMapM tag) -> a -> GenericFoldMapM tag
- Generic.Data.Function.Traverse: genericTraverseNonSum :: forall {cd} {gf} asserts tag a. (Generic a, Rep a ~ D1 cd gf, GTraverseNonSum cd tag gf, ApplyGCAsserts asserts tag, Functor (GenericTraverseF tag)) => GenericTraverseF tag a
+ Generic.Data.Function.Traverse: genericTraverseNonSum :: forall {cd} {gf} {k} asserts (tag :: k) a. (Generic a, Rep a ~ D1 cd gf, GTraverseNonSum cd tag gf, ApplyGCAsserts asserts gf, Functor (GenericTraverseF tag)) => GenericTraverseF tag a
- Generic.Data.Function.Traverse: genericTraverseSum :: forall {cd} {gf} opts asserts tag a pt. (Generic a, Rep a ~ D1 cd gf, GTraverseSum opts cd tag gf, ApplyGCAsserts asserts tag, GenericTraverseC tag pt, Functor (GenericTraverseF tag)) => PfxTagCfg pt -> GenericTraverseF tag a
+ Generic.Data.Function.Traverse: genericTraverseSum :: forall {cd} {gf} opts asserts tag a pt. (Generic a, Rep a ~ D1 cd gf, GTraverseSum opts cd tag gf, ApplyGCAsserts asserts gf, GenericTraverseC tag pt, Functor (GenericTraverseF tag)) => PfxTagCfg pt -> GenericTraverseF tag a
Files
- CHANGELOG.md +3/−0
- generic-data-functions.cabal +1/−1
- src/Generic/Data/Function/FoldMap.hs +15/−17
- src/Generic/Data/Function/Traverse.hs +3/−3
CHANGELOG.md view
@@ -1,3 +1,6 @@+## 0.3.1 (2024-04-03)+* fix error in traverse types+ ## 0.3.0 (2024-04-03) * Use type tags, push actual target types into a type family. It means more required type annotations, but this is fine by me as I think this library
generic-data-functions.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: generic-data-functions-version: 0.3.0+version: 0.3.1 synopsis: Familiar functions lifted to generic data types description: Please see README.md. category: Data, Serialization
src/Generic/Data/Function/FoldMap.hs view
@@ -47,12 +47,11 @@ -- -- @a@ must have exactly one constructor. genericFoldMapNonSum- :: forall {cd} {f} asserts tag {m} a- . ( Generic a, Rep a ~ D1 cd f- , m ~ GenericFoldMapM tag- , GFoldMapNonSum tag f- , ApplyGCAsserts asserts f)- => a -> m+ :: forall {cd} {gf} asserts tag a+ . ( Generic a, Rep a ~ D1 cd gf+ , GFoldMapNonSum tag gf+ , ApplyGCAsserts asserts gf)+ => a -> GenericFoldMapM tag genericFoldMapNonSum = gFoldMapNonSum @tag . unM1 . from -- | Generic 'foldMap' over a term of sum data type @a@.@@ -62,13 +61,12 @@ -- This is the most generic option, but depending on your string manipulation -- may be slower. genericFoldMapSum- :: forall {cd} {f} opts asserts tag {m} a- . ( Generic a, Rep a ~ D1 cd f- , m ~ GenericFoldMapM tag- , GFoldMapSum opts tag f- , ApplyGCAsserts asserts f)- => (String -> m)- -> a -> m+ :: forall {cd} {gf} opts asserts tag a+ . ( Generic a, Rep a ~ D1 cd gf+ , GFoldMapSum opts tag gf+ , ApplyGCAsserts asserts gf)+ => (String -> GenericFoldMapM tag)+ -> a -> GenericFoldMapM tag genericFoldMapSum f = gFoldMapSum @opts @tag f . unM1 . from -- | Generic 'foldMap' over a term of sum data type @a@ where constructors are@@ -81,8 +79,8 @@ -- This should be fairly fast, but sadly I think it's slower than the generics -- in store and binary/cereal libraries. genericFoldMapSumConsByte- :: forall tag {m} a- . (m ~ GenericFoldMapM tag, Generic a, GFoldMapSumConsByte tag (Rep a))- => (Word8 -> m)- -> a -> m+ :: forall tag a+ . (Generic a, GFoldMapSumConsByte tag (Rep a))+ => (Word8 -> GenericFoldMapM tag)+ -> a -> GenericFoldMapM tag genericFoldMapSumConsByte f = gFoldMapSumConsByte @tag f . from
src/Generic/Data/Function/Traverse.hs view
@@ -27,10 +27,10 @@ -- | Generic 'traverse' over a term of non-sum data type @f a@. genericTraverseNonSum- :: forall {cd} {gf} asserts tag a+ :: forall {cd} {gf} {k} asserts (tag :: k) a . ( Generic a, Rep a ~ D1 cd gf , GTraverseNonSum cd tag gf- , ApplyGCAsserts asserts tag+ , ApplyGCAsserts asserts gf , Functor (GenericTraverseF tag)) => GenericTraverseF tag a genericTraverseNonSum = (to . M1) <$> gTraverseNonSum @cd @tag@@ -42,7 +42,7 @@ :: forall {cd} {gf} opts asserts tag a pt . ( Generic a, Rep a ~ D1 cd gf , GTraverseSum opts cd tag gf- , ApplyGCAsserts asserts tag+ , ApplyGCAsserts asserts gf , GenericTraverseC tag pt, Functor (GenericTraverseF tag)) => PfxTagCfg pt -> GenericTraverseF tag a