@@ -1,6 +1,6 @@
11{-# LANGUAGE FlexibleContexts #-}
22-- |
3−-- Module : Streamly.String
3+-- Module : Streamly.Data.String
44-- Copyright : (c) 2018 Composewell Technologies
55--
66-- License : BSD3
@@ -31,7 +31,7 @@
3131-- TBD write a note on performance comparison with text, bytestrings, lists and
3232-- vector.
3333--
34−module Streamly.String
34+module Streamly.Data.String
3535 (
3636 -- String
3737
@@ -167,20 +167,20 @@ stripStart = S.dropWhile isSpace
167167-- | Fold each line of the stream using the supplied Fold
168168-- and stream the result.
169169--
170−-- >>> S.toList $ foldLines (S.fromList "lines\nthis\nstring\n\n\n") FL.toList
170+-- >>> S.toList $ foldLines FL.toList (S.fromList "lines\nthis\nstring\n\n\n")
171171-- ["lines", "this", "string", "", ""]
172172{-# INLINE foldLines #-}
173−foldLines :: (Monad m, IsStream t) => t m Char -> Fold m Char b -> t m b
174−foldLines = flip (S.splitOnSuffix (== '\n'))
173+foldLines :: (Monad m, IsStream t) => Fold m Char b -> t m Char -> t m b
174+foldLines = S.splitOnSuffix (== '\n')
175175
176176-- | Fold each word of the stream using the supplied Fold
177177-- and stream the result.
178178--
179−-- >>> S.toList $ foldWords (S.fromList "fold these words") FL.toList
179+-- >>> S.toList $ foldWords FL.toList (S.fromList "fold these words")
180180-- ["fold", "these", "words"]
181181{-# INLINE foldWords #-}
182−foldWords :: (Monad m, IsStream t) => t m Char -> Fold m Char b -> t m b
183−foldWords = flip (S.wordsBy isSpace)
182+foldWords :: (Monad m, IsStream t) => Fold m Char b -> t m Char -> t m b
183+foldWords = S.wordsBy isSpace
184184
185185foreign import ccall unsafe "u_iswspace"
186186 iswspace :: Int -> Int