@@ -9,6 +9,7 @@
10module LinearOps where
10module LinearOps where
12+import Data.Maybe (fromJust)
12import Prelude
13import Prelude
13 (Monad, Int, (+), ($), (.), return, fmap, even, (>), (<=),
14 (Monad, Int, (+), ($), (.), return, fmap, even, (>), (<=),
14 subtract, undefined, Maybe(..), odd, Bool, not)
15 subtract, undefined, Maybe(..), odd, Bool, not)
@@ -42,13 +43,14 @@ maxValue = value + 1000
42{-# INLINE dropWhileTrue #-}
43{-# INLINE dropWhileTrue #-}
43{-# INLINE dropWhileMTrue #-}
44{-# INLINE dropWhileMTrue #-}
44{-# INLINE zip #-}
45{-# INLINE zip #-}
45{-# INLINE concat #-}
47{-# INLINE concat #-}
46{-# INLINE composeAllInFilters #-}
48{-# INLINE composeAllInFilters #-}
47{-# INLINE composeAllOutFilters #-}
49{-# INLINE composeAllOutFilters #-}
48{-# INLINE composeMapAllInFilter #-}
50{-# INLINE composeMapAllInFilter #-}
49uncons, nullHeadTail, scan, mapM_, map, fmap, mapMaybe, filterEven, filterAllOut,
51uncons, nullHeadTail, scan, mapM_, map, fmap, mapMaybe, filterEven, filterAllOut,
50 filterAllIn, takeOne, takeAll, takeWhileTrue, takeWhileMTrue, dropAll,
52 filterAllIn, takeOne, takeAll, takeWhileTrue, takeWhileMTrue, dropAll,
51− dropWhileTrue, dropWhileMTrue, zip,
53+ dropWhileTrue, dropWhileMTrue, zip, zipM,
52 concat, composeAllInFilters, composeAllOutFilters,
54 concat, composeAllInFilters, composeAllOutFilters,
53 composeMapAllInFilter
55 composeMapAllInFilter
54 :: Monad m
56 :: Monad m
@@ -56,8 +58,9 @@ uncons, nullHeadTail, scan, mapM_, map, fmap, mapMaybe, filterEven, filterAllOut
57{-# INLINE composeMapM #-}
59{-# INLINE composeMapM #-}
58{-# INLINE zipAsync #-}
60{-# INLINE zipAsync #-}
61+{-# INLINE zipAsyncM #-}
59{-# INLINE mapMaybeM #-}
62{-# INLINE mapMaybeM #-}
60−composeMapM, zipAsync, mapMaybeM :: S.MonadAsync m => Stream m Int -> m ()
63+composeMapM, zipAsync, zipAsyncM, mapMaybeM :: S.MonadAsync m => Stream m Int -> m ()
62{-# INLINE toList #-}
65{-# INLINE toList #-}
63{-# INLINE foldr #-}
66{-# INLINE foldr #-}
@@ -228,8 +231,22 @@ dropWhileMTrue = transform . S.dropWhileM (return . (<= maxValue))
228-- Zipping and concat
231-- Zipping and concat
229-------------------------------------------------------------------------------
232-------------------------------------------------------------------------------
236+ let src1 = fromJust r
231−zip src = transform $ (S.zipWith (,) src src)
237+ transform $ (S.zipWith (,) src src1)
240+ let src1 = fromJust r
241+ transform $ (S.zipWithM (\a b -> return (a,b)) src src1)
244+ let src1 = fromJust r
232−zipAsync src = transform $ (S.zipAsyncWith (,) src src)
245+ transform $ (S.zipAsyncWith (,) src src1)
248+ let src1 = fromJust r
249+ transform $ (S.zipAsyncWithM (\a b -> return (a,b)) src src1)
233concat _n = return ()
250concat _n = return ()
235-------------------------------------------------------------------------------
252-------------------------------------------------------------------------------