packages feed

nonempty-containers 0.3.4.3 → 0.3.4.4

raw patch · 7 files changed

+53/−40 lines, 7 filesdep +invariant

Dependencies added: invariant

Files

CHANGELOG.md view
@@ -1,42 +1,18 @@ Changelog ========= -Version 0.3.4.3-------------*August 25, 2021*--<https://github.com/mstksg/nonempty-containers/releases/tag/v0.3.4.3>--*   Fix `intersperse` for singleton non-empty sequences. (@eddiemundo)-*   Fix `deleteMax` for singleton containers.--Version 0.3.4.2-------------*August 25, 2021*--<https://github.com/mstksg/nonempty-containers/releases/tag/v0.3.4.2>--*   Compatibility with GHC 9. (@andremarianiello)--Version 0.3.4.1-------------*August 22, 2020*--<https://github.com/mstksg/nonempty-containers/releases/tag/v0.3.4.1>--*   Add `Ord` instance to `NESeq`. (@mitchellwrosen)--Version 0.3.4.0+Version 0.3.4.x --------------- -*August 4, 2020*--<https://github.com/mstksg/nonempty-containers/releases/tag/v0.3.4.0>--*   Add `ToJSON` and `FromJSON` instances.+* **0.3.4.0**: `ToJSON` and `FromJSON` instances (*August 4, 2020*)+* **0.3.4.1**: `Ord` instance to `NESeq` (@mitchelwrosen) (*August 22, 2020*)+* **0.3.4.2**: Compatibility with GHC 9 (@andremarianiello) (*August 25, 2021*)+* **0.3.4.3**: (*August 25, 2021*)+    * Fix `intersperse` for singleton non-empty sequences. (@eddiemundo)+    * Fix `deleteMax` for singleton containers.+* **0.3.4.4**: (*September 25, 2021*)+    * `Alt` instances for `NEMap` and `NEIntMap`+    * `Invariant` instance for `NEMap`, `NEIntMap`, and `NESeq`.  Version 0.3.3.0 ---------------
nonempty-containers.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: c6b3bfa5e2f51136fd5cd80ba3505719544753478e23f5114f6c718a42120786+-- hash: bb13585a77cf2559f37215ac9805633bb0d48afb450f60b68bbad03aa7770ac4  name:           nonempty-containers-version:        0.3.4.3+version:        0.3.4.4 synopsis:       Non-empty variants of containers data types, with full API description:    Efficient and optimized non-empty versions of types from /containers/.                 Inspired by /non-empty-containers/ library, except attempting a more@@ -57,6 +57,7 @@     , comonad     , containers >=0.5.9     , deepseq+    , invariant     , nonempty-vector     , semigroupoids     , these@@ -83,6 +84,7 @@     , containers >=0.5.9     , hedgehog >=1.0     , hedgehog-fn >=1.0+    , invariant     , nonempty-containers     , nonempty-vector     , semigroupoids
src/Data/IntMap/NonEmpty/Internal.hs view
@@ -62,15 +62,15 @@ import           Data.Coerce import           Data.Data import           Data.Function-import           Data.Functor.Apply+import           Data.Functor.Alt import           Data.Functor.Classes+import           Data.Functor.Invariant import           Data.IntMap.Internal       (IntMap(..), Key) import           Data.List.NonEmpty         (NonEmpty(..)) import           Data.Maybe import           Data.Semigroup import           Data.Semigroup.Foldable    (Foldable1(fold1)) import           Data.Semigroup.Traversable (Traversable1(..))--- import           Data.Typeable              (Typeable) import           Prelude hiding             (foldr1, foldl1, foldr, foldl, map) import           Text.Read import qualified Data.Aeson                 as A@@ -199,6 +199,10 @@       where         err = "NEIntMap: Non-empty map expected, but empty map found" +-- | @since 0.3.4.4+instance Alt NEIntMap where+    (<!>) = union+ -- | /O(n)/. Fold the values in the map using the given right-associative -- binary operator, such that @'foldr' f z == 'Prelude.foldr' f z . 'elems'@. --@@ -502,6 +506,11 @@     {-# INLINE fmap #-}     x <$ NEIntMap k _ m = NEIntMap k x (x <$ m)     {-# INLINE (<$) #-}++-- | @since 0.3.4.4+instance Invariant NEIntMap where+    invmap f _ = fmap f+    {-# INLINE invmap #-}  -- | Traverses elements in order of ascending keys. --
src/Data/Map/NonEmpty/Internal.hs view
@@ -57,8 +57,9 @@ import           Data.Coerce import           Data.Data import           Data.Function-import           Data.Functor.Apply+import           Data.Functor.Alt import           Data.Functor.Classes+import           Data.Functor.Invariant import           Data.List.NonEmpty         (NonEmpty(..)) import           Data.Map.Internal          (Map(..)) import           Data.Maybe@@ -200,6 +201,11 @@       where         err = "NEMap: Non-empty map expected, but empty map found" +-- | @since 0.3.4.4+instance Ord k => Alt (NEMap k) where+    (<!>) = union+    {-# INLINE (<!>) #-}+ -- | /O(n)/. Fold the values in the map using the given right-associative -- binary operator, such that @'foldr' f z == 'Prelude.foldr' f z . 'elems'@. --@@ -502,6 +508,11 @@     {-# INLINE fmap #-}     x <$ NEMap k _ m = NEMap k x (x <$ m)     {-# INLINE (<$) #-}++-- | @since 0.3.4.4+instance Invariant (NEMap k) where+    invmap f _ = fmap f+    {-# INLINE invmap #-}  -- | Traverses elements in order of ascending keys --
src/Data/Sequence/NonEmpty/Internal.hs view
@@ -60,6 +60,7 @@ import           Data.Functor.Extend import           Data.List.NonEmpty         (NonEmpty(..)) import           Data.Semigroup+import           Data.Functor.Invariant import           Data.Semigroup.Foldable import           Data.Semigroup.Traversable import           Data.Sequence              (Seq(..))@@ -393,6 +394,11 @@     {-# INLINE fmap #-}     x <$ xs = replicate (length xs) x     {-# INLINE (<$) #-}++-- | @since 0.3.4.4+instance Invariant NESeq where+    invmap f _ = fmap f+    {-# INLINE invmap #-}  instance Apply NESeq where     (f :<|| fs) <.> xs = fxs |>< fsxs
test/Tests/IntMap.hs view
@@ -8,6 +8,7 @@ import           Control.Comonad import           Data.Coerce import           Data.Foldable+import           Data.Functor.Alt import           Data.Functor.Identity import           Data.List.NonEmpty            (NonEmpty(..)) import           Data.Semigroup.Foldable@@ -729,4 +730,7 @@     (\f -> foldMap ((:[]) . f) . toList)     (\f -> foldMap ((:[]) . f)) -+prop_alt :: Property+prop_alt = ttProp (GTNEIntMap :-> GTNEIntMap :-> TTNEIntMap)+    (<!>)+    (<!>)
test/Tests/Map.hs view
@@ -7,6 +7,7 @@ import           Control.Comonad import           Data.Coerce import           Data.Foldable+import           Data.Functor.Alt import           Data.Functor.Identity import           Data.List.NonEmpty         (NonEmpty(..)) import           Data.Semigroup.Foldable@@ -813,3 +814,7 @@     (\f -> foldMap ((:[]) . f))     (\f -> foldMap ((:[]) . f)) +prop_alt :: Property+prop_alt = ttProp (GTNEMap :-> GTNEMap :-> TTNEMap)+    (<!>)+    (<!>)