acme-missiles 0.2 → 0.2.1
raw patch · 2 files changed
+11/−5 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Acme/Missiles.hs +10/−4
- acme-missiles.cabal +1/−1
Acme/Missiles.hs view
@@ -35,7 +35,11 @@ (\_ -> action) where doLaunching = forever $ do- atomically $ takeTMVar missileCommand+ atomically $ do+ n <- readTVar missileCommand+ if n > 0+ then writeTVar missileCommand (n - 1)+ else retry launchMissiles -- | Launch missiles within an 'STM' computation. Even if the memory@@ -59,8 +63,10 @@ -- > else return () -- > threadDelay 100000 launchMissilesSTM :: STM ()-launchMissilesSTM = putTMVar missileCommand ()+launchMissilesSTM = do+ n <- readTVar missileCommand+ writeTVar missileCommand $! n + 1 -missileCommand :: TMVar ()+missileCommand :: TVar Integer {-# NOINLINE missileCommand #-}-missileCommand = unsafePerformIO newEmptyTMVarIO+missileCommand = unsafePerformIO (newTVarIO 0)
acme-missiles.cabal view
@@ -1,5 +1,5 @@ name: acme-missiles-version: 0.2+version: 0.2.1 synopsis: Cause serious international side effects. description: The highly effectful 'launchMissiles' action, as mentioned in /Beautiful concurrency/,