packages feed

base-orphans 0.8.1 → 0.8.2

raw patch · 5 files changed

+192/−49 lines, 5 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Data.Orphans: instance (Data.Orphans.Prelude.Typeable1 m, Data.Typeable.Internal.Typeable a, Data.Data.Data (m a)) => Data.Data.Data (Control.Applicative.WrappedMonad m a)
+ Data.Orphans: instance (Data.Orphans.Prelude.Typeable2 a, Data.Typeable.Internal.Typeable b, Data.Typeable.Internal.Typeable c, Data.Data.Data (a b c)) => Data.Data.Data (Control.Applicative.WrappedArrow a b c)
+ Data.Orphans: instance (GHC.Base.Monoid a, GHC.Base.Monoid b) => GHC.Base.Applicative ((,,) a b)
+ Data.Orphans: instance (GHC.Base.Monoid a, GHC.Base.Monoid b) => GHC.Base.Monad ((,,) a b)
+ Data.Orphans: instance (GHC.Base.Monoid a, GHC.Base.Monoid b, GHC.Base.Monoid c) => GHC.Base.Applicative ((,,,) a b c)
+ Data.Orphans: instance (GHC.Base.Monoid a, GHC.Base.Monoid b, GHC.Base.Monoid c) => GHC.Base.Monad ((,,,) a b c)
+ Data.Orphans: instance Data.Bits.Bits a => Data.Bits.Bits (Data.Ord.Down a)
+ Data.Orphans: instance Data.Bits.FiniteBits a => Data.Bits.FiniteBits (Data.Ord.Down a)
+ Data.Orphans: instance Data.Data.Data a => Data.Data.Data (Control.Applicative.ZipList a)
+ Data.Orphans: instance Foreign.Storable.Storable a => Foreign.Storable.Storable (Data.Ord.Down a)
+ Data.Orphans: instance GHC.Arr.Ix a => GHC.Arr.Ix (Data.Ord.Down a)
+ Data.Orphans: instance GHC.Base.Alternative m => GHC.Base.Alternative (Control.Arrow.Kleisli m a)
+ Data.Orphans: instance GHC.Base.Applicative m => GHC.Base.Applicative (Control.Arrow.Kleisli m a)
+ Data.Orphans: instance GHC.Base.Functor ((,,) a b)
+ Data.Orphans: instance GHC.Base.Functor ((,,,) a b c)
+ Data.Orphans: instance GHC.Base.Functor m => GHC.Base.Functor (Control.Arrow.Kleisli m a)
+ Data.Orphans: instance GHC.Base.Monad m => GHC.Base.Monad (Control.Arrow.Kleisli m a)
+ Data.Orphans: instance GHC.Base.MonadPlus m => GHC.Base.MonadPlus (Control.Arrow.Kleisli m a)
+ Data.Orphans: instance GHC.Enum.Bounded a => GHC.Enum.Bounded (Data.Ord.Down a)
+ Data.Orphans: instance GHC.Enum.Enum a => GHC.Enum.Enum (Data.Ord.Down a)
+ Data.Orphans: instance GHC.Exts.IsList (Control.Applicative.ZipList a)
+ Data.Orphans: instance GHC.Float.Floating a => GHC.Float.Floating (Data.Ord.Down a)
+ Data.Orphans: instance GHC.Float.RealFloat a => GHC.Float.RealFloat (Data.Ord.Down a)
+ Data.Orphans: instance GHC.Real.Fractional a => GHC.Real.Fractional (Data.Ord.Down a)
+ Data.Orphans: instance GHC.Real.Integral a => GHC.Real.Integral (Data.Ord.Down a)
+ Data.Orphans: instance GHC.Real.Real a => GHC.Real.Real (Data.Ord.Down a)
+ Data.Orphans: instance GHC.Real.RealFrac a => GHC.Real.RealFrac (Data.Ord.Down a)
+ Data.Orphans: instance forall k1 k2 (f :: k2 -> *) (g :: k1 -> k2). Data.Type.Equality.TestEquality f => Data.Type.Equality.TestEquality (Data.Functor.Compose.Compose f g)

Files

CHANGES.markdown view
@@ -1,3 +1,18 @@+## Changes in 0.8.2 [2020.01.27]+ - Backport new instances from GHC 8.10/`base-4.14`+   * `Bits`, `Bounded`, `Enum`, `FiniteBits`, `Floating`, `Fractional`,+     `Integral`, `Ix`, `Real`, `RealFrac`, `RealFloat` and `Storable` instances+     for `Data.Ord.Down`+   * `Functor`, `Applicative`, `Monad`, `Alternative`, and `MonadPlus` instances+     for `Kleisli`+   * `Functor`, `Applicative`, and `Monad` instances for+     `(,,) a b` and `(,,,) a b c`+   * `Data` instances for `WrappedArrow` and `WrappedMonad`+   * `Data` and `IsList` instances for `ZipList`+   * `TestEquality` instance for `Compose`+ - Backport the `Typeable (() :: Constraint)` instance to be available on+   GHC 7.8.+ ## Changes in 0.8.1 [2019.03.25]  - Ensure that the test suite passes non-negative numbers to `Bits` methods    that require them, such as `bit`, `setBit`, `clearBit`, `complementBit`,
README.markdown view
@@ -35,9 +35,11 @@  * `Alternative`, `Applicative`, `Bounded`, `Data`, `Enum`, `Foldable`, `Functor`, `Ix`, `Monad`, `MonadFix`, `MonadPlus`, `MonadZip`, and `Traversable` instances for data types in `GHC.Generics`  * `Alternative`, `Eq`, `Ord`, `Read`, `Show`, `Foldable`, and `Traversable` instances for `ZipList`  * `Applicative` instance for `K1` from `GHC.Generics`- * `Applicative`, `Data`, `Eq1`, `Foldable`, `Functor`, `Ord1`, `Monad`,-   `MonadFix`, `MonadZip`, `Monoid`, `Num`, `Read`, `Read1`, `Semigroup`,-   `Show`, `Show1`, and `Traversable` instances for `Down`+ * `Applicative`, `Bits`, `Bounded`, `Data`, `Enum`, `Eq1`, `FiniteBits`,+   `Floating`, `Foldable`, `Fractional`, `Functor`, `Integral`, `Ix`, `Ord1`,+   `Monad`, `MonadFix`, `MonadZip`, `Monoid`, `Num`, `Read`, `Read1`, `Real`,+   `RealFloat`, `RealFrac`, `Semigroup`, `Show`, `Show1`, `Storable`, and+   `Traversable` instances for `Down`  * `Applicative` and `Alternative` instances for `ReadP` and `ReadPrec`  * `Applicative` instance for strict and lazy `ST`  * `Applicative`, `Foldable`, `Functor`, `Monad`, and `Traversable` instances for `Complex`,@@ -45,17 +47,22 @@  * `Bits` instance for `Bool`  * `Bits`, `Bounded`, and `Integral` instances for `CDev`  * `Bits`, `Bounded`, `Enum`, `FiniteBits`, `Floating`, `Fractional`, `Integral`, `IsString`, `Ix`, `Num`, `Real`, `RealFloat`, `RealFrac`, and `Storable` instances for `Const` and `Identity`- * `Data` instances for `All`, `Any`, and `Const`, `IntPtr`, and `WordPtr`+ * `Data` instances for `All`, `Any`, and `Const`, `IntPtr`, `WordPtr`,+   `WrappedArrow` and `WrappedMonad`  * `Data`, `MonadFix` and `MonadZip` instances for `Alt`, `Dual`, `First`, `Last`,    `Product`, and `Sum`- * `Data` and `IsList` instances for `Version`+ * `Data` and `IsList` instances for `Version` and `ZipList`  * `Eq` and `Ord` instances for `Control.Exception.ErrorCall`  * `Eq`, `Ord`, `Read`, and `Show` instances for data types in `GHC.Generics`  * `Eq1`, `Ord1`, `Read1`, and `Show1` instances for `NonEmpty`  * `Foldable` instance for `Either`, `(,)` and `Const`  * `Foldable` and `Traversable` instances for `Alt` from `Data.Monoid`+ * `Functor`, `Applicative`, and `Monad` instances for+   `(,,) a b` and `(,,,) a b c`  * `Functor` instance for `Handler`, `ArgOrder`, `OptDescr`, and `ArgDescr`  * `Functor`, `Applicative`, `Alternative`, and `MonadPlus` instances for `ArrowMonad`+ * `Functor`, `Applicative`, `Monad`, `Alternative`, and `MonadPlus` instances+   for `Kleisli`  * `Monad` instance for `(,)`  * `Monad` instance for `WrappedMonad`  * `MonadFail`, `Monoid`, and `Semigroup` instances for strict `ST`@@ -69,6 +76,7 @@    `Monoid` instances for the same types (except `V1`).  * `Show` instance for `Fingerprint`  * `Storable` instance for `()`, `Complex`, and `Ratio`+ * `TestEquality` instance for `Compose`  * `Traversable` instance for `Either`, `(,)` and `Const`  * `Typeable` instance for most data types, typeclasses, and promoted data constructors (when possible) @@ -85,35 +93,18 @@  ## Supported versions of GHC/`base` - * `ghc-8.6.4`  / `base-4.12.0.0`- * `ghc-8.6.3`  / `base-4.12.0.0`- * `ghc-8.6.2`  / `base-4.12.0.0`- * `ghc-8.6.1`  / `base-4.12.0.0`- * `ghc-8.4.3`  / `base-4.11.1.0`- * `ghc-8.4.2`  / `base-4.11.1.0`- * `ghc-8.4.1`  / `base-4.11.0.0`- * `ghc-8.2.2`  / `base-4.10.1.0`- * `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`- * `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`- * `ghc-7.8.3`  / `base-4.7.0.1`- * `ghc-7.8.2`  / `base-4.7.0.0`- * `ghc-7.8.1`  / `base-4.7.0.0`- * `ghc-7.6.3`  / `base-4.6.0.1`- * `ghc-7.6.2`  / `base-4.6.0.1`- * `ghc-7.6.1`  / `base-4.6.0.0`- * `ghc-7.4.2`  / `base-4.5.1.0`- * `ghc-7.4.1`  / `base-4.5.0.0`- * `ghc-7.2.2`  / `base-4.4.1.0`- * `ghc-7.2.1`  / `base-4.4.0.0`- * `ghc-7.0.4`  / `base-4.3.1.0`- * `ghc-7.0.3`  / `base-4.3.1.0`- * `ghc-7.0.2`  / `base-4.3.1.0`- * `ghc-7.0.1`  / `base-4.3.0.0`+ * `ghc-8.10.*` / `base-4.14.*`+ * `ghc-8.8.*`  / `base-4.13.*`+ * `ghc-8.6.*`  / `base-4.12.*`+ * `ghc-8.4.*`  / `base-4.11.*`+ * `ghc-8.2.*`  / `base-4.10.*`+ * `ghc-8.0.*`  / `base-4.9.*`+ * `ghc-7.10.*` / `base-4.8.*`+ * `ghc-7.8.*`  / `base-4.7.*`+ * `ghc-7.6.*`  / `base-4.6.*`+ * `ghc-7.4.*`  / `base-4.5.*`+ * `ghc-7.2.*`  / `base-4.4.*`+ * `ghc-7.0.*`  / `base-4.3.*`  We also make an attempt to keep `base-orphans` building with GHC HEAD, but due to its volatility, it may not work at any given point in time. If it doesn't,
base-orphans.cabal view
@@ -1,13 +1,13 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.31.2.+-- This file has been generated from package.yaml by hpack version 0.33.0. -- -- see: https://github.com/sol/hpack ----- hash: 8a268198122a850483f734c68a9c0a82b17c3ce8e2bf1bfda6930aeb4f7deff0+-- hash: bd02ba6d695fef876de62e5d71b3c276a9d2907d07b94ebb624da902c08791fe  name:                base-orphans-version:             0.8.1+version:             0.8.2 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.@@ -26,7 +26,7 @@ license:             MIT license-file:        LICENSE build-type:          Simple-tested-with:         GHC == 7.0.* , GHC == 7.2.* , GHC == 7.4.* , GHC == 7.6.* , GHC == 7.8.* , GHC == 7.10.* , GHC == 8.0.* , GHC == 8.2.* , GHC == 8.4.* , GHC == 8.6.*+tested-with:         GHC == 7.0.4 , GHC == 7.2.2 , GHC == 7.4.2 , GHC == 7.6.3 , GHC == 7.8.4 , GHC == 7.10.3 , GHC == 8.0.2 , GHC == 8.2.2 , GHC == 8.4.4 , GHC == 8.6.5 , GHC == 8.8.2 , GHC == 8.10.1 extra-source-files:     CHANGES.markdown     README.markdown
src/Data/Orphans.hs view
@@ -80,7 +80,7 @@ # endif #endif -#if !(MIN_VERSION_base(4,12,0))+#if !(MIN_VERSION_base(4,14,0)) import           Data.Orphans.Prelude #endif @@ -1094,6 +1094,109 @@ # endif #endif +#if !(MIN_VERSION_base(4,14,0))+instance Functor ((,,) a b) where+    fmap f (a, b, c) = (a, b, f c)++instance (Monoid a, Monoid b) => Applicative ((,,) a b) where+    pure x = (mempty, mempty, x)+    (a, b, f) <*> (a', b', x) = (a `mappend` a', b `mappend` b', f x)++instance (Monoid a, Monoid b) => Monad ((,,) a b) where+    (u, v, a) >>= k =+      case k a of+        (u', v', b) ->+          (u `mappend` u', v `mappend` v', b)+# if !(MIN_VERSION_base(4,8,0))+    return x = (mempty, mempty, x)+# endif++instance Functor ((,,,) a b c) where+    fmap f (a, b, c, d) = (a, b, c, f d)++instance (Monoid a, Monoid b, Monoid c) => Applicative ((,,,) a b c) where+    pure x = (mempty, mempty, mempty, x)+    (a, b, c, f) <*> (a', b', c', x) =+      (a `mappend` a', b `mappend` b', c `mappend` c', f x)++instance (Monoid a, Monoid b, Monoid c) => Monad ((,,,) a b c) where+    (u, v, w, a) >>= k =+      case k a of+        (u', v', w', b) ->+          (u `mappend` u', v `mappend` v', w `mappend` w', b)+# if !(MIN_VERSION_base(4,8,0))+    return x = (mempty, mempty, mempty, x)+# endif++deriving instance Functor m => Functor (Kleisli m a)++instance Applicative m => Applicative (Kleisli m a) where+  pure = Kleisli . const . pure+  {-# INLINE pure #-}+  Kleisli f <*> Kleisli g = Kleisli $ \x -> f x <*> g x+  {-# INLINE (<*>) #-}+  Kleisli f *> Kleisli g = Kleisli $ \x -> f x *> g x+  {-# INLINE (*>) #-}+  Kleisli f <* Kleisli g = Kleisli $ \x -> f x <* g x+  {-# INLINE (<*) #-}++instance Alternative m => Alternative (Kleisli m a) where+  empty = Kleisli $ const empty+  {-# INLINE empty #-}+  Kleisli f <|> Kleisli g = Kleisli $ \x -> f x <|> g x+  {-# INLINE (<|>) #-}++instance Monad m => Monad (Kleisli m a) where+  Kleisli f >>= k = Kleisli $ \x -> f x >>= \a -> runKleisli (k a) x+  {-# INLINE (>>=) #-}+# if !(MIN_VERSION_base(4,8,0))+  return = Kleisli . const . return+  {-# INLINE return #-}+# endif++instance MonadPlus m => MonadPlus (Kleisli m a) where+  mzero = Kleisli $ const mzero+  {-# INLINE mzero #-}+  Kleisli f `mplus` Kleisli g = Kleisli $ \x -> f x `mplus` g x+  {-# INLINE mplus #-}++deriving instance Bits       a => Bits       (Down a)+deriving instance Bounded    a => Bounded    (Down a)+deriving instance Enum       a => Enum       (Down a)+deriving instance Floating   a => Floating   (Down a)+deriving instance Fractional a => Fractional (Down a)+deriving instance Integral   a => Integral   (Down a)+deriving instance Ix         a => Ix         (Down a)+deriving instance Real       a => Real       (Down a)+deriving instance RealFrac   a => RealFrac   (Down a)+deriving instance RealFloat  a => RealFloat  (Down a)+deriving instance Storable   a => Storable   (Down a)+# if MIN_VERSION_base(4,7,0)+deriving instance FiniteBits a => FiniteBits (Down a)+# endif++deriving instance (Typeable2 a, Typeable b, Typeable c, Data (a b c))+                         => Data (WrappedArrow a b c)+deriving instance (Typeable1 m, Typeable a, Data (m a))+                         => Data (WrappedMonad m a)+deriving instance Data a => Data (ZipList a)++# if MIN_VERSION_base(4,7,0)+instance IsList (ZipList a) where+  type Item (ZipList a) = a+  fromList = ZipList+  toList = getZipList+# endif++# if MIN_VERSION_base(4,9,0)+instance (TestEquality f) => TestEquality (Compose f g) where+  testEquality (Compose x) (Compose y) =+    case testEquality x y of -- :: Maybe (g x :~: g y)+      Just Refl -> Just Refl -- :: Maybe (x :~: y)+      Nothing   -> Nothing+# endif+#endif+ #if __GLASGOW_HASKELL__ < 710 deriving instance Typeable  All deriving instance Typeable  AnnotationWrapper@@ -1485,6 +1588,7 @@ -- Constraints deriving instance Typeable (~) deriving instance Typeable Constraint+deriving instance Typeable (() :: Constraint)  -- Promoted data constructors deriving instance Typeable '()
src/Data/Orphans/Prelude.hs view
@@ -1,9 +1,15 @@ {-# LANGUAGE CPP #-}+{-# LANGUAGE KindSignatures #-}  #if __GLASGOW_HASKELL__ >= 706+{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE ExplicitNamespaces #-} #endif +#if __GLASGOW_HASKELL__ >= 806+{-# LANGUAGE NoStarIsType #-}+#endif+ {-# OPTIONS_GHC -fno-warn-deprecations #-}  {-|@@ -15,10 +21,20 @@ Note that this module does not export any modules that could introduce name clashes. -} module Data.Orphans.Prelude-#if MIN_VERSION_base(4,12,0)+#if MIN_VERSION_base(4,14,0)     () where #else-    (module OrphansPrelude, realPart, imagPart) where+    ( module OrphansPrelude+    , realPart+    , imagPart+    , Typeable1+    , Typeable2+    , Typeable3+    , Typeable4+    , Typeable5+    , Typeable6+    , Typeable7+    ) where  import Control.Applicative as OrphansPrelude import Control.Arrow as OrphansPrelude hiding (first, loop, second)@@ -42,6 +58,7 @@ # endif          ) import Data.String as OrphansPrelude (IsString)+import Data.Typeable as OrphansPrelude (Typeable) import Data.Version as OrphansPrelude import Data.Word as OrphansPrelude @@ -87,11 +104,7 @@ #  if !defined(mingw32_HOST_OS) && !defined(__GHCJS__) import GHC.Event as OrphansPrelude #  endif--# if !(MIN_VERSION_base(4,10,0))-import Data.Typeable.Internal as OrphansPrelude # endif-# endif  # if MIN_VERSION_base(4,5,0) import GHC.Stack as OrphansPrelude@@ -113,7 +126,8 @@ # if MIN_VERSION_base(4,7,0) import Data.Proxy as OrphansPrelude import Data.Type.Coercion as OrphansPrelude (Coercion, TestCoercion)-import Data.Type.Equality as OrphansPrelude ((:~:), TestEquality)+import Data.Type.Equality as OrphansPrelude ((:~:)(..), TestEquality(..))+import GHC.Exts as OrphansPrelude (IsList(..)) import Text.Read.Lex as OrphansPrelude (Number) # else import Control.Concurrent.SampleVar as OrphansPrelude@@ -126,16 +140,35 @@  # if MIN_VERSION_base(4,9,0) import Data.Functor.Classes as OrphansPrelude+import Data.Functor.Compose as OrphansPrelude+import Data.Semigroup as OrphansPrelude (stimesMonoid)+# endif++# if MIN_VERSION_base(4,9,0) && !(MIN_VERSION_base(4,12,0)) import Data.List.NonEmpty as OrphansPrelude (NonEmpty(..))-import Data.Semigroup as OrphansPrelude (Semigroup(..), stimesMonoid)+import Data.Semigroup as OrphansPrelude (Semigroup(..)) # endif +# if !(MIN_VERSION_base(4,11,0))+import Data.Typeable ( Typeable1, Typeable2, Typeable3, Typeable4+                     , Typeable5, Typeable6, Typeable7 )+# endif+ # if MIN_VERSION_base(4,4,0) realPart, imagPart :: Complex a -> a-#else+# else realPart, imagPart :: RealFloat a => Complex a -> a-#endif+# endif realPart (x :+ _) = x imagPart (_ :+ y) = y +# if MIN_VERSION_base(4,11,0)+type Typeable1 (a :: Type -> Type)                                                 = Typeable a+type Typeable2 (a :: Type -> Type -> Type)                                         = Typeable a+type Typeable3 (a :: Type -> Type -> Type -> Type)                                 = Typeable a+type Typeable4 (a :: Type -> Type -> Type -> Type -> Type)                         = Typeable a+type Typeable5 (a :: Type -> Type -> Type -> Type -> Type -> Type)                 = Typeable a+type Typeable6 (a :: Type -> Type -> Type -> Type -> Type -> Type -> Type)         = Typeable a+type Typeable7 (a :: Type -> Type -> Type -> Type -> Type -> Type -> Type -> Type) = Typeable a+# endif #endif