Hello community, here is the log from the commit of package ghc-mono-traversable for openSUSE:Factory checked in at 2020-01-03 17:35:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-mono-traversable (Old) and /work/SRC/openSUSE:Factory/.ghc-mono-traversable.new.6675 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-mono-traversable" Fri Jan 3 17:35:30 2020 rev:21 rq:760289 version:1.0.15.1 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-mono-traversable/ghc-mono-traversable.changes 2019-12-27 13:55:32.520721318 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-mono-traversable.new.6675/ghc-mono-traversable.changes 2020-01-03 17:35:42.103256159 +0100 @@ -1,0 +2,19 @@ +Sun Dec 29 10:27:23 UTC 2019 - psim...@suse.com + +- Update mono-traversable to version 1.0.15.1. + # ChangeLog for mono-traversable + + ## 1.0.15.1 + + * Remove whitespace after `@` in as-patterns for GHC HEAD [#186](https://github.com/snoyberg/mono-traversable/pull/186) + + ## 1.0.15.0 + + * Added `toNonEmpty` to `Data.NonNull` + [#185](https://github.com/snoyberg/mono-traversable/pull/185) + + ## 1.0.14.0 + * Added `WrappedMono` to `Data.MonoTraversable` + [#182](https://github.com/snoyberg/mono-traversable/pull/182) + +------------------------------------------------------------------- Old: ---- mono-traversable-1.0.13.0.tar.gz New: ---- mono-traversable-1.0.15.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-mono-traversable.spec ++++++ --- /var/tmp/diff_new_pack.o1SYJ4/_old 2020-01-03 17:35:43.631256943 +0100 +++ /var/tmp/diff_new_pack.o1SYJ4/_new 2020-01-03 17:35:43.655256956 +0100 @@ -19,7 +19,7 @@ %global pkg_name mono-traversable %bcond_with tests Name: ghc-%{pkg_name} -Version: 1.0.13.0 +Version: 1.0.15.1 Release: 0 Summary: Type classes for mapping, folding, and traversing monomorphic containers License: MIT ++++++ mono-traversable-1.0.13.0.tar.gz -> mono-traversable-1.0.15.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mono-traversable-1.0.13.0/ChangeLog.md new/mono-traversable-1.0.15.1/ChangeLog.md --- old/mono-traversable-1.0.13.0/ChangeLog.md 2019-10-03 14:47:12.000000000 +0200 +++ new/mono-traversable-1.0.15.1/ChangeLog.md 2019-12-25 06:14:05.000000000 +0100 @@ -1,3 +1,18 @@ +# ChangeLog for mono-traversable + +## 1.0.15.1 + +* Remove whitespace after `@` in as-patterns for GHC HEAD [#186](https://github.com/snoyberg/mono-traversable/pull/186) + +## 1.0.15.0 + +* Added `toNonEmpty` to `Data.NonNull` + [#185](https://github.com/snoyberg/mono-traversable/pull/185) + +## 1.0.14.0 +* Added `WrappedMono` to `Data.MonoTraversable` + [#182](https://github.com/snoyberg/mono-traversable/pull/182) + ## 1.0.13.0 * Added `WrappedPoly` to `Data.MonoTraversable` [#180](https://github.com/snoyberg/mono-traversable/pull/180) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mono-traversable-1.0.13.0/README.md new/mono-traversable-1.0.15.1/README.md --- old/mono-traversable-1.0.13.0/README.md 2019-08-14 05:21:19.000000000 +0200 +++ new/mono-traversable-1.0.15.1/README.md 2019-12-25 06:12:47.000000000 +0100 @@ -155,7 +155,7 @@ * IsMap: unifies operations across different `Map`s * MonoZip: zip operations on MonoFunctors. -Note that because `Set` and `Map` are not a Functor (and therefore not MonoFoldable), one must use `mapFromList`, `mapToList`, `setFromList`, and `setToList`. +Note that because `Set` is not a Functor (and therefore neither a MonoFunctor nor MonoTraversable), one must use `setFromList` and `setToList` to `omap` or `otraverse` over the elements of a `Set`. ### Sequences diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mono-traversable-1.0.13.0/mono-traversable.cabal new/mono-traversable-1.0.15.1/mono-traversable.cabal --- old/mono-traversable-1.0.13.0/mono-traversable.cabal 2019-10-03 14:47:17.000000000 +0200 +++ new/mono-traversable-1.0.15.1/mono-traversable.cabal 2019-12-25 06:14:22.000000000 +0100 @@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack -- --- hash: f15c018a84778989ad8a6b3271167acba04984c689d9620523b6855ce2ec78f1 +-- hash: b2ac08c2845dd12213a3bc3c6e01f805bb98a7693a588b0ae313ceadcb5ca592 name: mono-traversable -version: 1.0.13.0 +version: 1.0.15.1 synopsis: Type classes for mapping, folding, and traversing monomorphic containers description: Please see the README at <https://www.stackage.org/package/mono-traversable> category: Data diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mono-traversable-1.0.13.0/src/Data/MonoTraversable.hs new/mono-traversable-1.0.15.1/src/Data/MonoTraversable.hs --- old/mono-traversable-1.0.13.0/src/Data/MonoTraversable.hs 2019-10-03 14:47:12.000000000 +0200 +++ new/mono-traversable-1.0.15.1/src/Data/MonoTraversable.hs 2019-12-25 06:12:47.000000000 +0100 @@ -4,6 +4,7 @@ {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE GADTs #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} @@ -1313,7 +1314,7 @@ instance MonoComonad (ViewL a) where oextract ~(x :< _) = x {-# INLINE oextract #-} - oextend f w@ ~(_ :< xxs) = + oextend f w@(~(_ :< xxs)) = f w :< case Seq.viewl xxs of EmptyL -> Seq.empty xs -> case oextend f xs of @@ -1323,7 +1324,7 @@ instance MonoComonad (ViewR a) where oextract ~(_ :> x) = x {-# INLINE oextract #-} - oextend f w@ ~(xxs :> _) = + oextend f w@(~(xxs :> _)) = (case Seq.viewr xxs of EmptyR -> Seq.empty xs -> case oextend f xs of @@ -1408,3 +1409,103 @@ instance F.Foldable f => MonoFoldable (WrappedPoly f a) instance Functor f => MonoFunctor (WrappedPoly f a) instance Applicative f => MonoPointed (WrappedPoly f a) + + +-- | Provides a `F.Foldable` for an arbitrary `MonoFoldable`. +-- +-- @since 1.0.14.0 +data WrappedMono mono a where + WrappedMono :: Element mono ~ a => mono -> WrappedMono mono a + +-- | Unwraps a `WrappedMono`. +-- +-- @since 1.0.14.0 +unwrapMono :: WrappedMono mono a -> mono +unwrapMono (WrappedMono mono) = mono +{-# INLINE unwrapMono #-} + +type instance Element (WrappedMono mono a) = Element mono + +instance MonoFoldable mono => MonoFoldable (WrappedMono mono a) where + ofoldMap f = ofoldMap f . unwrapMono + {-# INLINE ofoldMap #-} + ofoldr f z = ofoldr f z . unwrapMono + {-# INLINE ofoldr #-} + ofoldl' f z = ofoldl' f z . unwrapMono + {-# INLINE ofoldl' #-} + otoList = otoList . unwrapMono + {-# INLINE otoList #-} + oall f = oall f . unwrapMono + {-# INLINE oall #-} + oany f = oany f . unwrapMono + {-# INLINE oany #-} + onull = onull . unwrapMono + {-# INLINE onull #-} + olength = olength . unwrapMono + {-# INLINE olength #-} + olength64 = olength64 . unwrapMono + {-# INLINE olength64 #-} + ocompareLength mono i = ocompareLength (unwrapMono mono) i + {-# INLINE ocompareLength #-} + otraverse_ f = otraverse_ f . unwrapMono + {-# INLINE otraverse_ #-} + ofor_ mono f = ofor_ (unwrapMono mono) f + {-# INLINE ofor_ #-} + omapM_ f = omapM_ f . unwrapMono + {-# INLINE omapM_ #-} + oforM_ mono f = oforM_ (unwrapMono mono) f + {-# INLINE oforM_ #-} + ofoldlM f z = ofoldlM f z . unwrapMono + {-# INLINE ofoldlM #-} + ofoldMap1Ex f = ofoldMap1Ex f . unwrapMono + {-# INLINE ofoldMap1Ex #-} + ofoldr1Ex f = ofoldr1Ex f . unwrapMono + {-# INLINE ofoldr1Ex #-} + ofoldl1Ex' f = ofoldl1Ex' f . unwrapMono + {-# INLINE ofoldl1Ex' #-} + headEx = headEx . unwrapMono + {-# INLINE headEx #-} + lastEx = lastEx . unwrapMono + {-# INLINE lastEx #-} + unsafeHead = unsafeHead . unwrapMono + {-# INLINE unsafeHead #-} + unsafeLast = unsafeLast . unwrapMono + {-# INLINE unsafeLast #-} + maximumByEx f = maximumByEx f . unwrapMono + {-# INLINE maximumByEx #-} + minimumByEx f = minimumByEx f . unwrapMono + {-# INLINE minimumByEx #-} + oelem a = oelem a . unwrapMono + {-# INLINE oelem #-} + onotElem a = onotElem a . unwrapMono + {-# INLINE onotElem #-} + +instance MonoFunctor mono => MonoFunctor (WrappedMono mono a) where + omap f (WrappedMono mono) = WrappedMono (omap f mono) + {-# INLINE omap #-} + +instance (MonoPointed mono, Element mono ~ a) => MonoPointed (WrappedMono mono a) where + opoint a = WrappedMono (opoint a) + {-# INLINE opoint #-} + +instance MonoFoldable mono => F.Foldable (WrappedMono mono) where + foldr f zero (WrappedMono mono) = ofoldr f zero mono + {-# INLINE foldr #-} + foldMap f (WrappedMono mono) = ofoldMap f mono + {-# INLINE foldMap #-} + foldl' f z (WrappedMono mono) = ofoldl' f z mono + {-# INLINE foldl' #-} + foldl1 f (WrappedMono mono) = ofoldl1Ex' f mono + {-# INLINE foldl1 #-} + toList (WrappedMono mono) = otoList mono + {-# INLINE toList #-} + null (WrappedMono mono) = onull mono + {-# INLINE null #-} + length (WrappedMono mono) = olength mono + {-# INLINE length #-} + elem a (WrappedMono mono) = oelem a mono + {-# INLINE elem #-} + maximum (WrappedMono mono) = maximumEx mono + {-# INLINE maximum #-} + minimum (WrappedMono mono) = minimumEx mono + {-# INLINE minimum #-} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mono-traversable-1.0.13.0/src/Data/NonNull.hs new/mono-traversable-1.0.15.1/src/Data/NonNull.hs --- old/mono-traversable-1.0.13.0/src/Data/NonNull.hs 2019-08-14 05:21:19.000000000 +0200 +++ new/mono-traversable-1.0.15.1/src/Data/NonNull.hs 2019-12-25 06:12:47.000000000 +0100 @@ -16,6 +16,7 @@ , nonNull , toNullable , fromNonEmpty + , toNonEmpty , ncons , nuncons , splitFirst @@ -132,6 +133,12 @@ fromNonEmpty = impureNonNull . fromList . NE.toList {-# INLINE fromNonEmpty #-} +-- | __Safely__ convert from a 'NonNull' container to a 'NonEmpty' list. +-- +-- @since 1.0.15.0 +toNonEmpty :: MonoFoldable mono => NonNull mono -> NE.NonEmpty (Element mono) +toNonEmpty = NE.fromList . otoList + -- | Specializes 'fromNonEmpty' to lists only. toMinList :: NE.NonEmpty a -> NonNull [a] toMinList = fromNonEmpty diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mono-traversable-1.0.13.0/test/Spec.hs new/mono-traversable-1.0.15.1/test/Spec.hs --- old/mono-traversable-1.0.13.0/test/Spec.hs 2019-08-14 05:21:19.000000000 +0200 +++ new/mono-traversable-1.0.15.1/test/Spec.hs 2019-12-25 06:12:47.000000000 +0100 @@ -209,6 +209,9 @@ describe "fromNonEmpty" $ do prop "toMinList" $ \(NonEmpty' ne) -> (NE.toList ne :: [Int]) @?= NN.toNullable (NN.toMinList ne) + describe "toNonEmpty" $ do + it "converts nonnull to nonempty" $ do + NN.toNonEmpty (NN.impureNonNull [1,2,3]) @?= NE.fromList [1,2,3] describe "mapNonNull" $ do prop "mapNonNull id == id" $ \x xs ->