mirror of
https://github.com/composewell/streamly.git
synced 2024-09-11 19:47:10 +03:00
Fix build for ghc-7.10 and 8.0
This commit is contained in:
parent
96dca8eacd
commit
dfecce27eb
@ -2,6 +2,7 @@ resolver: lts-9.20
|
||||
packages:
|
||||
- '.'
|
||||
extra-deps:
|
||||
- QuickCheck-2.10
|
||||
- lockfree-queue-0.2.3.1
|
||||
- simple-conduit-0.6.0
|
||||
- SDL-0.6.5.1
|
||||
|
@ -64,6 +64,7 @@ extra-source-files:
|
||||
README.md
|
||||
bench.sh
|
||||
stack-7.10.yaml
|
||||
stack-8.0.yaml
|
||||
stack.yaml
|
||||
|
||||
source-repository head
|
||||
|
18
test/Prop.hs
18
test/Prop.hs
@ -7,7 +7,6 @@ import Control.Monad (when)
|
||||
import Control.Applicative (ZipList(..))
|
||||
import Control.Concurrent (MVar, takeMVar, putMVar, newEmptyMVar)
|
||||
import Control.Monad (replicateM, replicateM_)
|
||||
import Control.Monad.IO.Class (liftIO)
|
||||
import Data.List (sort, foldl', scanl')
|
||||
import GHC.Word (Word8)
|
||||
|
||||
@ -121,7 +120,7 @@ sourceUnfoldrM mv n = A.unfoldrM step 0
|
||||
if cnt > fromIntegral n
|
||||
then return Nothing
|
||||
else do
|
||||
liftIO $ dbgMVar ("put sourceUnfoldrM " ++ msg) (putMVar mv ())
|
||||
dbgMVar ("put sourceUnfoldrM " ++ msg) (putMVar mv ())
|
||||
return (Just (fromIntegral cnt, cnt + 1))
|
||||
|
||||
concurrentUnfoldrM
|
||||
@ -142,15 +141,16 @@ concurrentUnfoldrM eq op n =
|
||||
A.toList $ do
|
||||
x <- op (sourceUnfoldrM mv n)
|
||||
let msg = show x ++ "/" ++ show n
|
||||
if even x
|
||||
then do
|
||||
liftIO $ dbgMVar ("first take concurrentUnfoldrM " ++ msg)
|
||||
(takeMVar mv)
|
||||
if n > x
|
||||
then liftIO $ dbgMVar ("second take concurrentUnfoldrM " ++ msg)
|
||||
A.once $ do
|
||||
if even x
|
||||
then do
|
||||
dbgMVar ("first take concurrentUnfoldrM " ++ msg)
|
||||
(takeMVar mv)
|
||||
if n > x
|
||||
then dbgMVar ("second take concurrentUnfoldrM " ++ msg)
|
||||
(takeMVar mv)
|
||||
else return ()
|
||||
else return ()
|
||||
else return ()
|
||||
return x
|
||||
equals eq stream list
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user