barbies 0.1.0.1 → 0.1.2.0
raw patch · 4 files changed
+17/−2 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +6/−0
- barbies.cabal +1/−1
- src/Data/Barbie/Internal/Instances.hs +8/−0
- test/Spec/Wrapper.hs +2/−1
ChangeLog.md view
@@ -1,5 +1,11 @@ # Changelog for barbies +## 0.1.2.0+ - Use 'Monoid' and not 'Semigroup' as constraints for the 'Monoid' instance++## 0.1.1.0+ - Add `instance Semigroup (Barbie b)` to go along the `Monoid` instance+ ## 0.1.0.1 - Works under GHC 8.0.2, but notice one needs to use empty instance declarations, because ghc chokes on `deriving` clauses.
barbies.cabal view
@@ -1,5 +1,5 @@ name: barbies-version: 0.1.0.1+version: 0.1.2.0 synopsis: Classes for working with types that can change clothes. description: Types that are parametric on a functor are like Barbies that have an outfit for each role. This package provides the basic abstractions to work with them comfortably. category: Data-structures
src/Data/Barbie/Internal/Instances.hs view
@@ -14,6 +14,8 @@ import Data.Barbie.Internal.Product import Data.Barbie.Internal.ProofB +import Data.Semigroup+ -- | A wrapper for Barbie-types, providing useful instances. newtype Barbie b (f :: * -> *) = Barbie { getBarbie :: b f }@@ -27,6 +29,12 @@ instance TraversableB b => TraversableB (Barbie b) where btraverse f = fmap Barbie . btraverse f . getBarbie ++instance (ProofB b, ConstraintsOf Semigroup f b) => Semigroup (Barbie b f) where+ (<>) = bzipWith3 mk bproof+ where+ mk :: DictOf Semigroup f a -> f a -> f a -> f a+ mk = requiringDict (<>) instance (ProofB b, ConstraintsOf Monoid f b) => Monoid (Barbie b f) where mempty = bmap mk bproof
test/Spec/Wrapper.hs view
@@ -9,7 +9,7 @@ import Data.Barbie (Barbie(..), ConstraintsOf, ProofB) -import Data.Monoid+import Data.Semigroup import Test.Tasty(testGroup, TestTree) import Test.Tasty.QuickCheck(Arbitrary(..), testProperty)@@ -18,6 +18,7 @@ :: forall b . ( Arbitrary (b []), Eq (b []), Show (b []) , ProofB b+ , ConstraintsOf Semigroup [] b , ConstraintsOf Monoid [] b ) => TestTree