dejafu 0.7.1.1 → 0.7.1.2
raw patch · 6 files changed
+163/−50 lines, 6 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Test.DejaFu.STM.Internal: type M n r a = Cont (STMAction n r) a
+ Test.DejaFu.Common: MonadFailException :: String -> MonadFailException
+ Test.DejaFu.Common: instance GHC.Exception.Exception Test.DejaFu.Common.MonadFailException
+ Test.DejaFu.Common: instance GHC.Show.Show Test.DejaFu.Common.MonadFailException
+ Test.DejaFu.Common: newtype MonadFailException
+ Test.DejaFu.Conc.Internal.Common: instance Control.Monad.Fail.MonadFail (Test.DejaFu.Conc.Internal.Common.M n r)
+ Test.DejaFu.STM.Internal: M :: ((a -> STMAction n r) -> STMAction n r) -> M n r a
+ Test.DejaFu.STM.Internal: [runM] :: M n r a -> (a -> STMAction n r) -> STMAction n r
+ Test.DejaFu.STM.Internal: cont :: ((a -> STMAction n r) -> STMAction n r) -> M n r a
+ Test.DejaFu.STM.Internal: instance Control.Monad.Fail.MonadFail (Test.DejaFu.STM.Internal.M n r)
+ Test.DejaFu.STM.Internal: instance GHC.Base.Applicative (Test.DejaFu.STM.Internal.M n r)
+ Test.DejaFu.STM.Internal: instance GHC.Base.Functor (Test.DejaFu.STM.Internal.M n r)
+ Test.DejaFu.STM.Internal: instance GHC.Base.Monad (Test.DejaFu.STM.Internal.M n r)
+ Test.DejaFu.STM.Internal: newtype M n r a
+ Test.DejaFu.STM.Internal: runCont :: M n r a -> (a -> STMAction n r) -> STMAction n r
Files
- CHANGELOG.markdown +102/−42
- Test/DejaFu/Common.hs +8/−1
- Test/DejaFu/Conc/Internal/Common.hs +14/−1
- Test/DejaFu/STM.hs +0/−1
- Test/DejaFu/STM/Internal.hs +37/−3
- dejafu.cabal +2/−2
CHANGELOG.markdown view
@@ -7,10 +7,30 @@ *de facto* standard Haskell versioning scheme. -0.7.1.1 [2017-08-16] (git tag: [dejafu-0.7.1.1][])+0.7.1.2+----------++- **Date** 2017-08-21+- **Git tag** [dejafu-0.7.1.2][]+- **Hackage** https://hackage.haskell.org/package/dejafu-0.7.1.2++### Miscellaneous++- Errors thrown with `Control.Monad.fail` no longer terminate testing, and are now correctly treated+ as asynchronous exceptions.++[dejafu-0.7.1.2]: https://github.com/barrucadu/dejafu/releases/tag/dejafu-0.7.1.2+++---------------------------------------------------------------------------------------------------+++0.7.1.1 ------- -https://hackage.haskell.org/package/dejafu-0.7.1.1+- **Date** 2017-08-16+- **Git tag** [dejafu-0.7.1.1][]+- **Hackage** https://hackage.haskell.org/package/dejafu-0.7.1.1 ### Miscellaneous @@ -26,10 +46,12 @@ --------------------------------------------------------------------------------------------------- -0.7.1.0 [2017-08-10] (git tag: [dejafu-0.7.1.0][])+0.7.1.0 ------- -https://hackage.haskell.org/package/dejafu-0.7.1.0+- **Date** 2017-08-10+- **Git tag** [dejafu-0.7.1.0][]+- **Hackage** https://hackage.haskell.org/package/dejafu-0.7.1.0 ### Test.DejaFu @@ -60,10 +82,12 @@ --------------------------------------------------------------------------------------------------- -0.7.0.2 [2017-06-12] (git tag: [dejafu-0.7.0.2][])+0.7.0.2 ------- -https://hackage.haskell.org/package/dejafu-0.7.0.2+- **Date** 2017-06-12+- **Git tag** [dejafu-0.7.0.2][]+- **Hackage** https://hackage.haskell.org/package/dejafu-0.7.0.2 ### Test.DejaFu.Refinement @@ -81,10 +105,12 @@ --------------------------------------------------------------------------------------------------- -0.7.0.1 [2017-06-09] (git tag: [dejafu-0.7.0.1][])+0.7.0.1 ------- -https://hackage.haskell.org/package/dejafu-0.7.0.1+- **Date** 2017-06-09+- **Git tag** [dejafu-0.7.0.1][]+- **Hackage** https://hackage.haskell.org/package/dejafu-0.7.0.1 ### Test.DejaFu.Refinement @@ -98,10 +124,12 @@ --------------------------------------------------------------------------------------------------- -0.7.0.0 [2017-06-07] (git tag: [dejafu-0.7.0.0][])+0.7.0.0 ------- -https://hackage.haskell.org/package/dejafu-0.7.0.0+- **Date** 2017-06-07+- **Git tag** [dejafu-0.7.0.0][]+- **Hackage** https://hackage.haskell.org/package/dejafu-0.7.0.0 ### Test.DejaFu @@ -145,10 +173,12 @@ --------------------------------------------------------------------------------------------------- -0.6.0.0 [2017-04-08] (git tag: [dejafu-0.6.0.0][])+0.6.0.0 ------- -https://hackage.haskell.org/package/dejafu-0.6.0.0+- **Date** 2017-04-08+- **Git tag** [dejafu-0.6.0.0][]+- **Hackage** https://hackage.haskell.org/package/dejafu-0.6.0.0 ### Test.DejaFu.Conc @@ -176,10 +206,12 @@ --------------------------------------------------------------------------------------------------- -0.5.1.3 [2017-04-05] (git tag: [dejafu-0.5.1.3][])+0.5.1.3 ------- -https://hackage.haskell.org/package/dejafu-0.5.1.3+- **Date** 2017-04-05+- **Git tag** [dejafu-0.5.1.3][]+- **Hackage** https://hackage.haskell.org/package/dejafu-0.5.1.3 ### Miscellaneous @@ -191,10 +223,12 @@ --------------------------------------------------------------------------------------------------- -0.5.1.2 [2017-03-04] (git tag: [dejafu-0.5.1.2][])+0.5.1.2 ------- -https://hackage.haskell.org/package/dejafu-0.5.1.2+- **Date** 2017-03-04+- **Git tag** [dejafu-0.5.1.2][]+- **Hackage** https://hackage.haskell.org/package/dejafu-0.5.1.2 **This version was misnumbered! It should have caused a minor version bump!** @@ -217,10 +251,12 @@ --------------------------------------------------------------------------------------------------- -0.5.1.1 [2017-02-25] (git tag: [dejafu-0.5.1.1][])+0.5.1.1 ------- -https://hackage.haskell.org/package/dejafu-0.5.1.1+- **Date** 2017-02-25+- **Git tag** [dejafu-0.5.1.1][]+- **Hackage** https://hackage.haskell.org/package/dejafu-0.5.1.1 ### Fixed @@ -234,10 +270,12 @@ --------------------------------------------------------------------------------------------------- -0.5.1.0 [2017-02-25] (git tag: [dejafu-0.5.1.0][])+0.5.1.0 ------- -https://hackage.haskell.org/package/dejafu-0.5.1.0+- **Date** 2017-02-25+- **Git tag** [dejafu-0.5.1.0][]+- **Hackage** https://hackage.haskell.org/package/dejafu-0.5.1.0 ### Test.DejaFu @@ -265,10 +303,12 @@ --------------------------------------------------------------------------------------------------- -0.5.0.2 [2017-02-22] (git tag: [dejafu-0.5.0.2][])+0.5.0.2 ------- -https://hackage.haskell.org/package/dejafu-0.5.0.2+- **Date** 2017-02-22+- **Git tag** [dejafu-0.5.0.2][]+- **Hackage** https://hackage.haskell.org/package/dejafu-0.5.0.2 **This version was misnumbered! It should have caused a major version bump!** @@ -295,10 +335,12 @@ --------------------------------------------------------------------------------------------------- -0.5.0.1 [2017-02-21] (git tag: [dejafu-0.5.0.1][])+0.5.0.1 ------- -**This version was never pushed to hackage, whoops!**+- **Date** 2017-02-21+- **Git tag** [dejafu-0.5.0.1][]+- **This version was never pushed to hackage, whoops!** ### Fixed @@ -310,10 +352,12 @@ --------------------------------------------------------------------------------------------------- -0.5.0.0 [2017-02-21] (git tag: [dejafu-0.5.0.0][])+0.5.0.0 ------- -https://hackage.haskell.org/package/dejafu-0.5.0.0+- **Date** 2017-02-21+- **Git tag** [dejafu-0.5.0.0][]+- **Hackage** https://hackage.haskell.org/package/dejafu-0.5.0.0 ### Test.DejaFu @@ -356,10 +400,12 @@ --------------------------------------------------------------------------------------------------- -0.4.0.0 [2016-09-10] (git tag: [dejafu-0.4.0.0][])+0.4.0.0 ------- -https://hackage.haskell.org/package/dejafu-0.4.0.0+- **Date** 2016-09-10+- **Git tag** [dejafu-0.4.0.0][]+- **Hackage** https://hackage.haskell.org/package/dejafu-0.4.0.0 ### Test.DejaFu @@ -403,10 +449,12 @@ --------------------------------------------------------------------------------------------------- -0.3.2.1 [2016-07-21] (git tag: [dejafu-0.3.2.1][])+0.3.2.1 ------- -https://hackage.haskell.org/package/dejafu-0.3.2.1+- **Date** 2016-07-21+- **Git tag** [dejafu-0.3.2.1][]+- **Hackage** https://hackage.haskell.org/package/dejafu-0.3.2.1 ### Fixed @@ -419,10 +467,12 @@ --------------------------------------------------------------------------------------------------- -0.3.2.0 [2016-06-06] (git tag: [dejafu-0.3.2.0][])+0.3.2.0 ------- -https://hackage.haskell.org/package/dejafu-0.3.2.0+- **Date** 2016-06-06+- **Git tag** [dejafu-0.3.2.0][]+- **Hackage** https://hackage.haskell.org/package/dejafu-0.3.2.0 **Builds with both dpor-0.1 and dpor-0.2, however some improvements require dpor-0.2.** @@ -444,10 +494,12 @@ --------------------------------------------------------------------------------------------------- -0.3.1.1 [2016-05-26] (git tag: [dejafu-0.3.1.1][])+0.3.1.1 ------- -https://hackage.haskell.org/package/dejafu-0.3.1.1+- **Date** 2016-05-26+- **Git tag** [dejafu-0.3.1.1][]+- **Hackage** https://hackage.haskell.org/package/dejafu-0.3.1.1 ### Miscellaneous @@ -459,10 +511,12 @@ --------------------------------------------------------------------------------------------------- -0.3.1.0 [2016-05-02] (git tag: [dejafu-0.3.1.0][])+0.3.1.0 ------- -https://hackage.haskell.org/package/dejafu-0.3.1.0+- **Date** 2016-05-02+- **Git tag** [dejafu-0.3.1.0][]+- **Hackage** https://hackage.haskell.org/package/dejafu-0.3.1.0 ### Fixed @@ -475,10 +529,12 @@ --------------------------------------------------------------------------------------------------- -0.3.0.0 [2016-04-03] (git tag: [dejafu-0.3.0.0][])+0.3.0.0 ------- -https://hackage.haskell.org/package/dejafu-0.3.0.0+- **Date** 2016-04-03+- **Git tag** [dejafu-0.3.0.0][]+- **Hackage** https://hackage.haskell.org/package/dejafu-0.3.0.0 **The minimum supported version of GHC is now 7.10.** @@ -491,10 +547,12 @@ --------------------------------------------------------------------------------------------------- -0.2.0.0 [2015-12-01] (git tag: [0.2.0.0][])+0.2.0.0 ------- -https://hackage.haskell.org/package/dejafu-0.2.0.0+- **Date** 2015-12-01+- **Git tag** [0.2.0.0][]+- **Hackage** https://hackage.haskell.org/package/dejafu-0.2.0.0 I didn't write proper release notes, and this is so far back I don't really care to dig through the logs.@@ -505,10 +563,12 @@ --------------------------------------------------------------------------------------------------- -0.1.0.0 [2015-08-27] (git tag: [0.1.0.0][])+0.1.0.0 ------- -https://hackage.haskell.org/package/dejafu-0.1.0.0+- **Date** 2015-08-27+- **Git tag** [0.1.0.0][]+- **Hackage** https://hackage.haskell.org/package/dejafu-0.1.0.0 Initial release. Go read the API docs.
Test/DejaFu/Common.hs view
@@ -58,11 +58,12 @@ , MemType(..) -- * Miscellaneous+ , MonadFailException(..) , runRefCont ) where import Control.DeepSeq (NFData(..))-import Control.Exception (MaskingState(..))+import Control.Exception (Exception(..), MaskingState(..)) import Control.Monad.Ref (MonadRef(..)) import Data.List (intercalate, nub, sort) import Data.List.NonEmpty (NonEmpty)@@ -865,6 +866,12 @@ ------------------------------------------------------------------------------- -- Miscellaneous++-- | An exception for errors in testing caused by use of 'fail'.+newtype MonadFailException = MonadFailException String+ deriving Show++instance Exception MonadFailException -- | Run with a continuation that writes its value into a reference, -- returning the computation and the reference. Using the reference
Test/DejaFu/Conc/Internal/Common.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE RankNTypes #-} @@ -7,7 +8,7 @@ -- License : MIT -- Maintainer : Michael Walker <mike@barrucadu.co.uk> -- Stability : experimental--- Portability : ExistentialQuantification, RankNTypes+-- Portability : CPP, ExistentialQuantification, RankNTypes -- -- Common types and utility functions for deterministic execution of -- 'MonadConc' implementations. This module is NOT considered to form@@ -19,6 +20,10 @@ import Test.DejaFu.Common import Test.DejaFu.STM (STMLike) +#if MIN_VERSION_base(4,9,0)+import qualified Control.Monad.Fail as Fail+#endif+ -------------------------------------------------------------------------------- -- * The @Conc@ Monad @@ -42,6 +47,14 @@ instance Monad (M n r) where return = pure m >>= k = M $ \c -> runM m (\x -> runM (k x) c)++#if MIN_VERSION_base(4,9,0)+ fail = Fail.fail++-- | @since 0.7.1.2+instance Fail.MonadFail (M n r) where+#endif+ fail e = cont (\_ -> AThrow (MonadFailException e)) -- | The concurrent variable type used with the 'Conc' monad. One -- notable difference between these and 'MVar's is that 'MVar's are
Test/DejaFu/STM.hs view
@@ -28,7 +28,6 @@ import Control.Monad (unless) import Control.Monad.Catch (MonadCatch(..), MonadThrow(..))-import Control.Monad.Cont (cont) import Control.Monad.Ref (MonadRef) import Control.Monad.ST (ST) import Data.IORef (IORef)
Test/DejaFu/STM/Internal.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-}@@ -8,7 +9,7 @@ -- License : MIT -- Maintainer : Michael Walker <mike@barrucadu.co.uk> -- Stability : experimental--- Portability : ExistentialQuantification, RankNTypes+-- Portability : CPP, ExistentialQuantification, MultiParamTypeClasses, RankNTypes -- -- 'MonadSTM' testing implementation, internal types and -- definitions. This module is NOT considered to form part of the@@ -18,18 +19,51 @@ import Control.DeepSeq (NFData(..)) import Control.Exception (Exception, SomeException, fromException, toException)-import Control.Monad.Cont (Cont, runCont) import Control.Monad.Ref (MonadRef, newRef, readRef, writeRef) import Data.List (nub) import Test.DejaFu.Common +#if MIN_VERSION_base(4,9,0)+import qualified Control.Monad.Fail as Fail+#endif+ -------------------------------------------------------------------------------- -- The @STMLike@ monad -- | The underlying monad is based on continuations over primitive -- actions.-type M n r a = Cont (STMAction n r) a+--+-- This is not @Cont@ because we want to give it a custom @MonadFail@+-- instance.+newtype M n r a = M { runM :: (a -> STMAction n r) -> STMAction n r }++instance Functor (M n r) where+ fmap f m = M $ \ c -> runM m (c . f)++instance Applicative (M n r) where+ pure x = M $ \c -> c x+ f <*> v = M $ \c -> runM f (\g -> runM v (c . g))++instance Monad (M n r) where+ return = pure+ m >>= k = M $ \c -> runM m (\x -> runM (k x) c)++#if MIN_VERSION_base(4,9,0)+ fail = Fail.fail++-- | @since 0.7.1.2+instance Fail.MonadFail (M n r) where+#endif+ fail e = cont (\_ -> SThrow (MonadFailException e))++-- | Construct a continuation-passing operation from a function.+cont :: ((a -> STMAction n r) -> STMAction n r) -> M n r a+cont = M++-- | Run a CPS computation with the given final computation.+runCont :: M n r a -> (a -> STMAction n r) -> STMAction n r+runCont = runM -------------------------------------------------------------------------------- -- * Primitive actions
dejafu.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: dejafu-version: 0.7.1.1+version: 0.7.1.2 synopsis: Systematic testing for Haskell concurrency. description:@@ -37,7 +37,7 @@ source-repository this type: git location: https://github.com/barrucadu/dejafu.git- tag: dejafu-0.7.1.1+ tag: dejafu-0.7.1.2 library exposed-modules: Test.DejaFu