@@ -107,30 +107,50 @@ iterateSource g count len n = f count (sourceUnfoldrM len n)
107107-- Grouping transformations
108108-------------------------------------------------------------------------------
109109
110−#ifdef USE_PRELUDE
111110{-# INLINE groups #-}
112111groups :: MonadIO m => Stream m Int -> m ()
113−groups = Common.drain . S.groups FL.drain
112+groups =
113+#ifdef USE_PRELUDE
114+ Common.drain . S.groups FL.drain
115+#else
116+ Common.drain . S.groupsWhile (==) FL.drain
117+#endif
114118
115−-- XXX Change this test when the order of comparison is later changed
116−{-# INLINE groupsByGT #-}
117−groupsByGT :: MonadIO m => Stream m Int -> m ()
118−groupsByGT = Common.drain . S.groupsBy (>) FL.drain
119+{-# INLINE groupsWhileLT #-}
120+groupsWhileLT :: MonadIO m => Stream m Int -> m ()
121+groupsWhileLT =
122+#ifdef USE_PRELUDE
123+ Common.drain . S.groupsBy (>) FL.drain
124+#else
125+ Common.drain . S.groupsWhile (<) FL.drain
126+#endif
127+
128+{-# INLINE groupsWhileEq #-}
129+groupsWhileEq :: MonadIO m => Stream m Int -> m ()
130+groupsWhileEq =
131+#ifdef USE_PRELUDE
132+ Common.drain . S.groupsBy (==) FL.drain
133+#else
134+ Common.drain . S.groupsWhile (==) FL.drain
135+#endif
119136
120−{-# INLINE groupsByEq #-}
121−groupsByEq :: MonadIO m => Stream m Int -> m ()
122−groupsByEq = Common.drain . S.groupsBy (==) FL.drain
123137
124−-- XXX Change this test when the order of comparison is later changed
125138{-# INLINE groupsByRollingLT #-}
126139groupsByRollingLT :: MonadIO m => Stream m Int -> m ()
127140groupsByRollingLT =
141+#ifdef USE_PRELUDE
128142 Common.drain . S.groupsByRolling (<) FL.drain
143+#else
144+ Common.drain . S.groupsRollingBy (<) FL.drain
145+#endif
129146
130147{-# INLINE groupsByRollingEq #-}
131148groupsByRollingEq :: MonadIO m => Stream m Int -> m ()
132149groupsByRollingEq =
150+#ifdef USE_PRELUDE
133151 Common.drain . S.groupsByRolling (==) FL.drain
152+#else
153+ Common.drain . S.groupsRollingBy (==) FL.drain
134154#endif
135155
136156{-# INLINE foldMany #-}
@@ -190,14 +210,13 @@ o_1_space_grouping value =
190210 -- Buffering operations using heap proportional to group/window sizes.
191211 [ bgroup "grouping"
192212 [
193−#ifdef USE_PRELUDE
194213 benchIOSink value "groups" groups
195− , benchIOSink value "groupsByGT" groupsByGT
196− , benchIOSink value "groupsByEq" groupsByEq
214+ , benchIOSink value "groupsWhileLT" groupsWhileLT
215+ , benchIOSink value "groupsWhileEq" groupsWhileEq
197216 , benchIOSink value "groupsByRollingLT" groupsByRollingLT
198217 , benchIOSink value "groupsByRollingEq" groupsByRollingEq
199218 ,
200−#endif
219+
201220 -- XXX parseMany/parseIterate benchmarks are in the Parser/ParserD
202221 -- modules we can bring those here. chunksOf benchmarks are in
203222 -- Parser/ParserD/Array.Stream/FileSystem.Handle.