Hello community,

here is the log from the commit of package ghc-async for openSUSE:Factory 
checked in at 2015-05-21 08:11:03
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-async (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-async.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-async"

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-async/ghc-async.changes      2014-11-26 
20:54:36.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-async.new/ghc-async.changes 2015-05-21 
08:11:04.000000000 +0200
@@ -1,0 +2,7 @@
+Mon Apr 13 07:36:06 UTC 2015 - mimi...@gmail.com
+
+- update to 2.0.2
+* Add a Monad instance for Concurrently * Bump base dependency to allow 4.9
+* Add workaround to waitCatch for #14
+
+-------------------------------------------------------------------

Old:
----
  async-2.0.1.5.tar.gz

New:
----
  async-2.0.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-async.spec ++++++
--- /var/tmp/diff_new_pack.uNz7v4/_old  2015-05-21 08:11:05.000000000 +0200
+++ /var/tmp/diff_new_pack.uNz7v4/_new  2015-05-21 08:11:05.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package ghc-async
 #
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
 %global pkg_name async
 
 Name:           ghc-async
-Version:        2.0.1.5
+Version:        2.0.2
 Release:        0
 Summary:        Run IO operations asynchronously and wait for their results
 License:        BSD-3-Clause

++++++ async-2.0.1.5.tar.gz -> async-2.0.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/async-2.0.1.5/Control/Concurrent/Async.hs 
new/async-2.0.2/Control/Concurrent/Async.hs
--- old/async-2.0.1.5/Control/Concurrent/Async.hs       2013-12-16 
08:50:40.000000000 +0100
+++ new/async-2.0.2/Control/Concurrent/Async.hs 2014-12-22 12:32:14.000000000 
+0100
@@ -92,7 +92,7 @@
     -- ** Spawning with automatic 'cancel'ation
     withAsync, withAsyncBound, withAsyncOn, withAsyncWithUnmask, 
withAsyncOnWithUnmask,
 
-    -- ** Quering 'Async's
+    -- ** Querying 'Async's
     wait, poll, waitCatch, cancel, cancelWith,
     asyncThreadId,
 
@@ -246,7 +246,10 @@
 --
 {-# INLINE waitCatch #-}
 waitCatch :: Async a -> IO (Either SomeException a)
-waitCatch = atomically . waitCatchSTM
+waitCatch = tryAgain . atomically . waitCatchSTM
+  where
+    -- See: https://github.com/simonmar/async/issues/14
+    tryAgain f = f `catch` \BlockedIndefinitelyOnSTM -> f
 
 -- | Check whether an 'Async' has completed yet.  If it has not
 -- completed yet, then the result is @Nothing@, otherwise the result
@@ -568,6 +571,11 @@
   Concurrently as <|> Concurrently bs =
     Concurrently $ either id id <$> race as bs
 
+instance Monad Concurrently where
+  return = pure
+  Concurrently a >>= f =
+    Concurrently $ a >>= runConcurrently . f
+
 -- ----------------------------------------------------------------------------
 
 -- | Fork a thread that runs the supplied action, and if it raises an
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/async-2.0.1.5/async.cabal new/async-2.0.2/async.cabal
--- old/async-2.0.1.5/async.cabal       2013-12-16 08:50:40.000000000 +0100
+++ new/async-2.0.2/async.cabal 2014-12-22 12:32:14.000000000 +0100
@@ -22,6 +22,15 @@
    threads that are automatically killed when
    their parent dies (see 'withAsync').
  .
+ Changes in 2.0.2:
+ .
+ * Add a Monad instance for Concurrently
+ * Bump base dependency to allow 4.9
+ .
+ Changes in 2.0.1.6:
+ .
+ * Add workaround to waitCatch for #14
+ .
  Changes in 2.0.1.5:
  .
  * Bump @base@ dependencies for GHC 7.8
@@ -52,7 +61,7 @@
  .
  * Added @Concurrently@ (with @Applicative@ and @Alternative@ instances)
 
-version:             2.0.1.5
+version:             2.0.2
 license:             BSD3
 license-file:        LICENSE
 author:              Simon Marlow
@@ -74,13 +83,13 @@
 
 library
     exposed-modules:     Control.Concurrent.Async
-    build-depends:       base >= 4.3 && < 4.8, stm >= 2.2 && < 2.5
+    build-depends:       base >= 4.3 && < 4.9, stm >= 2.2 && < 2.5
 
 test-suite test-async
     type:       exitcode-stdio-1.0
     hs-source-dirs: test
     main-is:    test-async.hs
-    build-depends: base >= 4.3 && < 4.8,
+    build-depends: base >= 4.3 && < 4.9,
                    async,
                    test-framework,
                    test-framework-hunit,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/async-2.0.1.5/test/test-async.hs 
new/async-2.0.2/test/test-async.hs
--- old/async-2.0.1.5/test/test-async.hs        2013-12-16 08:50:40.000000000 
+0100
+++ new/async-2.0.2/test/test-async.hs  2014-12-22 12:32:14.000000000 +0100
@@ -29,6 +29,7 @@
          testCase "async_cancel"       async_cancel
   , testCase "async_poll"        async_poll
   , testCase "async_poll2"       async_poll2
+  , testCase "withasync_waitCatch_blocked" withasync_waitCatch_blocked
  ]
 
 value = 42 :: Int
@@ -104,3 +105,13 @@
   when (isNothing r) $ assertFailure ""
   r <- poll a   -- poll twice, just to check we don't deadlock
   when (isNothing r) $ assertFailure ""
+
+withasync_waitCatch_blocked :: Assertion
+withasync_waitCatch_blocked = do
+  r <- withAsync (newEmptyMVar >>= takeMVar) waitCatch
+  case r of
+    Left e ->
+        case fromException e of
+            Just BlockedIndefinitelyOnMVar -> return ()
+            Nothing -> assertFailure $ show e
+    Right () -> assertFailure ""


Reply via email to