diff options
author | michaelt <what_is_it_to_do_anything@yahoo.com> | 2014-01-30 10:50:14 -0500 |
---|---|---|
committer | michaelt <what_is_it_to_do_anything@yahoo.com> | 2014-01-30 10:50:14 -0500 |
commit | 7fc48f7c218d0d4109e3367c72aa7f7d3ac5ea83 (patch) | |
tree | f134d4acc3b468bda9424df5c787ee4b8d01fc15 | |
parent | 7ed76745611d379a43b5bed19b136c44df671e04 (diff) | |
download | text-pipes-7fc48f7c218d0d4109e3367c72aa7f7d3ac5ea83.tar.gz text-pipes-7fc48f7c218d0d4109e3367c72aa7f7d3ac5ea83.tar.zst text-pipes-7fc48f7c218d0d4109e3367c72aa7f7d3ac5ea83.zip |
pipes-group does not export transFreeT, use maps like pipes-bytestring
-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 |