these 0.7.4 → 0.7.5
raw patch · 5 files changed
+47/−19 lines, 5 filesdep ~QuickCheckdep ~basedep ~containers
Dependency ranges changed: QuickCheck, base, containers
Files
- CHANGELOG.md +6/−0
- Data/Align.hs +13/−0
- Data/These.hs +9/−3
- test/Tests.hs +2/−1
- these.cabal +17/−15
CHANGELOG.md view
@@ -1,3 +1,9 @@+# 0.7.5++- Add Compose and (,) Crosswalk instances+- Add `bitraverseThese`+- GHC-8.6 support+ # 0.7.4 - QuickCheck-2.10 support: Arbitrary1/2 instances
Data/Align.hs view
@@ -29,6 +29,7 @@ import Data.Bifoldable (Bifoldable(..)) import Data.Bifunctor (Bifunctor(..)) import Data.Foldable+import Data.Functor.Compose import Data.Functor.Identity import Data.Functor.Product import Data.Hashable (Hashable(..))@@ -367,6 +368,18 @@ instance Crosswalk V.Vector where crosswalk = crosswalkVector++instance Crosswalk ((,) a) where+ crosswalk fun (a, x) = fmap ((,) a) (fun x)++-- can't (shouldn't) do longer tuples until there are Functor and Foldable+-- instances for them++instance (Crosswalk f, Crosswalk g) => Crosswalk (Compose f g) where+ crosswalk f = id+ . fmap Compose -- can't coerce: maybe the Align-able thing has role nominal+ . crosswalk (crosswalk f)+ . getCompose -- -------------------------------------------------------------------------- -- | Bifoldable bifunctors supporting traversal through an alignable
Data/These.hs view
@@ -42,6 +42,8 @@ , mapThis , mapThat + , bitraverseThese+ -- $align ) where @@ -174,6 +176,12 @@ mapThese _ g (That x) = That (g x) mapThese f g (These a x) = These (f a) (g x) +-- | 'Bitraversable'.+bitraverseThese :: Applicative f => (a -> f c) -> (b -> f d) -> These a b -> f (These c d)+bitraverseThese f _ (This x) = This <$> f x+bitraverseThese _ g (That x) = That <$> g x+bitraverseThese f g (These x y) = These <$> f x <*> g y+ -- | @'mapThis' = over 'here'@ mapThis :: (a -> c) -> These a b -> These c b mapThis f = mapThese f id@@ -250,9 +258,7 @@ bifold1 = these id id (<>) instance Bitraversable These where- bitraverse f _ (This x) = This <$> f x- bitraverse _ g (That x) = That <$> g x- bitraverse f g (These x y) = These <$> f x <*> g y+ bitraverse = bitraverseThese instance Bitraversable1 These where bitraverse1 f _ (This x) = This <$> f x
test/Tests.hs view
@@ -1,4 +1,3 @@-{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-}@@ -64,6 +63,8 @@ , crosswalkLaws "These" (Proxy :: Proxy (These Int)) , crosswalkLaws "Seq" (Proxy :: Proxy Seq) , crosswalkLaws "Vector" (Proxy :: Proxy V.Vector)+ , crosswalkLaws "(,) Int" (Proxy :: Proxy ((,) Int))+ , crosswalkLaws "Compose [] []" (Proxy :: Proxy (Compose [] [])) , testProperty "Map value laziness property" mapStrictnessProp , testProperty "IntMap value laziness property" intmapStrictnessProp , aesonProps
these.cabal view
@@ -1,5 +1,5 @@ Name: these-Version: 0.7.4+Version: 0.7.5 Synopsis: An either-or-both data type & a generalized 'zip with padding' typeclass Homepage: https://github.com/isomorphism/these License: BSD3@@ -28,7 +28,9 @@ GHC==7.8.4, GHC==7.10.3, GHC==8.0.2,- GHC==8.2.1+ GHC==8.2.2,+ GHC==8.4.3,+ GHC==8.6.1 source-repository head type: git@@ -42,22 +44,22 @@ Control.Monad.Chronicle.Class, Control.Monad.Trans.Chronicle - Build-depends: base >= 4.4 && < 4.11,- aeson >= 0.7.0.4 && < 1.3,- bifunctors >= 0.1 && < 5.5,+ Build-depends: base >= 4.4 && < 4.13,+ aeson >= 0.7.0.4 && < 1.5,+ bifunctors >= 0.1 && < 5.6, binary >= 0.5.0.2 && < 0.10,- containers >= 0.4 && < 0.6,+ containers >= 0.4 && < 0.7, data-default-class >= 0.0 && < 0.2, deepseq >= 1.3.0.0 && < 1.5, hashable >= 1.2.3 && < 1.3,- keys >= 3.10 && < 3.12,+ keys >= 3.10 && < 3.13, mtl >= 2 && < 2.3,- profunctors >= 3 && < 5.3,- QuickCheck >= 2.10 && < 2.11,- semigroupoids >= 1.0 && < 5.3,+ profunctors >= 3 && < 5.4,+ QuickCheck >= 2.10 && < 2.13,+ semigroupoids >= 5 && < 5.4, transformers >= 0.2 && < 0.6,- transformers-compat >= 0.2 && < 0.6,- unordered-containers >= 0.2 && < 0.3,+ transformers-compat >= 0.2 && < 0.7,+ unordered-containers >= 0.2.4.0 && < 0.3, vector >= 0.4 && < 0.13, vector-instances >= 3.3.1 && < 3.5 if impl(ghc <7.5)@@ -76,9 +78,9 @@ ghc-options: -Wall build-depends: these, base >= 4.5,- quickcheck-instances >= 0.3.15 && < 0.3.16,- tasty >= 0.10 && < 0.12,- tasty-quickcheck >= 0.8 && < 0.10,+ quickcheck-instances >= 0.3.15 && < 0.4,+ tasty >= 0.10 && < 1.2,+ tasty-quickcheck >= 0.8 && < 0.11, aeson, bifunctors, binary,