packages feed

base-compat 0.4.2 → 0.5.0

raw patch · 14 files changed

+107/−52 lines, 14 filesdep +QuickCheckdep ~hspec

Dependencies added: QuickCheck

Dependency ranges changed: hspec

Files

base-compat.cabal view
@@ -1,5 +1,5 @@ name:             base-compat-version:          0.4.2+version:          0.5.0 license:          MIT license-file:     LICENSE copyright:        (c) 2012-2014 Simon Hengel,@@ -26,7 +26,6 @@     , setenv   extensions:       CPP-    , PackageImports     , NoImplicitPrelude   ghc-options:     -fno-warn-duplicate-exports@@ -35,10 +34,10 @@       src    exposed-modules:-      -- with modifications       Prelude.Compat-      Control.Monad.Compat       Control.Applicative.Compat+      Control.Exception.Compat+      Control.Monad.Compat       Data.Bool.Compat       Data.Either.Compat       Data.Foldable.Compat@@ -46,14 +45,9 @@       Data.Monoid.Compat       Data.Traversable.Compat       System.Environment.Compat+      System.Exit.Compat       Text.Read.Compat -      -- added Eq/Ord instance for ErrorCall-      Control.Exception.Compat-      Control.Exception.Base.Compat-      GHC.Exception.Compat-- test-suite spec   type:       exitcode-stdio-1.0@@ -66,5 +60,5 @@   build-depends:       base > 4.0     , base-compat-    , hspec >= 1.3-    , setenv+    , hspec >= 1.8+    , QuickCheck
src/Control/Applicative/Compat.hs view
@@ -4,7 +4,7 @@ , Const(..) , WrappedMonad(..) ) where-import "base" Control.Applicative as Base+import Control.Applicative as Base  #if !MIN_VERSION_base(4,7,0) import Data.Monoid (Monoid(..),mempty,mappend)
− src/Control/Exception/Base/Compat.hs
@@ -1,5 +0,0 @@-module Control.Exception.Base.Compat (-  module Base-) where-import "base" Control.Exception.Base as Base-import GHC.Exception.Compat ()
src/Control/Exception/Compat.hs view
@@ -1,5 +1,13 @@+{-# LANGUAGE StandaloneDeriving #-}+{-# OPTIONS_GHC -fno-warn-orphans #-} module Control.Exception.Compat (   module Base ) where-import "base" Control.Exception as Base-import GHC.Exception.Compat ()++import Control.Exception as Base+import Control.Exception.ErrorCall.EqInstance ()++#if __GLASGOW_HASKELL__ <= 706+import Prelude+deriving instance Ord ErrorCall+#endif
src/Data/Bool/Compat.hs view
@@ -1,8 +1,15 @@ module Data.Bool.Compat (-  module Base-, bool-) where-import "base" Data.Bool as Base+   -- * Booleans+   Bool(..),+   -- ** Operations+   (&&),+   (||),+   not,+   otherwise,+   bool,+  ) where++import Data.Bool  #if !MIN_VERSION_base(4,7,0) -- | Case analysis for the 'Bool' type.
src/Data/Either/Compat.hs view
@@ -3,7 +3,7 @@ , isLeft , isRight ) where-import "base" Data.Either as Base+import Data.Either as Base  #if !MIN_VERSION_base(4,7,0) import Data.Bool (Bool(..))
src/Data/Foldable/Compat.hs view
@@ -3,7 +3,7 @@   module Base , Foldable(..) ) where-import "base" Data.Foldable as Base+import Data.Foldable as Base  #if !MIN_VERSION_base(4,7,0) import Data.Either (Either(..))
src/Data/Functor/Compat.hs view
@@ -3,7 +3,7 @@ , ($>) , void ) where-import "base" Data.Functor as Base+import Data.Functor as Base  #if !MIN_VERSION_base(4,7,0) import Control.Monad.Compat (void)
src/Data/Monoid/Compat.hs view
@@ -1,11 +1,29 @@ module Data.Monoid.Compat (-  module Base-, (<>)-) where-import "base" Data.Monoid as Base+        -- * Monoid typeclass+        Monoid(..),+        (<>),+        Dual(..),+        Endo(..),+        -- * Bool wrappers+        All(..),+        Any(..),+        -- * Num wrappers+        Sum(..),+        Product(..),+        -- * Maybe wrappers+        -- $MaybeExamples+        First(..),+        Last(..)+  ) where +import Data.Monoid as Base+ #if !MIN_VERSION_base(4,5,0)+infixr 6 <>+ -- | An infix synonym for 'mappend'.+--+-- /Since: 4.5.0.0/ (<>) :: Monoid m => m -> m -> m (<>) = mappend {-# INLINE (<>) #-}
src/Data/Traversable/Compat.hs view
@@ -3,7 +3,7 @@   module Base , Traversable(..) ) where-import "base" Data.Traversable as Base+import Data.Traversable as Base  #if !MIN_VERSION_base(4,7,0) import Data.Either (Either(..))
− src/GHC/Exception/Compat.hs
@@ -1,12 +0,0 @@-{-# LANGUAGE StandaloneDeriving #-}-{-# OPTIONS_GHC -fno-warn-orphans #-}-module GHC.Exception.Compat (-  module Base-) where-import "base" GHC.Exception as Base-import Control.Exception.ErrorCall.EqInstance ()--#if __GLASGOW_HASKELL__ <= 706-import Prelude-deriving instance Ord ErrorCall-#endif
src/Prelude/Compat.hs view
@@ -2,7 +2,7 @@   module Base ) where #if MIN_VERSION_base(4,6,0)-import "base" Prelude as Base+import Prelude as Base #else-import "base" Prelude as Base hiding (catch)+import Prelude as Base hiding (catch) #endif
+ src/System/Exit/Compat.hs view
@@ -0,0 +1,21 @@+{-# LANGUAGE CPP #-}+module System.Exit.Compat (+  ExitCode(..)+, exitWith+, exitFailure+, exitSuccess+, die+) where++import Prelude+import System.IO++import System.Exit++#if !MIN_VERSION_base(4,7,1)+-- | Write given error message to `stderr` and terminate with `exitFailure`.+--+-- /Since: 4.7.1.0/+die :: String -> IO a+die err = hPutStrLn stderr err >> exitFailure+#endif
src/Text/Read/Compat.hs view
@@ -1,17 +1,39 @@ module Text.Read.Compat (-  module Base-, readEither-, readMaybe-) where-import "base" Text.Read as Base+   -- * The 'Read' class+   Read(..),+   ReadS, +   -- * Haskell 2010 functions+   reads,+   read,+   readParen,+   lex,++   -- * New parsing functions+   module Text.ParserCombinators.ReadPrec,+   L.Lexeme(..),+   lexP,+   parens,+   readListDefault,+   readListPrecDefault,+   readEither,+   readMaybe++ ) where++import Text.Read+import Text.ParserCombinators.ReadPrec+import qualified Text.Read.Lex as L+ #if !MIN_VERSION_base(4,6,0)-import qualified Text.ParserCombinators.ReadP as P import Prelude+import qualified Text.ParserCombinators.ReadP as P  -- | Parse a string using the 'Read' instance. -- Succeeds if there is exactly one valid result. -- A 'Left' value indicates a parse error.+--+-- /Since: 4.6.0.0/ readEither :: Read a => String -> Either String a readEither s =   case [ x | (x,"") <- readPrec_to_S read' minPrec s ] of@@ -26,6 +48,8 @@  -- | Parse a string using the 'Read' instance. -- Succeeds if there is exactly one valid result.+--+-- /Since: 4.6.0.0/ readMaybe :: Read a => String -> Maybe a readMaybe s = case readEither s of                 Left _  -> Nothing