@@ -9,7 +9,8 @@ import Control.Applicative (ZipList(..))
99import Control.Concurrent (MVar, takeMVar, putMVar, newEmptyMVar)
1010import Control.Monad (replicateM, replicateM_)
1111import Data.IORef (readIORef, modifyIORef, newIORef)
12−import Data.List (sort, foldl', scanl')
12+import Data.List (sort, foldl', scanl', findIndices, findIndex, elemIndices,
13+ elemIndex)
1314import Data.Maybe (mapMaybe)
1415import GHC.Word (Word8)
1516
@@ -347,6 +348,10 @@ transformOps constr desc t eq = do
347348 prop (desc ++ " scan") $ transform (scanl' (+) 0) $ t . (S.scanl' (+) 0)
348349 prop (desc ++ " reverse") $ transform reverse $ t . S.reverse
349350
351+ prop (desc ++ " findIndices") $ transform (findIndices odd) $ t . (S.findIndices odd)
352+ prop (desc ++ " elemIndices") $ transform (elemIndices 3) $ t . (S.elemIndices 3)
353+
354+
350355concurrentOps
351356 :: IsStream t
352357 => ([Word8] -> t IO Word8)
@@ -481,6 +486,9 @@ eliminationOps constr desc t = do
481486 prop (desc ++ " maximum") $ eliminateOp constr (wrapMaybe maximum) $ S.maximum . t
482487 prop (desc ++ " minimum") $ eliminateOp constr (wrapMaybe minimum) $ S.minimum . t
483488
489+ prop (desc ++ " findIndex") $ eliminateOp constr (findIndex odd) $ (S.findIndex odd) . t
490+ prop (desc ++ " elemIndex") $ eliminateOp constr (elemIndex 3) $ (S.elemIndex 3) . t
491+
484492-- head/tail/last may depend on the order in case of parallel streams
485493-- so we test these only for serial streams.
486494serialEliminationOps