Hello community, here is the log from the commit of package ghc-base-orphans for openSUSE:Factory checked in at 2016-02-11 12:37:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-base-orphans (Old) and /work/SRC/openSUSE:Factory/.ghc-base-orphans.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-base-orphans" Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-base-orphans/ghc-base-orphans.changes 2016-01-28 17:24:30.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-base-orphans.new/ghc-base-orphans.changes 2016-02-11 12:37:24.000000000 +0100 @@ -1,0 +2,7 @@ +Tue Feb 2 22:17:33 UTC 2016 - [email protected] + +- update to 0.5.1 +* The Storable instances for Complex and Ratio are now exactly + as lazy as their counterparts in base + +------------------------------------------------------------------- Old: ---- base-orphans-0.5.0.tar.gz New: ---- base-orphans-0.5.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-base-orphans.spec ++++++ --- /var/tmp/diff_new_pack.Cusycf/_old 2016-02-11 12:37:25.000000000 +0100 +++ /var/tmp/diff_new_pack.Cusycf/_new 2016-02-11 12:37:25.000000000 +0100 @@ -20,7 +20,7 @@ %bcond_with tests Name: ghc-base-orphans -Version: 0.5.0 +Version: 0.5.1 Release: 0 Summary: Backwards-compatible orphan instances for base Group: System/Libraries ++++++ base-orphans-0.5.0.tar.gz -> base-orphans-0.5.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/base-orphans-0.5.0/CHANGES.markdown new/base-orphans-0.5.1/CHANGES.markdown --- old/base-orphans-0.5.0/CHANGES.markdown 2016-01-15 03:45:07.000000000 +0100 +++ new/base-orphans-0.5.1/CHANGES.markdown 2016-02-01 23:14:19.000000000 +0100 @@ -1,3 +1,8 @@ +## Changes in 0.5.1 + - The `Storable` instances for `Complex` and `Ratio` are now exactly as lazy + as their counterparts in `base` (see issue + [#36](https://github.com/haskell-compat/base-orphans/issues/36)) + ## Changes in 0.5.0 - GHC 8.0 compatibility - Backported instances introduced in GHC 8.0/`base-4.9` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/base-orphans-0.5.0/base-orphans.cabal new/base-orphans-0.5.1/base-orphans.cabal --- old/base-orphans-0.5.0/base-orphans.cabal 2016-01-15 03:45:07.000000000 +0100 +++ new/base-orphans-0.5.1/base-orphans.cabal 2016-02-01 23:14:19.000000000 +0100 @@ -3,7 +3,7 @@ -- see: https://github.com/sol/hpack name: base-orphans -version: 0.5.0 +version: 0.5.1 synopsis: Backwards-compatible orphan instances for base description: @base-orphans@ defines orphan instances that mimic instances available in later versions of @base@ to a wider (older) range of compilers. @base-orphans@ does not export anything except the orphan instances themselves and complements @<http://hackage.haskell.org/package/base-compat base-compat>@. See the README for what instances are covered: <https://github.com/haskell-compat/base-orphans#readme>. See also the <https://github.com/haskell-compat/base-orphans#what-is-not-covered what is not covered> section. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/base-orphans-0.5.0/src/Data/Orphans/Prelude.hs new/base-orphans-0.5.1/src/Data/Orphans/Prelude.hs --- old/base-orphans-0.5.0/src/Data/Orphans/Prelude.hs 2016-01-15 03:45:07.000000000 +0100 +++ new/base-orphans-0.5.1/src/Data/Orphans/Prelude.hs 2016-02-01 23:14:19.000000000 +0100 @@ -13,7 +13,7 @@ #if MIN_VERSION_base(4,9,0) () where #else - (module OrphansPrelude) where + (module OrphansPrelude, realPart, imagPart) where import Control.Applicative as OrphansPrelude import Control.Arrow as OrphansPrelude hiding (loop) @@ -104,4 +104,12 @@ import Data.Functor.Identity as OrphansPrelude # endif +# if MIN_VERSION_base(4,4,0) +realPart, imagPart :: Complex a -> a +#else +realPart, imagPart :: RealFloat a => Complex a -> a +#endif +realPart (x :+ _) = x +imagPart (_ :+ y) = y + #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/base-orphans-0.5.0/src/Data/Orphans.hs new/base-orphans-0.5.1/src/Data/Orphans.hs --- old/base-orphans-0.5.0/src/Data/Orphans.hs 2016-01-15 03:45:07.000000000 +0100 +++ new/base-orphans-0.5.1/src/Data/Orphans.hs 2016-02-01 23:14:19.000000000 +0100 @@ -6,6 +6,7 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE KindSignatures #-} +{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} @@ -370,8 +371,8 @@ instance (Storable a, RealFloat a) # endif => Storable (Complex a) where - sizeOf (a :+ _) = 2 * sizeOf a - alignment (a :+ _) = alignment a + sizeOf a = 2 * sizeOf (realPart a) + alignment a = alignment (realPart a) peek p = do q <- return $ castPtr p r <- peek q @@ -383,8 +384,8 @@ pokeElemOff q 1 i instance (Storable a, Integral a) => Storable (Ratio a) where - sizeOf (n :% _) = 2 * sizeOf n - alignment (n :% _) = alignment n + sizeOf _ = 2 * sizeOf (undefined :: a) + alignment _ = alignment (undefined :: a ) peek p = do q <- return $ castPtr p r <- peek q @@ -586,14 +587,6 @@ return a = a :+ a a :+ b >>= f = realPart (f a) :+ imagPart (f b) --- | Extracts the real part of a complex number. -realPart :: Complex a -> a -realPart (x :+ _) = x - --- | Extracts the imaginary part of a complex number. -imagPart :: Complex a -> a -imagPart (_ :+ y) = y - instance MonadZip Dual where -- Cannot use coerce, it's unsafe mzipWith = liftM2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/base-orphans-0.5.0/test/Foreign/Storable/OrphansSpec.hs new/base-orphans-0.5.1/test/Foreign/Storable/OrphansSpec.hs --- old/base-orphans-0.5.0/test/Foreign/Storable/OrphansSpec.hs 2016-01-15 03:45:07.000000000 +0100 +++ new/base-orphans-0.5.1/test/Foreign/Storable/OrphansSpec.hs 2016-02-01 23:14:19.000000000 +0100 @@ -13,12 +13,12 @@ spec = do describe "Storable Complex instance" $ do it "has twice the sizeOf its realPart" $ do - sizeOf ((1 :: Double) :+ 2) `shouldBe` 2*sizeOf (1 :: Double) + sizeOf (undefined :: Complex Double) `shouldBe` 2*sizeOf (1 :: Double) it "has the alignment of its realPart" $ do - alignment ((1 :: Double) :+ 2) `shouldBe` alignment (1 :: Double) + alignment (undefined :: Complex Double) `shouldBe` alignment (1 :: Double) describe "Storable Ratio instance" $ do it "has twice the sizeOf its parameterized type" $ do - sizeOf ((1 :: Int) % 2) `shouldBe` 2*sizeOf (1 :: Int) + sizeOf (undefined :: Ratio Int) `shouldBe` 2*sizeOf (1 :: Int) it "has the alignment of its parameterized type" $ do - alignment ((1 :: Int) % 2) `shouldBe` alignment (1 :: Int) + alignment (undefined :: Ratio Int) `shouldBe` alignment (1 :: Int)
