diff options
-rw-r--r-- | Pipes/Text.hs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Pipes/Text.hs b/Pipes/Text.hs index 199e7c2..71b1316 100644 --- a/Pipes/Text.hs +++ b/Pipes/Text.hs | |||
@@ -183,7 +183,7 @@ import qualified Pipes.ByteString as PB | |||
183 | import qualified Pipes.Text.Internal as PE | 183 | import qualified Pipes.Text.Internal as PE |
184 | import Pipes.Text.Internal (Codec(..)) | 184 | import Pipes.Text.Internal (Codec(..)) |
185 | import Pipes.Core (respond, Server') | 185 | import Pipes.Core (respond, Server') |
186 | import Pipes.Group (concats, intercalates, transFreeT, FreeT(..), FreeF(..)) | 186 | import Pipes.Group (concats, intercalates, FreeT(..), FreeF(..)) |
187 | import qualified Pipes.Group as PG | 187 | import qualified Pipes.Group as PG |
188 | import qualified Pipes.Parse as PP | 188 | import qualified Pipes.Parse as PP |
189 | import Pipes.Parse (Parser) | 189 | import Pipes.Parse (Parser) |
@@ -988,11 +988,9 @@ lines = Data.Profunctor.dimap _lines (fmap _unlines) | |||
988 | -- _unlines | 988 | -- _unlines |
989 | -- :: Monad m | 989 | -- :: Monad m |
990 | -- => FreeT (Producer Text m) m x -> Producer Text m x | 990 | -- => FreeT (Producer Text m) m x -> Producer Text m x |
991 | _unlines = concats . transFreeT addNewline | 991 | _unlines = concats . PG.maps (<* yield (T.singleton '\n')) |
992 | |||
992 | 993 | ||
993 | -- addNewline | ||
994 | -- :: Monad m => Producer Text m r -> Producer Text m r | ||
995 | addNewline p = p <* yield (T.singleton '\n') | ||
996 | {-# INLINABLE lines #-} | 994 | {-# INLINABLE lines #-} |
997 | 995 | ||
998 | 996 | ||
@@ -1061,7 +1059,7 @@ unlines = go | |||
1061 | -} | 1059 | -} |
1062 | unwords | 1060 | unwords |
1063 | :: (Monad m) => FreeT (Producer Text m) m r -> Producer Text m r | 1061 | :: (Monad m) => FreeT (Producer Text m) m r -> Producer Text m r |
1064 | unwords = intercalate (yield $ T.pack " ") | 1062 | unwords = intercalate (yield $ T.singleton ' ') |
1065 | {-# INLINABLE unwords #-} | 1063 | {-# INLINABLE unwords #-} |
1066 | 1064 | ||
1067 | {- $parse | 1065 | {- $parse |