Hello community,
here is the log from the commit of package ghc-extra for openSUSE:Factory checked in at 2017-07-05 23:58:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-extra (Old)
and /work/SRC/openSUSE:Factory/.ghc-extra.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-extra"
Wed Jul 5 23:58:49 2017 rev:14 rq:506806 version:1.5.3
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-extra/ghc-extra.changes 2017-05-06 18:28:30.924845386 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-extra.new/ghc-extra.changes 2017-07-05 23:58:51.328707230 +0200
@@ -1,0 +2,5 @@
+Mon Jun 19 21:01:51 UTC 2017 - psimons@suse.com
+
+- Update to version 1.5.3.
+
+-------------------------------------------------------------------
Old:
----
extra-1.5.2.tar.gz
New:
----
extra-1.5.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-extra.spec ++++++
--- /var/tmp/diff_new_pack.3CaCWv/_old 2017-07-05 23:58:52.692515109 +0200
+++ /var/tmp/diff_new_pack.3CaCWv/_new 2017-07-05 23:58:52.704513420 +0200
@@ -19,7 +19,7 @@
%global pkg_name extra
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 1.5.2
+Version: 1.5.3
Release: 0
Summary: Extra functions I use
License: BSD-3-Clause
++++++ extra-1.5.2.tar.gz -> extra-1.5.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-1.5.2/CHANGES.txt new/extra-1.5.3/CHANGES.txt
--- old/extra-1.5.2/CHANGES.txt 2017-04-04 19:11:24.000000000 +0200
+++ new/extra-1.5.3/CHANGES.txt 2017-06-12 23:58:38.000000000 +0200
@@ -1,5 +1,7 @@
Changelog for Extra
+1.5.3
+ Add readMaybe, readEither
1.5.2
Add errorWithoutStackTrace to Control.Exception.Extra
1.5.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-1.5.2/Generate.hs new/extra-1.5.3/Generate.hs
--- old/extra-1.5.2/Generate.hs 2017-04-04 19:11:24.000000000 +0200
+++ new/extra-1.5.3/Generate.hs 2017-06-12 23:58:38.000000000 +0200
@@ -6,18 +6,18 @@
import Data.List.Extra
import System.IO.Extra
import Control.Monad.Extra
-import Control.Applicative
import System.FilePath
import System.Directory
import Data.Char
import Data.Maybe
+import Data.Functor
import Prelude
main :: IO ()
main = do
src <- readFile "extra.cabal"
- mods <- return $ filter (isSuffixOf ".Extra") $ map trim $ lines src
+ let mods = filter (isSuffixOf ".Extra") $ map trim $ lines src
ifaces <- forM mods $ \mod -> do
src <- readFile $ joinPath ("src" : split (== '.') mod) <.> "hs"
let funcs = filter validIdentifier $ takeWhile (/= "where") $
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-1.5.2/extra.cabal new/extra-1.5.3/extra.cabal
--- old/extra-1.5.2/extra.cabal 2017-04-04 19:11:24.000000000 +0200
+++ new/extra-1.5.3/extra.cabal 2017-06-12 23:58:38.000000000 +0200
@@ -1,7 +1,7 @@
cabal-version: >= 1.18
build-type: Simple
name: extra
-version: 1.5.2
+version: 1.5.3
license: BSD3
license-file: LICENSE
category: Development
@@ -58,6 +58,7 @@
System.IO.Extra
System.Process.Extra
System.Time.Extra
+ Text.Read.Extra
test-suite extra-test
type: exitcode-stdio-1.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-1.5.2/src/Control/Concurrent/Extra.hs new/extra-1.5.3/src/Control/Concurrent/Extra.hs
--- old/extra-1.5.2/src/Control/Concurrent/Extra.hs 2017-04-04 19:11:24.000000000 +0200
+++ new/extra-1.5.3/src/Control/Concurrent/Extra.hs 2017-06-12 23:58:38.000000000 +0200
@@ -28,6 +28,9 @@
import Control.Exception.Extra
import Control.Monad.Extra
import Data.Maybe
+import Data.Either.Extra
+import Data.Functor
+import Prelude
-- | On GHC 7.6 and above with the @-threaded@ flag, brackets a call to 'setNumCapabilities'.
@@ -133,7 +136,7 @@
-- | Create a new 'Lock'.
newLock :: IO Lock
-newLock = fmap Lock $ newMVar ()
+newLock = Lock <$> newMVar ()
-- | Perform some operation while holding 'Lock'. Will prevent all other
-- operations from using the 'Lock' while the action is ongoing.
@@ -224,7 +227,7 @@
-- | Write a value into the Barrier, releasing anyone at 'waitBarrier'.
-- Any subsequent attempts to signal the 'Barrier' will throw an exception.
signalBarrier :: Barrier a -> a -> IO ()
-signalBarrier (Barrier var) v = mask_ $ do -- use mask so never in an inconsistent state
+signalBarrier (Barrier var) v = mask_ $ -- use mask so never in an inconsistent state
join $ modifyVar var $ \x -> case x of
Left bar -> return (Right v, putMVar bar ())
Right res -> error "Control.Concurrent.Extra.signalBarrier, attempt to signal a barrier that has already been signaled"
@@ -247,4 +250,4 @@
-- | A version of 'waitBarrier' that never blocks, returning 'Nothing'
-- if the barrier has not yet been signaled.
waitBarrierMaybe :: Barrier a -> IO (Maybe a)
-waitBarrierMaybe (Barrier bar) = fmap (either (const Nothing) Just) $ readVar bar
+waitBarrierMaybe (Barrier bar) = eitherToMaybe <$> readVar bar
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-1.5.2/src/Control/Exception/Extra.hs new/extra-1.5.3/src/Control/Exception/Extra.hs
--- old/extra-1.5.2/src/Control/Exception/Extra.hs 2017-04-04 19:11:24.000000000 +0200
+++ new/extra-1.5.3/src/Control/Exception/Extra.hs 2017-06-12 23:58:38.000000000 +0200
@@ -20,6 +20,8 @@
import Control.Exception
import Control.Monad
import Data.List.Extra
+import Data.Functor
+import Prelude
-- | Fully evaluate an input String. If the String contains embedded exceptions it will produce @\@.
@@ -34,7 +36,7 @@
case r of
Left e -> return "<Exception>"
Right [] -> return []
- Right (x:xs) -> fmap (x:) $ stringException xs
+ Right (x:xs) -> (x:) <$> stringException xs
-- | Show a value, but if the result contains exceptions, produce
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-1.5.2/src/Control/Monad/Extra.hs new/extra-1.5.3/src/Control/Monad/Extra.hs
--- old/extra-1.5.2/src/Control/Monad/Extra.hs 2017-04-04 19:11:24.000000000 +0200
+++ new/extra-1.5.3/src/Control/Monad/Extra.hs 2017-06-12 23:58:38.000000000 +0200
@@ -1,4 +1,3 @@
-{-# LANGUAGE UnboxedTuples #-}
-- | Extra functions for "Control.Monad".
-- These functions provide looping, list operations and booleans.
@@ -18,8 +17,8 @@
) where
import Control.Monad
-import Control.Applicative
import Data.Maybe
+import Control.Applicative
import Data.Monoid
import Prelude
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-1.5.2/src/Data/IORef/Extra.hs new/extra-1.5.3/src/Data/IORef/Extra.hs
--- old/extra-1.5.2/src/Data/IORef/Extra.hs 2017-04-04 19:11:24.000000000 +0200
+++ new/extra-1.5.3/src/Data/IORef/Extra.hs 2017-06-12 23:58:38.000000000 +0200
@@ -46,7 +46,7 @@
-- 'atomicModifyIORef' has.
atomicWriteIORef :: IORef a -> a -> IO ()
atomicWriteIORef ref a = do
- x <- atomicModifyIORef ref (\_ -> (a, ()))
+ x <- atomicModifyIORef ref $ const (a, ())
x `seq` return ()
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-1.5.2/src/Data/List/Extra.hs new/extra-1.5.3/src/Data/List/Extra.hs
--- old/extra-1.5.2/src/Data/List/Extra.hs 2017-04-04 19:11:24.000000000 +0200
+++ new/extra-1.5.3/src/Data/List/Extra.hs 2017-06-12 23:58:38.000000000 +0200
@@ -28,13 +28,13 @@
replace, merge, mergeBy,
) where
-import Control.Applicative
import Data.List
import Data.Maybe
import Data.Function
import Data.Char
import Data.Tuple.Extra
import Data.Monoid
+import Data.Functor
import Prelude
@@ -510,7 +510,7 @@
-- > stripSuffix "" "baz" == Just "baz"
-- > stripSuffix "foo" "quux" == Nothing
stripSuffix :: Eq a => [a] -> [a] -> Maybe [a]
-stripSuffix a b = fmap reverse $ stripPrefix (reverse a) (reverse b)
+stripSuffix a b = reverse <$> stripPrefix (reverse a) (reverse b)
-- | Return the the string before and after the search string,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-1.5.2/src/Extra.hs new/extra-1.5.3/src/Extra.hs
--- old/extra-1.5.2/src/Extra.hs 2017-04-04 19:11:24.000000000 +0200
+++ new/extra-1.5.3/src/Extra.hs 2017-06-12 23:58:38.000000000 +0200
@@ -54,6 +54,9 @@
-- * System.Time.Extra
-- | Extra functions available in @"System.Time.Extra"@.
Seconds, sleep, timeout, subtractTime, showDuration, offsetTime, offsetTimeIncrease, duration,
+ -- * Text.Read.Extra
+ -- | Extra functions available in @"Text.Read.Extra"@.
+ readEither, readMaybe,
) where
import Control.Concurrent.Extra
@@ -72,3 +75,4 @@
import System.IO.Extra
import System.Process.Extra
import System.Time.Extra
+import Text.Read.Extra
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-1.5.2/src/System/Environment/Extra.hs new/extra-1.5.3/src/System/Environment/Extra.hs
--- old/extra-1.5.2/src/System/Environment/Extra.hs 2017-04-04 19:11:24.000000000 +0200
+++ new/extra-1.5.3/src/System/Environment/Extra.hs 2017-06-12 23:58:38.000000000 +0200
@@ -13,6 +13,7 @@
#if __GLASGOW_HASKELL__ < 706
import Control.Exception.Extra
import System.IO.Error
+import Data.Functor
-- | Alias for 'getProgName' in GHC 7.4 and below, otherwise
-- returns the absolute pathname of the current executable.
@@ -21,5 +22,5 @@
-- | Return the value of the environment variable var, or Nothing if there is no such value.
lookupEnv :: String -> IO (Maybe String)
-lookupEnv x = catchBool isDoesNotExistError (fmap Just $ getEnv x) (const $ return Nothing)
+lookupEnv x = catchBool isDoesNotExistError (Just <$> getEnv x) (const $ return Nothing)
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-1.5.2/src/System/Process/Extra.hs new/extra-1.5.3/src/System/Process/Extra.hs
--- old/extra-1.5.2/src/System/Process/Extra.hs 2017-04-04 19:11:24.000000000 +0200
+++ new/extra-1.5.3/src/System/Process/Extra.hs 2017-06-12 23:58:38.000000000 +0200
@@ -11,6 +11,8 @@
import System.IO.Extra
import System.Process
import System.Exit
+import Data.Functor
+import Prelude
-- | A version of 'system' that also captures the output, both 'stdout' and 'stderr'.
@@ -20,7 +22,7 @@
exit <- withFile file WriteMode $ \h -> do
(_, _, _, pid) <- createProcess (shell x){std_out=UseHandle h, std_err=UseHandle h}
waitForProcess pid
- fmap (exit,) $ readFile' file
+ (exit,) <$> readFile' file
-- | A version of 'system' that throws an error if the 'ExitCode' is not 'ExitSuccess'.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-1.5.2/src/System/Time/Extra.hs new/extra-1.5.3/src/System/Time/Extra.hs
--- old/extra-1.5.2/src/System/Time/Extra.hs 2017-04-04 19:11:24.000000000 +0200
+++ new/extra-1.5.3/src/System/Time/Extra.hs 2017-06-12 23:58:38.000000000 +0200
@@ -68,7 +68,7 @@
handleBool (== ex)
(const $ return Nothing)
(bracket (forkIOWithUnmask $ \unmask -> unmask $ sleep n >> throwTo pid ex)
- (killThread)
+ killThread
(\_ -> fmap Just f))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-1.5.2/src/Text/Read/Extra.hs new/extra-1.5.3/src/Text/Read/Extra.hs
--- old/extra-1.5.2/src/Text/Read/Extra.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/extra-1.5.3/src/Text/Read/Extra.hs 2017-06-12 23:58:38.000000000 +0200
@@ -0,0 +1,38 @@
+{-# LANGUAGE CPP #-}
+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
+
+-- | This module provides "Text.Read" with functions added in later versions.
+module Text.Read.Extra(
+ module Text.Read,
+ readEither, readMaybe
+ ) where
+
+import Text.Read
+
+#if __GLASGOW_HASKELL__ < 706
+
+import 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.
+readEither :: Read a => String -> Either String a
+readEither s =
+ case [ x | (x,"") <- readPrec_to_S read' minPrec s ] of
+ [x] -> Right x
+ [] -> Left "Prelude.read: no parse"
+ _ -> Left "Prelude.read: ambiguous parse"
+ where
+ read' =
+ do x <- readPrec
+ lift P.skipSpaces
+ return x
+
+-- | Parse a string using the 'Read' instance.
+-- Succeeds if there is exactly one valid result.
+readMaybe :: Read a => String -> Maybe a
+readMaybe s = case readEither s of
+ Left _ -> Nothing
+ Right a -> Just a
+
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extra-1.5.2/test/TestUtil.hs new/extra-1.5.3/test/TestUtil.hs
--- old/extra-1.5.2/test/TestUtil.hs 2017-04-04 19:11:24.000000000 +0200
+++ new/extra-1.5.3/test/TestUtil.hs 2017-06-12 23:58:38.000000000 +0200
@@ -54,7 +54,9 @@
erroneousIO x = unsafePerformIO $ fmap isLeft $ try_ $ evaluate . length . show =<< x
(====) :: (Show a, Eq a) => a -> a -> Bool
-a ==== b = if a == b then True else error $ "Not equal!\n" ++ show a ++ "\n" ++ show b
+a ==== b
+ | a == b = True
+ | otherwise = error $ "Not equal!\n" ++ show a ++ "\n" ++ show b
#if __GLASGOW_HASKELL__ < 707
instance Eq ErrorCall where
@@ -101,4 +103,4 @@
arbitrary = fmap ModifiedJulianDay arbitrary
instance Arbitrary DiffTime where
- arbitrary = fmap realToFrac $ choose (0 :: Double, 86401)
+ arbitrary = realToFrac <$> choose (0 :: Double, 86401)