Hello community, here is the log from the commit of package ghc-base-compat for openSUSE:Factory checked in at 2017-05-06 18:28:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-base-compat (Old) and /work/SRC/openSUSE:Factory/.ghc-base-compat.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "ghc-base-compat" Sat May 6 18:28:08 2017 rev:6 rq:491456 version:0.9.3 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-base-compat/ghc-base-compat.changes 2017-04-14 13:37:18.634872145 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-base-compat.new/ghc-base-compat.changes 2017-05-06 18:28:10.995657494 +0200 @@ -1,0 +2,5 @@ +Wed Apr 19 13:32:16 UTC 2017 - psimons@suse.com + +- Update to version 0.9.3 with cabal2obs. + +------------------------------------------------------------------- Old: ---- base-compat-0.9.2.tar.gz New: ---- base-compat-0.9.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-base-compat.spec ++++++ --- /var/tmp/diff_new_pack.7pBYXa/_old 2017-05-06 18:28:11.751550834 +0200 +++ /var/tmp/diff_new_pack.7pBYXa/_new 2017-05-06 18:28:11.751550834 +0200 @@ -19,7 +19,7 @@ %global pkg_name base-compat %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.9.2 +Version: 0.9.3 Release: 0 Summary: A compatibility layer for base License: MIT ++++++ base-compat-0.9.2.tar.gz -> base-compat-0.9.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/base-compat-0.9.2/CHANGES.markdown new/base-compat-0.9.3/CHANGES.markdown --- old/base-compat-0.9.2/CHANGES.markdown 2017-03-11 22:21:23.000000000 +0100 +++ new/base-compat-0.9.3/CHANGES.markdown 2017-04-10 15:38:30.000000000 +0200 @@ -1,3 +1,13 @@ +## Changes in 0.9.3 [2017.04.10] + - Sync with `base-4.10`/GHC 8.2 + - Backport `fromLeft`/`fromRight` to `Data.Either.Compat` + - Backport implementations of `maximumBy`/`minimumBy` which use constant stack + space to `Data.Foldable.Compat` + - Backport `asProxyTypeOf` with a generalized type signature to + `Data.Proxy.Compat` + - Backport `gcoerceWith` to `Data.Type.Coercion.Compat` + - Backport `plusForeignPtr` to `Foreign.ForeignPtr.Compat` + ## Changes in 0.9.2 - Allow building on the HaLVM diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/base-compat-0.9.2/README.markdown new/base-compat-0.9.3/README.markdown --- old/base-compat-0.9.2/README.markdown 2017-03-11 22:21:23.000000000 +0100 +++ new/base-compat-0.9.3/README.markdown 2017-04-10 15:38:30.000000000 +0200 @@ -114,23 +114,27 @@ * Added `bitDefault`, `testBitDefault`, and `popCountDefault` to `Data.Bits.Compat` * Added `toIntegralSized` to `Data.Bits.Compat` (if using `base-4.7`) * Added `bool` function to `Data.Bool.Compat` - * Added `isLeft` and `isRight` to `Data.Either.Compat` + * Added `isLeft`, `isRight`, `fromLeft`, and `fromRight` to `Data.Either.Compat` * Added `forkFinally` to `Control.Concurrent.Compat` * Added `withMVarMasked` function to `Control.Concurrent.MVar.Compat` * Added `(<$!>)` function to `Control.Monad.Compat` * Weakened `RealFloat` constraints on `realPart`, `imagPart`, `conjugate`, `mkPolar`, and `cis` in `Data.Complex.Compat` + * Added more efficient `maximumBy`/`minimumBy` to `Data.Foldable.Compat` * Added `($>)` and `void` functions to `Data.Functor.Compat` * `(&)` function to `Data.Function.Compat` * `($>)` and `void` functions to `Data.Functor.Compat` * `modifyIORef'`, `atomicModifyIORef'` and `atomicWriteIORef` to `Data.IORef.Compat` * `dropWhileEnd`, `isSubsequenceOf`, `sortOn`, and `uncons` functions to `Data.List.Compat` * Correct versions of `nub`, `nubBy`, `union`, and `unionBy` to `Data.List.Compat` + * `asProxyTypeOf` with a generalized type signature to `Data.Proxy.Compat` * `modifySTRef'` to `Data.STRef.Compat` * `String`, `lines`, `words`, `unlines`, and `unwords` to `Data.String.Compat` + * `gcoerceWith` to `Data.Type.Coercion.Compat` * `makeVersion` function to `Data.Version.Compat` * `traceId`, `traceShowId`, `traceM`, and `traceShowM` functions to `Debug.Trace.Compat` * `byteSwap16`, `byteSwap32`, and `byteSwap64` to `Data.Word.Compat` + * `plusForeignPtr` to `Foreign.ForeignPtr.Compat` * `calloc` and `callocBytes` functions to `Foreign.Marshal.Alloc.Compat` * `callocArray` and `callocArray0` functions to `Foreign.Marshal.Array.Compat` * `fillBytes` to `Foreign.Marshal.Utils.Compat` @@ -192,8 +196,12 @@ compatibility packages on Hackage. Here is a list of such packages: * [`bifunctors`](http://hackage.haskell.org/package/bifunctors) - for the [`Bifunctor`](http://hackage.haskell.org/package/base-4.8.0.0/docs/Data-Bifunctor.html#t:B...) - type class, introduced in `base-4.8.0.0` + for: + * The [`Bifunctor`](http://hackage.haskell.org/package/base-4.8.0.0/docs/Data-Bifunctor.html#t:B...) + type class, introduced in `base-4.8.0.0` + * The [`Bifoldable`](http://hackage.haskell.org/package/base-4.10.0.0/docs/Data-Bifoldable.html#t...) + and [`Bitraversable`](http://hackage.haskell.org/package/base-4.10.0.0/docs/Data-Bitraversable.htm...) + type classes, introduced in `base-4.10.0.0` * [`fail`](http://hackage.haskell.org/package/fail) for the [`MonadFail`](http://hackage.haskell.org/package/base-4.9.0.0/docs/Control-Monad-Fail.html...) type class, introduced in `base-4.9.0.0` @@ -245,6 +253,7 @@ ## Supported versions of GHC/`base` + * `ghc-8.2.1` / `base-4.10.0.0` * `ghc-8.0.2` / `base-4.9.1.0` * `ghc-8.0.1` / `base-4.9.0.0` * `ghc-7.10.3` / `base-4.8.2.0` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/base-compat-0.9.2/base-compat.cabal new/base-compat-0.9.3/base-compat.cabal --- old/base-compat-0.9.2/base-compat.cabal 2017-03-11 22:21:23.000000000 +0100 +++ new/base-compat-0.9.3/base-compat.cabal 2017-04-10 15:38:30.000000000 +0200 @@ -1,5 +1,5 @@ name: base-compat -version: 0.9.2 +version: 0.9.3 license: MIT license-file: LICENSE copyright: (c) 2012-2017 Simon Hengel, @@ -39,6 +39,7 @@ , GHC == 7.8.1, GHC == 7.8.2, GHC == 7.8.3, GHC == 7.8.4 , GHC == 7.10.1, GHC == 7.10.2, GHC == 7.10.3 , GHC == 8.0.1, GHC == 8.0.2 + , GHC == 8.2.1 extra-source-files: CHANGES.markdown, README.markdown source-repository head @@ -75,13 +76,16 @@ Data.IORef.Compat Data.List.Compat Data.Monoid.Compat + Data.Proxy.Compat Data.Ratio.Compat Data.STRef.Compat Data.String.Compat + Data.Type.Coercion.Compat Data.Version.Compat Data.Word.Compat Debug.Trace.Compat Foreign.Compat + Foreign.ForeignPtr.Compat Foreign.ForeignPtr.Safe.Compat Foreign.ForeignPtr.Unsafe.Compat Foreign.Marshal.Alloc.Compat @@ -111,6 +115,7 @@ Data.Bits.CompatSpec Data.Bool.CompatSpec Data.Either.CompatSpec + Data.Foldable.CompatSpec Data.Function.CompatSpec Data.Functor.CompatSpec Data.IORef.CompatSpec diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/base-compat-0.9.2/src/Data/Either/Compat.hs new/base-compat-0.9.3/src/Data/Either/Compat.hs --- old/base-compat-0.9.2/src/Data/Either/Compat.hs 2017-03-11 22:21:23.000000000 +0100 +++ new/base-compat-0.9.3/src/Data/Either/Compat.hs 2017-04-10 15:38:30.000000000 +0200 @@ -3,6 +3,8 @@ module Base , isLeft , isRight +, fromLeft +, fromRight ) where import Data.Either as Base @@ -23,3 +25,39 @@ isRight (Left _) = False isRight (Right _) = True #endif + +#if !(MIN_VERSION_base(4,10,0)) +-- | Return the contents of a 'Left'-value or a default value otherwise. +-- +-- /Since: 4.10.0.0/ +-- +-- ==== __Examples__ +-- +-- Basic usage: +-- +-- >>> fromLeft 1 (Left 3) +-- 3 +-- >>> fromLeft 1 (Right "foo") +-- 1 +-- +fromLeft :: a -> Either a b -> a +fromLeft _ (Left a) = a +fromLeft a _ = a + +-- | Return the contents of a 'Right'-value or a default value otherwise. +-- +-- /Since: 4.10.0.0/ +-- +-- ==== __Examples__ +-- +-- Basic usage: +-- +-- >>> fromRight 1 (Right 3) +-- 3 +-- >>> fromRight 1 (Left "foo") +-- 1 +-- +fromRight :: b -> Either a b -> b +fromRight _ (Right b) = b +fromRight b _ = b +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/base-compat-0.9.2/src/Data/Foldable/Compat.hs new/base-compat-0.9.3/src/Data/Foldable/Compat.hs --- old/base-compat-0.9.2/src/Data/Foldable/Compat.hs 2017-03-11 22:21:23.000000000 +0100 +++ new/base-compat-0.9.3/src/Data/Foldable/Compat.hs 2017-04-10 15:38:30.000000000 +0200 @@ -5,9 +5,18 @@ , length , null #endif +#if !(MIN_VERSION_base(4,10,0)) +, maximumBy +, minimumBy +#endif ) where +#if MIN_VERSION_base(4,10,0) import Data.Foldable as Base +#else +import Data.Foldable as Base hiding (maximumBy, minimumBy) +import Prelude (Ordering(..)) +#endif #if !(MIN_VERSION_base(4,8,0)) import Prelude (Bool(..), Int, (+)) @@ -24,3 +33,21 @@ length :: Foldable t => t a -> Int length = foldl' (\c _ -> c+1) 0 #endif + +#if !(MIN_VERSION_base(4,10,0)) +-- | The largest element of a non-empty structure with respect to the +-- given comparison function. +maximumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a +maximumBy cmp = foldl1 max' + where max' x y = case cmp x y of + GT -> x + _ -> y + +-- | The least element of a non-empty structure with respect to the +-- given comparison function. +minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a +minimumBy cmp = foldl1 min' + where min' x y = case cmp x y of + GT -> y + _ -> x +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/base-compat-0.9.2/src/Data/Proxy/Compat.hs new/base-compat-0.9.3/src/Data/Proxy/Compat.hs --- old/base-compat-0.9.2/src/Data/Proxy/Compat.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/base-compat-0.9.3/src/Data/Proxy/Compat.hs 2017-04-10 15:38:30.000000000 +0200 @@ -0,0 +1,27 @@ +{-# LANGUAGE CPP, NoImplicitPrelude #-} +module Data.Proxy.Compat ( +#if MIN_VERSION_base(4,7,0) + module Base, +#endif + asProxyTypeOf +) where + +#if MIN_VERSION_base(4,7,0) +# if MIN_VERSION_base(4,10,0) +import Data.Proxy as Base +# else +import Data.Proxy as Base hiding (asProxyTypeOf) +# endif +#endif + +#if !(MIN_VERSION_base(4,10,0)) +import Prelude (const) + +-- | 'asProxyTypeOf' is a type-restricted version of 'const'. +-- It is usually used as an infix operator, and its typing forces its first +-- argument (which is usually overloaded) to have the same type as the tag +-- of the second. +asProxyTypeOf :: a -> proxy a -> a +asProxyTypeOf = const +{-# INLINE asProxyTypeOf #-} +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/base-compat-0.9.2/src/Data/Type/Coercion/Compat.hs new/base-compat-0.9.3/src/Data/Type/Coercion/Compat.hs --- old/base-compat-0.9.2/src/Data/Type/Coercion/Compat.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/base-compat-0.9.3/src/Data/Type/Coercion/Compat.hs 2017-04-10 15:38:30.000000000 +0200 @@ -0,0 +1,22 @@ +{-# LANGUAGE CPP, NoImplicitPrelude #-} +{-# LANGUAGE RankNTypes #-} +module Data.Type.Coercion.Compat ( +#if MIN_VERSION_base(4,7,0) + module Base +, gcoerceWith +#endif +) where + +#if MIN_VERSION_base(4,7,0) +import Data.Type.Coercion as Base + +# if !(MIN_VERSION_base(4,10,0)) +import Data.Coerce (Coercible) + +-- | Generalized form of type-safe cast using representational equality +-- +-- /Since: 4.10.0.0/ +gcoerceWith :: Coercion a b -> (Coercible a b => r) -> r +gcoerceWith Coercion x = x +# endif +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/base-compat-0.9.2/src/Foreign/ForeignPtr/Compat.hs new/base-compat-0.9.3/src/Foreign/ForeignPtr/Compat.hs --- old/base-compat-0.9.2/src/Foreign/ForeignPtr/Compat.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/base-compat-0.9.3/src/Foreign/ForeignPtr/Compat.hs 2017-04-10 15:38:30.000000000 +0200 @@ -0,0 +1,27 @@ +{-# LANGUAGE CPP, NoImplicitPrelude #-} +{-# LANGUAGE MagicHash #-} +module Foreign.ForeignPtr.Compat ( + module Base +, plusForeignPtr +) where + +import Foreign.ForeignPtr as Base + +#if !(MIN_VERSION_base(4,10,0)) +import GHC.Exts (Int(..), plusAddr#) +import GHC.ForeignPtr (ForeignPtr(..)) + +plusForeignPtr :: ForeignPtr a -> Int -> ForeignPtr b +-- ^Advances the given address by the given offset in bytes. +-- +-- The new 'ForeignPtr' shares the finalizer of the original, +-- equivalent from a finalization standpoint to just creating another +-- reference to the original. That is, the finalizer will not be +-- called before the new 'ForeignPtr' is unreachable, nor will it be +-- called an additional time due to this call, and the finalizer will +-- be called with the same address that it would have had this call +-- not happened, *not* the new address. +-- +-- /Since: 4.10.0.0/ +plusForeignPtr (ForeignPtr addr c) (I# d) = ForeignPtr (plusAddr# addr d) c +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/base-compat-0.9.2/test/Data/Foldable/CompatSpec.hs new/base-compat-0.9.3/test/Data/Foldable/CompatSpec.hs --- old/base-compat-0.9.2/test/Data/Foldable/CompatSpec.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/base-compat-0.9.3/test/Data/Foldable/CompatSpec.hs 2017-04-10 15:38:30.000000000 +0200 @@ -0,0 +1,13 @@ +module Data.Foldable.CompatSpec (main, spec) where + +import Test.Hspec +import Data.Foldable.Compat + +main :: IO () +main = hspec spec + +spec :: Spec +spec = do + describe "maximumBy" $ do + it "runs in constant space" $ do + maximumBy compare [1..10000] `shouldBe` (10000 :: Int)