@@ -576,25 +576,35 @@ escapedFrameBy _begin _end _escape _p = undefined
576576wordBy :: MonadCatch m => (a -> Bool) -> Fold m a b -> Parser m a b
577577wordBy f = K.toParserK . D.wordBy f
578578
579−-- | @groupBy cmp f $ S.fromList [a,b,c,...]@ assigns the element @a@ to the
580−-- first group, then if @a \`cmp` b@ is 'True' @b@ is also assigned to the same
581−-- group. If @a \`cmp` c@ is 'True' then @c@ is also assigned to the same
582−-- group and so on. When the comparison fails a new group is started. Each
583−-- group is folded using the 'Fold' @f@ and the result of the fold is emitted
584−-- in the output stream.
579+-- | Given an input stream @[a,b,c,...]@ and a comparison function @cmp@, the
580+-- parser assigns the element @a@ to the first group, then if @a \`cmp` b@ is
581+-- 'True' @b@ is also assigned to the same group. If @a \`cmp` c@ is 'True'
582+-- then @c@ is also assigned to the same group and so on. When the comparison
583+-- fails the parser is terminated. Each group is folded using the 'Fold' @f@ and
584+-- the result of the fold is the result of the parser.
585585--
586586-- * Stops - when the comparison fails.
587587-- * Fails - never.
588588--
589−-- @
590−-- S.groupsBy cmp f = S.parseMany (PR.groupBy cmp f)
591−-- @
589+-- > runGroupsBy eq =
590+-- > Stream.toList
591+-- > . Stream.parseMany (groupBy eq Fold.toList)
592+-- > . Stream.fromList
592593--
593−-- /Unimplemented/
594+-- >>> runGroupsBy (<) []
595+-- []
596+--
597+-- >>> runGroupsBy (<) [1]
598+-- [[1]]
599+--
600+-- >>> runGroupsBy (<) [3, 5, 4, 1, 2, 0]
601+-- [[3, 5, 4], [1, 2], [0]]
602+--
603+-- /Internal/
594604--
595605{-# INLINABLE groupBy #-}
596606groupBy :: MonadCatch m => (a -> a -> Bool) -> Fold m a b -> Parser m a b
597−groupBy cmp = K.toParserK . D.groupBy cmp
607+groupBy eq = K.toParserK . D.groupBy eq
598608
599609-- | Unlike 'groupBy' this combinator performs a rolling comparison of two
600610-- successive elements in the input stream. Assuming the input stream to the