@@ -15,9 +15,7 @@ module Streamly.Test.Prelude.Common
15 , constructWithReplicate
15 , constructWithReplicate
16 , constructWithReplicateM
16 , constructWithReplicateM
17 , constructWithIntFromThenTo
17 , constructWithIntFromThenTo
18−#if __GLASGOW_HASKELL__ >= 806
19 , constructWithDoubleFromThenTo
18 , constructWithDoubleFromThenTo
21 , constructWithIterate
19 , constructWithIterate
22 , constructWithIterateM
20 , constructWithIterateM
23 , constructWithEnumerate
21 , constructWithEnumerate
@@ -221,7 +219,6 @@ constructWithRepeatM = constructWithLenM stream list
221 stream n = S.take n $ S.repeatM (return 1)
219 stream n = S.take n $ S.repeatM (return 1)
222 list n = return $ replicate n 1
220 list n = return $ replicate n 1
224−#if __GLASGOW_HASKELL__ >= 806
225-- XXX try very small steps close to 0
222-- XXX try very small steps close to 0
226constructWithDoubleFromThenTo
223constructWithDoubleFromThenTo
227 :: IsStream t
224 :: IsStream t
@@ -235,7 +232,6 @@ constructWithDoubleFromThenTo op l =
235 let list len = take len [from,next..to]
232 let list len = take len [from,next..to]
236 stream len = S.take len $ S.enumerateFromThenTo from next to
233 stream len = S.take len $ S.enumerateFromThenTo from next to
237 in constructWithLen stream list op l
234 in constructWithLen stream list op l
240constructWithIterate ::
236constructWithIterate ::
241 IsStream t => (t IO Int -> SerialT IO Int) -> Word8 -> Property
237 IsStream t => (t IO Int -> SerialT IO Int) -> Word8 -> Property
@@ -396,11 +392,7 @@ constructWithUnfoldr listT op len =
396 else Just (seed, seed + 1)
392 else Just (seed, seed + 1)
398constructWithFromPure ::
394constructWithFromPure ::
400−#if __GLASGOW_HASKELL__ < 806
401− , Monoid (t IO Int)
395+ (IsStream t, Monoid (t IO Int))
404 => ([Int] -> [Int])
396 => ([Int] -> [Int])
405 -> (t IO Int -> SerialT IO Int)
397 -> (t IO Int -> SerialT IO Int)
@@ -416,11 +408,7 @@ constructWithFromPure listT op len =
416 listEquals (==) (listT strm) list
408 listEquals (==) (listT strm) list
418constructWithFromEffect ::
410constructWithFromEffect ::
420−#if __GLASGOW_HASKELL__ < 806
421− , Monoid (t IO Int)
411+ (IsStream t, Monoid (t IO Int))
424 => ([Int] -> [Int])
412 => ([Int] -> [Int])
425 -> (t IO Int -> SerialT IO Int)
413 -> (t IO Int -> SerialT IO Int)
@@ -1033,11 +1021,7 @@ foldFromList constr op eq = transformFromList constr eq id op
1034-- XXX concatenate streams of multiple elements rather than single elements
1022-- XXX concatenate streams of multiple elements rather than single elements
1035semigroupOps
1023semigroupOps
1037−#if __GLASGOW_HASKELL__ < 804
1038− , Semigroup (t IO Int)
1040− , Monoid (t IO Int))
1024+ :: (IsStream t, Monoid (t IO Int))
1041 => String
1025 => String
1042 -> ([Int] -> [Int] -> Bool)
1026 -> ([Int] -> [Int] -> Bool)
1043 -> (t IO Int -> SerialT IO Int)
1027 -> (t IO Int -> SerialT IO Int)
@@ -1469,11 +1453,7 @@ bracketPartialStreamProp t vec =
1471bracketExceptionProp ::
1455bracketExceptionProp ::
1472− (IsStream t, MonadThrow (t IO)
1456+ (IsStream t, MonadThrow (t IO), Semigroup (t IO Int))
1473−#if __GLASGOW_HASKELL__ < 806
1474− , Semigroup (t IO Int)
1477 => (t IO Int -> SerialT IO Int)
1457 => (t IO Int -> SerialT IO Int)
1478 -> Property
1458 -> Property
1479bracketExceptionProp t =
1459bracketExceptionProp t =
@@ -1560,11 +1540,7 @@ finallyPartialStreamProp t vec =
1562finallyExceptionProp ::
1542finallyExceptionProp ::
1563− (IsStream t, MonadThrow (t IO)
1543+ (IsStream t, MonadThrow (t IO), Semigroup (t IO Int))
1564−#if __GLASGOW_HASKELL__ < 806
1565− , Semigroup (t IO Int)
1568 => (t IO Int -> SerialT IO Int)
1544 => (t IO Int -> SerialT IO Int)
1569 -> Property
1545 -> Property
1570finallyExceptionProp t =
1546finallyExceptionProp t =
@@ -1582,11 +1558,7 @@ finallyExceptionProp t =
1582 assert $ refValue == 1
1558 assert $ refValue == 1
1584onExceptionProp ::
1560onExceptionProp ::
1585− (IsStream t, MonadThrow (t IO)
1561+ (IsStream t, MonadThrow (t IO), Semigroup (t IO Int))
1586−#if __GLASGOW_HASKELL__ < 806
1587− , Semigroup (t IO Int)
1590 => (t IO Int -> SerialT IO Int)
1562 => (t IO Int -> SerialT IO Int)
1591 -> Property
1563 -> Property
1592onExceptionProp t =
1564onExceptionProp t =
@@ -1620,11 +1592,7 @@ handleProp t vec =
1620 assert $ res == vec ++ [0] ++ vec
1592 assert $ res == vec ++ [0] ++ vec
1622exceptionOps ::
1594exceptionOps ::
1623− (IsStream t, MonadThrow (t IO)
1595+ (IsStream t, MonadThrow (t IO), Semigroup (t IO Int))
1624−#if __GLASGOW_HASKELL__ < 806
1625− , Semigroup (t IO Int)
1628 => String
1596 => String
1629 -> (t IO Int -> SerialT IO Int)
1597 -> (t IO Int -> SerialT IO Int)