Hello community, here is the log from the commit of package ghc-base-orphans for openSUSE:Factory checked in at 2016-01-28 17:23:33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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 2015-12-23 08:50:12.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-base-orphans.new/ghc-base-orphans.changes 2016-01-28 17:24:30.000000000 +0100 @@ -1,0 +2,6 @@ +Wed Jan 20 08:48:09 UTC 2016 - [email protected] + +- update to 0.5.0 +* Backported instances introduced in GHC 8.0/base-4.9 + +------------------------------------------------------------------- Old: ---- base-orphans-0.4.5.tar.gz New: ---- base-orphans-0.5.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-base-orphans.spec ++++++ --- /var/tmp/diff_new_pack.HLOfB0/_old 2016-01-28 17:24:30.000000000 +0100 +++ /var/tmp/diff_new_pack.HLOfB0/_new 2016-01-28 17:24:30.000000000 +0100 @@ -20,7 +20,7 @@ %bcond_with tests Name: ghc-base-orphans -Version: 0.4.5 +Version: 0.5.0 Release: 0 Summary: Backwards-compatible orphan instances for base Group: System/Libraries ++++++ base-orphans-0.4.5.tar.gz -> base-orphans-0.5.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/base-orphans-0.4.5/CHANGES.markdown new/base-orphans-0.5.0/CHANGES.markdown --- old/base-orphans-0.4.5/CHANGES.markdown 2015-12-15 18:26:53.000000000 +0100 +++ new/base-orphans-0.5.0/CHANGES.markdown 2016-01-15 03:45:07.000000000 +0100 @@ -1,3 +1,8 @@ +## Changes in 0.5.0 + - GHC 8.0 compatibility + - Backported instances introduced in GHC 8.0/`base-4.9` + (see https://github.com/haskell-compat/base-orphans/issues/32) + ## Changes in 0.4.5 - Import `Control.Monad.Instances` (which exports `Functor` and `Monad` instances for `(->) r`, and `Functor` instances for `(,) a` and `Either a`) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/base-orphans-0.4.5/README.markdown new/base-orphans-0.5.0/README.markdown --- old/base-orphans-0.4.5/README.markdown 2015-12-15 18:26:53.000000000 +0100 +++ new/base-orphans-0.5.0/README.markdown 2016-01-15 03:45:07.000000000 +0100 @@ -31,25 +31,33 @@ ## What is covered - * Added `Applicative` and `Alternative` instances for `ReadP` and `ReadPrec` - * Added `Bits`, `Bounded`, and `Integral` instances for `CDev` - * Added `Eq` and `Ord` instances for `Control.Exception.ErrorCall` - * Added `Eq`, `Ord`, `Read`, and `Show` instances for data types in `GHC.Generics` - * Added `Functor`, `Applicative`, `Alternative`, and `MonadPlus` instances for `ArrowMonad` - * Added `Functor`, `Applicative`, and `Monad` instances for `First` and `Last` - * Added `Monoid`, `Eq`, `Ord`, `Read`, and `Show` instances for `Const` - * Added `Read` and `Show` instances for `Down` - * Added `Eq`, `Ord`, `Read`, and `Show` instances for `ZipList` - * Added `Monad` instance for `WrappedMonad` - * Added `Data` and `IsList` instances for `Version` + * `Applicative` and `Alternative` instances for `ReadP` and `ReadPrec` * `Applicative` instance for strict and lazy `ST` + * `Applicative`, `Foldable`, `Functor`, `Monad`, and `Traversable` instances for `Complex`, + `Dual`, `First`, `Last`, `Product`, and `Sum` * `Bits` instance for `Bool` + * `Bits`, `Bounded`, and `Integral` instances for `CDev` + * `Bounded`, `Enum`, `Ix`, and `Storable` instances for `Const` and `Identity` + * `Data` instances for `All` and `Any` + * `Data`, `MonadFix` and `MonadZip` instances for `Alt`, `Dual`, `First`, `Last`, + `Product`, and `Sum` + * `Data` and `IsList` instances for `Version` + * `Eq` and `Ord` instances for `Control.Exception.ErrorCall` + * `Eq`, `Ord`, `Read`, and `Show` instances for data types in `GHC.Generics` + * `Eq`, `Ord`, `Read`, `Show`, `Foldable`, and `Traversable` instances for `ZipList` * `Foldable` instance for `Either`, `(,)` and `Const` * `Functor` instance for `Handler`, `ArgOrder`, `OptDescr`, and `ArgDescr` + * `Functor`, `Applicative`, `Alternative`, and `MonadPlus` instances for `ArrowMonad` + * `Monad` instance for `(,)` + * `Monad` instance for `WrappedMonad` + * `MonadZip` instance for `Maybe` + * `Monoid`, `Eq`, `Ord`, `Read`, and `Show` instances for `Const` + * `Monoid` instances for `Identity` and `IO` * `Num` instance for `Sum` and `Product` * `Read` instance for `Fixed` + * `Read` and `Show` instances for `Down` * `Show` instance for `Fingerprint` - * `Storable` instance for `Complex` and `Ratio` + * `Storable` instance for `()`, `Complex`, and `Ratio` * `Traversable` instance for `Either`, `(,)` and `Const` * `Typeable` instance for most data types, typeclasses, and promoted data constructors (when possible) @@ -60,9 +68,14 @@ [`Generics.Deriving.Instances`](https://hackage.haskell.org/package/generic-deriving-1.8.0/docs/Generics-Deriving-Instances.html) module of the [`generic-deriving`](https://hackage.haskell.org/package/generic-deriving) library. +* The `Alternative IO` and `MonadPlus IO` instances. These can be found in the + [`Control.Monad.Trans.Error`](http://hackage.haskell.org/package/transformers-0.4.3.0/docs/src/Control-Monad-Trans-Error.html#line-69) + module of the [`transformers`](http://hackage.haskell.org/package/transformers) library. ## Supported versions of GHC/`base` + * `ghc-8.0.1` / `base-4.9.0.0` + * `ghc-7.10.3` / `base-4.8.2.0` * `ghc-7.10.2` / `base-4.8.1.0` * `ghc-7.10.1` / `base-4.8.0.0` * `ghc-7.8.4` / `base-4.7.0.2` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/base-orphans-0.4.5/base-orphans.cabal new/base-orphans-0.5.0/base-orphans.cabal --- old/base-orphans-0.4.5/base-orphans.cabal 2015-12-15 18:26:53.000000000 +0100 +++ new/base-orphans-0.5.0/base-orphans.cabal 2016-01-15 03:45:07.000000000 +0100 @@ -1,71 +1,71 @@ --- This file has been generated from package.yaml by hpack version 0.8.0. --- --- see: https://github.com/sol/hpack - -name: base-orphans -version: 0.4.5 -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. -category: Compatibility -homepage: https://github.com/haskell-compat/base-orphans#readme -bug-reports: https://github.com/haskell-compat/base-orphans/issues -author: Simon Hengel <[email protected]>, - João Cristóvão <[email protected]>, - Ryan Scott <[email protected]> -maintainer: Simon Hengel <[email protected]>, - João Cristóvão <[email protected]>, - Ryan Scott <[email protected]> -copyright: (c) 2012-2015 Simon Hengel, - (c) 2014 João Cristóvão, - (c) 2015 Ryan Scott -license: MIT -license-file: LICENSE -build-type: Simple -cabal-version: >= 1.10 - -extra-source-files: - CHANGES.markdown - README.markdown - -source-repository head - type: git - location: https://github.com/haskell-compat/base-orphans - -library - hs-source-dirs: - src - ghc-options: -Wall - build-depends: - base >= 4.3 && < 5, - ghc-prim - exposed-modules: - Data.Orphans - other-modules: - Data.Orphans.Prelude - default-language: Haskell2010 - -test-suite spec - type: exitcode-stdio-1.0 - main-is: Spec.hs - hs-source-dirs: - test - ghc-options: -Wall - build-depends: - base >= 4.3 && < 5, - base-orphans, - hspec == 2.*, - QuickCheck - other-modules: - Control.Applicative.OrphansSpec - Control.Exception.OrphansSpec - Data.Bits.OrphansSpec - Data.Foldable.OrphansSpec - Data.Monoid.OrphansSpec - Data.Traversable.OrphansSpec - Data.Version.OrphansSpec - Foreign.Storable.OrphansSpec - GHC.Fingerprint.OrphansSpec - System.Posix.Types.IntWord - System.Posix.Types.OrphansSpec - default-language: Haskell2010 +-- This file has been generated from package.yaml by hpack version 0.8.0. +-- +-- see: https://github.com/sol/hpack + +name: base-orphans +version: 0.5.0 +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. +category: Compatibility +homepage: https://github.com/haskell-compat/base-orphans#readme +bug-reports: https://github.com/haskell-compat/base-orphans/issues +author: Simon Hengel <[email protected]>, + João Cristóvão <[email protected]>, + Ryan Scott <[email protected]> +maintainer: Simon Hengel <[email protected]>, + João Cristóvão <[email protected]>, + Ryan Scott <[email protected]> +copyright: (c) 2012-2015 Simon Hengel, + (c) 2014 João Cristóvão, + (c) 2015 Ryan Scott +license: MIT +license-file: LICENSE +build-type: Simple +cabal-version: >= 1.10 + +extra-source-files: + CHANGES.markdown + README.markdown + +source-repository head + type: git + location: https://github.com/haskell-compat/base-orphans + +library + hs-source-dirs: + src + ghc-options: -Wall + build-depends: + base >= 4.3 && < 5, + ghc-prim + exposed-modules: + Data.Orphans + other-modules: + Data.Orphans.Prelude + default-language: Haskell2010 + +test-suite spec + type: exitcode-stdio-1.0 + main-is: Spec.hs + hs-source-dirs: + test + ghc-options: -Wall + build-depends: + base >= 4.3 && < 5, + base-orphans, + hspec == 2.*, + QuickCheck + other-modules: + Control.Applicative.OrphansSpec + Control.Exception.OrphansSpec + Data.Bits.OrphansSpec + Data.Foldable.OrphansSpec + Data.Monoid.OrphansSpec + Data.Traversable.OrphansSpec + Data.Version.OrphansSpec + Foreign.Storable.OrphansSpec + GHC.Fingerprint.OrphansSpec + System.Posix.Types.IntWord + System.Posix.Types.OrphansSpec + default-language: Haskell2010 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/base-orphans-0.4.5/src/Data/Orphans/Prelude.hs new/base-orphans-0.5.0/src/Data/Orphans/Prelude.hs --- old/base-orphans-0.4.5/src/Data/Orphans/Prelude.hs 2015-12-15 18:26:53.000000000 +0100 +++ new/base-orphans-0.5.0/src/Data/Orphans/Prelude.hs 2016-01-15 03:45:07.000000000 +0100 @@ -10,7 +10,7 @@ Note that this module does not export any modules that could introduce name clashes. -} module Data.Orphans.Prelude -#if MIN_VERSION_base(4,8,0) +#if MIN_VERSION_base(4,9,0) () where #else (module OrphansPrelude) where @@ -100,4 +100,8 @@ import Control.Concurrent.SampleVar as OrphansPrelude # endif +# if MIN_VERSION_base(4,8,0) +import Data.Functor.Identity as OrphansPrelude +# endif + #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/base-orphans-0.4.5/src/Data/Orphans.hs new/base-orphans-0.5.0/src/Data/Orphans.hs --- old/base-orphans-0.4.5/src/Data/Orphans.hs 2015-12-15 18:26:53.000000000 +0100 +++ new/base-orphans-0.5.0/src/Data/Orphans.hs 2016-01-15 03:45:07.000000000 +0100 @@ -5,6 +5,7 @@ {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE KindSignatures #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} @@ -42,13 +43,16 @@ import Control.Monad.Instances () #endif -#if __GLASGOW_HASKELL__ < 710 -import Control.Exception as Exception -import Control.Monad.ST.Lazy as Lazy +#if !(MIN_VERSION_base(4,9,0)) import Data.Data as Data import qualified Data.Foldable as F (Foldable(..)) import Data.Monoid as Monoid import qualified Data.Traversable as T (Traversable(..)) +#endif + +#if __GLASGOW_HASKELL__ < 710 +import Control.Exception as Exception +import Control.Monad.ST.Lazy as Lazy import GHC.Exts as Exts import GHC.IO.Exception as Exception import Text.ParserCombinators.ReadP as ReadP @@ -60,7 +64,7 @@ # endif #endif -#if !(MIN_VERSION_base(4,8,0)) +#if !(MIN_VERSION_base(4,9,0)) import Data.Orphans.Prelude #endif @@ -392,6 +396,242 @@ pokeElemOff q 1 i #endif +#if !(MIN_VERSION_base(4,9,0)) +instance Storable () where + sizeOf _ = 0 + alignment _ = 1 + peek _ = return () + poke _ _ = return () + +deriving instance Bounded a => Bounded (Const a b) +deriving instance Enum a => Enum (Const a b) +deriving instance Ix a => Ix (Const a b) +deriving instance Storable a => Storable (Const a b) + +deriving instance Data All +deriving instance Data Monoid.Any +deriving instance Data a => Data (Dual a) +deriving instance Data a => Data (First a) +deriving instance Data a => Data (Last a) +deriving instance Data a => Data (Product a) +deriving instance Data a => Data (Sum a) + +instance F.Foldable Dual where + foldMap = coerce + + foldl = coerce + foldl1 _ = getDual + foldr f z (Dual x) = f x z + foldr1 _ = getDual +# if MIN_VERSION_base(4,6,0) + foldl' = coerce + foldr' = F.foldr +# endif +# if MIN_VERSION_base(4,8,0) + elem = (. getDual) #. (==) + length _ = 1 + maximum = getDual + minimum = getDual + null _ = False + product = getDual + sum = getDual + toList (Dual x) = [x] +# endif + +instance F.Foldable Sum where + foldMap = coerce + + foldl = coerce + foldl1 _ = getSum + foldr f z (Sum x) = f x z + foldr1 _ = getSum +# if MIN_VERSION_base(4,6,0) + foldl' = coerce + foldr' = F.foldr +# endif +# if MIN_VERSION_base(4,8,0) + elem = (. getSum) #. (==) + length _ = 1 + maximum = getSum + minimum = getSum + null _ = False + product = getSum + sum = getSum + toList (Sum x) = [x] +# endif + +instance F.Foldable Product where + foldMap = coerce + + foldl = coerce + foldl1 _ = getProduct + foldr f z (Product x) = f x z + foldr1 _ = getProduct +# if MIN_VERSION_base(4,6,0) + foldl' = coerce + foldr' = F.foldr +# endif +# if MIN_VERSION_base(4,8,0) + elem = (. getProduct) #. (==) + length _ = 1 + maximum = getProduct + minimum = getProduct + null _ = False + product = getProduct + sum = getProduct + toList (Product x) = [x] +# endif + +# if MIN_VERSION_base(4,8,0) +(#.) :: Coercible b c => (b -> c) -> (a -> b) -> (a -> c) +(#.) _f = coerce +# endif + +# if !(MIN_VERSION_base(4,7,0)) +coerce :: a -> b +coerce = unsafeCoerce +# endif + +instance Functor Dual where + fmap = coerce + +instance Applicative Dual where + pure = Dual + (<*>) = coerce + +instance Monad Dual where + return = Dual + m >>= k = k (getDual m) + +instance Functor Sum where + fmap = coerce + +instance Applicative Sum where + pure = Sum + (<*>) = coerce + +instance Monad Sum where + return = Sum + m >>= k = k (getSum m) + +instance Functor Product where + fmap = coerce + +instance Applicative Product where + pure = Product + (<*>) = coerce + +instance Monad Product where + return = Product + m >>= k = k (getProduct m) + +instance F.Foldable First where + foldMap f = F.foldMap f . getFirst + +instance F.Foldable Last where + foldMap f = F.foldMap f . getLast + +instance Monoid a => Monoid (IO a) where + mempty = pure mempty + mappend = liftA2 mappend + +-- see: #10190 https://git.haskell.org/ghc.git/commitdiff/9db005a444722e31aca1956b058e069bcf3cacbd +instance Monoid a => Monad ((,) a) where + return x = (mempty, x) + (u, a) >>= k = case k a of (v, b) -> (u `mappend` v, b) + +instance MonadFix Dual where + mfix f = Dual (fix (getDual . f)) + +instance MonadFix Sum where + mfix f = Sum (fix (getSum . f)) + +instance MonadFix Product where + mfix f = Product (fix (getProduct . f)) + +instance MonadFix First where + mfix f = First (mfix (getFirst . f)) + +instance MonadFix Last where + mfix f = Last (mfix (getLast . f)) + +instance T.Traversable Dual where + traverse f (Dual x) = Dual <$> f x + +instance T.Traversable Sum where + traverse f (Sum x) = Sum <$> f x + +instance T.Traversable Product where + traverse f (Product x) = Product <$> f x + +instance T.Traversable First where + traverse f (First x) = First <$> T.traverse f x + +instance T.Traversable Last where + traverse f (Last x) = Last <$> T.traverse f x + +deriving instance F.Foldable ZipList +deriving instance T.Traversable ZipList + +# if MIN_VERSION_base(4,4,0) +deriving instance Functor Complex +deriving instance F.Foldable Complex +deriving instance T.Traversable Complex + +instance Applicative Complex where + pure a = a :+ a + f :+ g <*> a :+ b = f a :+ g b + +instance Monad Complex where + 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 + +instance MonadZip Sum where + mzipWith = liftM2 + +instance MonadZip Product where + mzipWith = liftM2 + +instance MonadZip Maybe where + mzipWith = liftM2 + +instance MonadZip First where + mzipWith = liftM2 + +instance MonadZip Last where + mzipWith = liftM2 +# endif + +# if MIN_VERSION_base(4,8,0) +deriving instance (Data (f a), Typeable f, Typeable a) + => Data (Alt (f :: * -> *) (a :: *)) + +instance MonadFix f => MonadFix (Alt f) where + mfix f = Alt (mfix (getAlt . f)) + +instance MonadZip f => MonadZip (Alt f) where + mzipWith f (Alt ma) (Alt mb) = Alt (mzipWith f ma mb) + +deriving instance Bounded a => Bounded (Identity a) +deriving instance Enum a => Enum (Identity a) +deriving instance Ix a => Ix (Identity a) +deriving instance Monoid a => Monoid (Identity a) +deriving instance Storable a => Storable (Identity a) +# endif +#endif + #if __GLASGOW_HASKELL__ < 710 deriving instance Typeable All deriving instance Typeable AnnotationWrapper
