Hello community,

here is the log from the commit of package ghc-mono-traversable for 
openSUSE:Factory checked in at 2018-12-28 12:35:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-mono-traversable (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-mono-traversable.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-mono-traversable"

Fri Dec 28 12:35:12 2018 rev:16 rq:661497 version:1.0.10.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/ghc-mono-traversable/ghc-mono-traversable.changes    
    2018-10-25 08:27:33.155768615 +0200
+++ 
/work/SRC/openSUSE:Factory/.ghc-mono-traversable.new.28833/ghc-mono-traversable.changes
     2018-12-28 12:35:25.767958970 +0100
@@ -1,0 +2,10 @@
+Fri Dec 21 03:02:43 UTC 2018 - [email protected]
+
+- Update mono-traversable to version 1.0.10.0.
+  ## 1.0.10.0
+
+  * Make index work on negative indices
+    [#172](https://github.com/snoyberg/mono-traversable/issues/172)
+    [#114](https://github.com/snoyberg/mono-traversable/issues/114)
+
+-------------------------------------------------------------------

Old:
----
  mono-traversable-1.0.9.0.tar.gz

New:
----
  mono-traversable-1.0.10.0.tar.gz
  mono-traversable.cabal

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-mono-traversable.spec ++++++
--- /var/tmp/diff_new_pack.dwVtcY/_old  2018-12-28 12:35:26.371958548 +0100
+++ /var/tmp/diff_new_pack.dwVtcY/_new  2018-12-28 12:35:26.371958548 +0100
@@ -19,13 +19,14 @@
 %global pkg_name mono-traversable
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        1.0.9.0
+Version:        1.0.10.0
 Release:        0
 Summary:        Type classes for mapping, folding, and traversing monomorphic 
containers
 License:        MIT
 Group:          Development/Libraries/Haskell
 URL:            https://hackage.haskell.org/package/%{pkg_name}
 Source0:        
https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
+Source1:        
https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal#/%{pkg_name}.cabal
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-bytestring-devel
 BuildRequires:  ghc-containers-devel
@@ -62,6 +63,7 @@
 
 %prep
 %setup -q -n %{pkg_name}-%{version}
+cp -p %{SOURCE1} %{pkg_name}.cabal
 
 %build
 %ghc_lib_build

++++++ mono-traversable-1.0.9.0.tar.gz -> mono-traversable-1.0.10.0.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mono-traversable-1.0.9.0/ChangeLog.md 
new/mono-traversable-1.0.10.0/ChangeLog.md
--- old/mono-traversable-1.0.9.0/ChangeLog.md   2018-08-02 07:29:05.000000000 
+0200
+++ new/mono-traversable-1.0.10.0/ChangeLog.md  2018-12-20 06:25:46.000000000 
+0100
@@ -1,3 +1,9 @@
+## 1.0.10.0
+
+* Make index work on negative indices
+  [#172](https://github.com/snoyberg/mono-traversable/issues/172)
+  [#114](https://github.com/snoyberg/mono-traversable/issues/114)
+
 ## 1.0.9.0
 
 * Added `filterMap` to `Data.Containers`
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mono-traversable-1.0.9.0/mono-traversable.cabal 
new/mono-traversable-1.0.10.0/mono-traversable.cabal
--- old/mono-traversable-1.0.9.0/mono-traversable.cabal 2018-08-02 
07:29:33.000000000 +0200
+++ new/mono-traversable-1.0.10.0/mono-traversable.cabal        2018-12-20 
06:25:47.000000000 +0100
@@ -1,13 +1,13 @@
-cabal-version: >= 1.10
+cabal-version: 1.12
 
--- This file has been generated from package.yaml by hpack version 0.29.0.
+-- This file has been generated from package.yaml by hpack version 0.30.0.
 --
 -- see: https://github.com/sol/hpack
 --
--- hash: 6bcc1ed72e15c5adb841eb249f106e08f6823d8dfb67f86e62a140618a3b93c0
+-- hash: dd6993a12a11dc33b47bd2f3d81ac5ab62e3168ad8a01582458b74b64f971031
 
 name:           mono-traversable
-version:        1.0.9.0
+version:        1.0.10.0
 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
@@ -19,8 +19,8 @@
 license-file:   LICENSE
 build-type:     Simple
 extra-source-files:
-    ChangeLog.md
     README.md
+    ChangeLog.md
 
 source-repository head
   type: git
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mono-traversable-1.0.9.0/src/Data/MonoTraversable.hs 
new/mono-traversable-1.0.10.0/src/Data/MonoTraversable.hs
--- old/mono-traversable-1.0.9.0/src/Data/MonoTraversable.hs    2018-08-02 
07:29:05.000000000 +0200
+++ new/mono-traversable-1.0.10.0/src/Data/MonoTraversable.hs   2018-10-04 
15:18:41.000000000 +0200
@@ -331,7 +331,7 @@
     -- Note: this is a partial function. On an empty 'MonoFoldable', it will
     -- throw an exception.
     --
-    -- /See 'Data.NonNull.ofoldr1Ex' from "Data.NonNull" for a total version 
of this function./
+    -- /See 'Data.NonNull.ofoldr1' from "Data.NonNull" for a total version of 
this function./
     ofoldr1Ex :: (Element mono -> Element mono -> Element mono) -> mono -> 
Element mono
     default ofoldr1Ex :: (t a ~ mono, a ~ Element (t a), F.Foldable t)
                       => (Element mono -> Element mono -> Element mono) -> 
mono -> Element mono
@@ -344,7 +344,7 @@
     -- Note: this is a partial function. On an empty 'MonoFoldable', it will
     -- throw an exception.
     --
-    -- /See 'Data.NonNull.ofoldl1Ex'' from "Data.NonNull" for a total version 
of this function./
+    -- /See 'Data.NonNull.ofoldl1'' from "Data.NonNull" for a total version of 
this function./
     ofoldl1Ex' :: (Element mono -> Element mono -> Element mono) -> mono -> 
Element mono
     default ofoldl1Ex' :: (t a ~ mono, a ~ Element (t a), F.Foldable t)
                        => (Element mono -> Element mono -> Element mono) -> 
mono -> Element mono
@@ -366,7 +366,7 @@
     -- Note: this is a partial function. On an empty 'MonoFoldable', it will
     -- throw an exception.
     --
-    -- /See 'Data.NonNull.last from "Data.NonNull" for a total version of this 
function./
+    -- /See 'Data.NonNull.last' from "Data.NonNull" for a total version of 
this function./
     lastEx :: mono -> Element mono
     lastEx = ofoldl1Ex' (flip const)
     {-# INLINE lastEx #-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mono-traversable-1.0.9.0/src/Data/NonNull.hs 
new/mono-traversable-1.0.10.0/src/Data/NonNull.hs
--- old/mono-traversable-1.0.9.0/src/Data/NonNull.hs    2018-02-02 
14:46:36.000000000 +0100
+++ new/mono-traversable-1.0.10.0/src/Data/NonNull.hs   2018-10-04 
15:18:41.000000000 +0200
@@ -162,17 +162,17 @@
   fromMaybe (error "Data.NonNull.splitFirst: data structure is null, it should 
be non-null")
           $ uncons (toNullable xs)
 
--- | Equivalent to @"Data.Sequence".'Data.Sequence.filter'@,
+-- | Equivalent to @"Data.Sequences".'Data.Sequences.filter'@,
 -- but works on non-nullable sequences.
 nfilter :: IsSequence seq => (Element seq -> Bool) -> NonNull seq -> seq
 nfilter f = filter f . toNullable
 
--- | Equivalent to @"Data.Sequence".'Data.Sequence.filterM'@,
+-- | Equivalent to @"Data.Sequences".'Data.Sequences.filterM'@,
 -- but works on non-nullable sequences.
 nfilterM :: (Monad m, IsSequence seq) => (Element seq -> m Bool) -> NonNull 
seq -> m seq
 nfilterM f = filterM f . toNullable
 
--- | Equivalent to @"Data.Sequence".'Data.Sequence.replicate'@
+-- | Equivalent to @"Data.Sequences".'Data.Sequences.replicate'@
 --
 -- @i@ must be @> 0@
 --
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mono-traversable-1.0.9.0/src/Data/Sequences.hs 
new/mono-traversable-1.0.10.0/src/Data/Sequences.hs
--- old/mono-traversable-1.0.9.0/src/Data/Sequences.hs  2018-02-02 
14:46:36.000000000 +0100
+++ new/mono-traversable-1.0.10.0/src/Data/Sequences.hs 2018-12-20 
06:25:46.000000000 +0100
@@ -15,7 +15,7 @@
 import qualified Data.List as List
 import qualified Data.List.Split as List
 import qualified Control.Monad (filterM, replicateM)
-import Prelude (Bool (..), Monad (..), Maybe (..), Ordering (..), Ord (..), Eq 
(..), Functor (..), fromIntegral, otherwise, (-), fst, snd, Integral, ($), 
flip, maybe, error)
+import Prelude (Bool (..), Monad (..), Maybe (..), Ordering (..), Ord (..), Eq 
(..), Functor (..), fromIntegral, otherwise, (-), fst, snd, Integral, ($), 
flip, maybe, error, (||))
 import Data.Char (Char, isSpace)
 import qualified Data.ByteString as S
 import qualified Data.ByteString.Lazy as L
@@ -447,7 +447,9 @@
     -- 'Nothing'
     -- @
     index :: seq -> Index seq -> Maybe (Element seq)
-    index seq' idx = headMay (drop idx seq')
+    index seq' idx
+        | idx < 0 = Nothing
+        | otherwise = headMay (drop idx seq')
 
     -- | __Unsafe__
     --
@@ -702,8 +704,8 @@
     {-# INLINE splitWhen #-}
 
     index bs i
-        | i >= S.length bs = Nothing
-        | otherwise = Just (S.index bs i)
+        | i < 0 || i >= S.length bs = Nothing
+        | otherwise = Just (SU.unsafeIndex bs i)
     indexEx = S.index
     unsafeIndex = SU.unsafeIndex
     {-# INLINE index #-}
@@ -766,7 +768,7 @@
     {-# INLINE splitWhen #-}
 
     index t i
-        | i >= T.length t = Nothing
+        | i < 0 || i >= T.length t = Nothing
         | otherwise = Just (T.index t i)
     indexEx = T.index
     unsafeIndex = T.index
@@ -952,9 +954,7 @@
     {-# INLINE tailEx #-}
     {-# INLINE initEx #-}
 
-    index seq' i
-        | i >= Seq.length seq' = Nothing
-        | otherwise = Just (Seq.index seq' i)
+    index = (Seq.!?)
     indexEx = Seq.index
     unsafeIndex = Seq.index
     {-# INLINE index #-}
@@ -1027,9 +1027,7 @@
     {-# INLINE unsafeTail #-}
     {-# INLINE unsafeInit #-}
 
-    index v i
-        | i >= V.length v = Nothing
-        | otherwise = Just (v V.! i)
+    index = (V.!?)
     indexEx = (V.!)
     unsafeIndex = V.unsafeIndex
     {-# INLINE index #-}
@@ -1102,9 +1100,7 @@
     {-# INLINE unsafeTail #-}
     {-# INLINE unsafeInit #-}
 
-    index v i
-        | i >= U.length v = Nothing
-        | otherwise = Just (v U.! i)
+    index = (U.!?)
     indexEx = (U.!)
     unsafeIndex = U.unsafeIndex
     {-# INLINE index #-}
@@ -1177,9 +1173,7 @@
     {-# INLINE unsafeTail #-}
     {-# INLINE unsafeInit #-}
 
-    index v i
-        | i >= VS.length v = Nothing
-        | otherwise = Just (v VS.! i)
+    index = (VS.!?)
     indexEx = (VS.!)
     unsafeIndex = VS.unsafeIndex
     {-# INLINE index #-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mono-traversable-1.0.9.0/test/Spec.hs 
new/mono-traversable-1.0.10.0/test/Spec.hs
--- old/mono-traversable-1.0.9.0/test/Spec.hs   2018-02-02 14:46:36.000000000 
+0100
+++ new/mono-traversable-1.0.10.0/test/Spec.hs  2018-12-20 06:25:46.000000000 
+0100
@@ -154,7 +154,7 @@
 
     describe "index" $ do
         let test name dummy = prop name $
-              \(NonNegative i') (QCM.NonEmpty xs) ->
+              \i' (QCM.NonEmpty xs) ->
                 let seq' = fromListAs xs dummy
                     mx   = index xs (fromIntegral i)
                     i    = fromIntegral (i' :: Int)

++++++ mono-traversable.cabal ++++++
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.30.0.
--
-- see: https://github.com/sol/hpack
--
-- hash: dd6993a12a11dc33b47bd2f3d81ac5ab62e3168ad8a01582458b74b64f971031

name:           mono-traversable
version:        1.0.10.0
x-revision: 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
homepage:       https://github.com/snoyberg/mono-traversable#readme
bug-reports:    https://github.com/snoyberg/mono-traversable/issues
author:         Michael Snoyman, John Wiegley, Greg Weber
maintainer:     [email protected]
license:        MIT
license-file:   LICENSE
build-type:     Simple
extra-source-files:
    README.md
    ChangeLog.md

source-repository head
  type: git
  location: https://github.com/snoyberg/mono-traversable

library
  hs-source-dirs:
      src
  ghc-options: -Wall
  build-depends:
      base >=4.9 && <5
    , bytestring >=0.9
    , containers >=0.5.8
    , hashable
    , split >=0.2
    , text >=0.11
    , transformers >=0.3
    , unordered-containers >=0.2
    , vector >=0.10
    , vector-algorithms >=0.6
  if impl(ghc <8.0)
    build-depends:
        semigroups >=0.10
  exposed-modules:
      Data.Containers
      Data.MonoTraversable
      Data.MonoTraversable.Unprefixed
      Data.NonNull
      Data.Sequences
  other-modules:
      Paths_mono_traversable
  default-language: Haskell2010

test-suite test
  type: exitcode-stdio-1.0
  main-is: main.hs
  hs-source-dirs:
      test
  ghc-options: -O0
  build-depends:
      HUnit
    , QuickCheck
    , base
    , bytestring
    , containers
    , foldl
    , hspec
    , mono-traversable
    , semigroups
    , text
    , transformers
    , unordered-containers
    , vector
  other-modules:
      Spec
      Paths_mono_traversable
  default-language: Haskell2010

benchmark sorting
  type: exitcode-stdio-1.0
  main-is: sorting.hs
  hs-source-dirs:
      bench
  ghc-options: -Wall -O2
  build-depends:
      base
    , gauge
    , mono-traversable
    , mwc-random
    , vector
  other-modules:
      Paths_mono_traversable
  default-language: Haskell2010

Reply via email to