diff options
author | michaelt <what_is_it_to_do_anything@yahoo.com> | 2014-02-15 11:00:38 -0500 |
---|---|---|
committer | michaelt <what_is_it_to_do_anything@yahoo.com> | 2014-02-15 11:00:38 -0500 |
commit | 7012564176348bfb3cc25ce69661e8e436ab83a6 (patch) | |
tree | d8a0f1b0a1342330495c197aef259726bfb060b1 /Pipes | |
parent | bbdfd3056da4992e18d3983fd5992bee23af93af (diff) | |
download | text-pipes-7012564176348bfb3cc25ce69661e8e436ab83a6.tar.gz text-pipes-7012564176348bfb3cc25ce69661e8e436ab83a6.tar.zst text-pipes-7012564176348bfb3cc25ce69661e8e436ab83a6.zip |
simplify imports
Diffstat (limited to 'Pipes')
-rw-r--r-- | Pipes/Text.hs | 34 | ||||
-rw-r--r-- | Pipes/Text/Encoding.hs | 6 |
2 files changed, 9 insertions, 31 deletions
diff --git a/Pipes/Text.hs b/Pipes/Text.hs index 8221c01..68ede1a 100644 --- a/Pipes/Text.hs +++ b/Pipes/Text.hs | |||
@@ -165,47 +165,29 @@ module Pipes.Text ( | |||
165 | , module Data.ByteString | 165 | , module Data.ByteString |
166 | , module Data.Text | 166 | , module Data.Text |
167 | , module Data.Profunctor | 167 | , module Data.Profunctor |
168 | , module Data.Word | ||
169 | , module Pipes.Parse | 168 | , module Pipes.Parse |
170 | , module Pipes.Group | 169 | , module Pipes.Group |
171 | ) where | 170 | ) where |
172 | 171 | ||
173 | import Control.Applicative ((<*)) | 172 | import Control.Applicative ((<*)) |
174 | import Control.Monad (liftM, unless, join) | 173 | import Control.Monad (liftM, join) |
175 | import Control.Monad.Trans.State.Strict (StateT(..), modify) | 174 | import Control.Monad.Trans.State.Strict (StateT(..), modify) |
176 | import Data.Monoid ((<>)) | ||
177 | import qualified Data.Text as T | 175 | import qualified Data.Text as T |
178 | import qualified Data.Text.IO as T | ||
179 | import qualified Data.Text.Encoding as TE | ||
180 | import qualified Data.Text.Encoding.Error as TE | ||
181 | import Data.Text (Text) | 176 | import Data.Text (Text) |
182 | import qualified Data.Text.Lazy as TL | 177 | import qualified Data.Text.Lazy as TL |
183 | import qualified Data.Text.Lazy.IO as TL | ||
184 | import Data.Text.Lazy.Internal (foldrChunks, defaultChunkSize) | 178 | import Data.Text.Lazy.Internal (foldrChunks, defaultChunkSize) |
185 | import Data.ByteString.Unsafe (unsafeTake, unsafeDrop) | ||
186 | import Data.ByteString (ByteString) | 179 | import Data.ByteString (ByteString) |
187 | import qualified Data.ByteString as B | ||
188 | import qualified Data.ByteString.Char8 as B8 | ||
189 | import Data.Char (ord, isSpace) | ||
190 | import Data.Functor.Constant (Constant(Constant, getConstant)) | 180 | import Data.Functor.Constant (Constant(Constant, getConstant)) |
191 | import Data.Functor.Identity (Identity) | 181 | import Data.Functor.Identity (Identity) |
192 | import Data.Profunctor (Profunctor) | 182 | import Data.Profunctor (Profunctor) |
193 | import qualified Data.Profunctor | 183 | import qualified Data.Profunctor |
194 | import qualified Data.List as List | ||
195 | import Pipes | 184 | import Pipes |
196 | import qualified Pipes.ByteString as PB | ||
197 | -- import Pipes.Text.Decoding | ||
198 | import Pipes.Core (respond, Server') | ||
199 | import Pipes.Group (concats, intercalates, FreeT(..), FreeF(..)) | 185 | import Pipes.Group (concats, intercalates, FreeT(..), FreeF(..)) |
200 | import qualified Pipes.Group as PG | 186 | import qualified Pipes.Group as PG |
201 | import qualified Pipes.Parse as PP | 187 | import qualified Pipes.Parse as PP |
202 | import Pipes.Parse (Parser) | 188 | import Pipes.Parse (Parser) |
203 | |||
204 | import qualified Pipes.Prelude as P | 189 | import qualified Pipes.Prelude as P |
205 | import qualified System.IO as IO | ||
206 | import Data.Char (isSpace) | 190 | import Data.Char (isSpace) |
207 | import Data.Word (Word8) | ||
208 | import Data.Text.StreamDecoding | ||
209 | 191 | ||
210 | import Prelude hiding ( | 192 | import Prelude hiding ( |
211 | all, | 193 | all, |
@@ -272,13 +254,13 @@ concatMap f = P.map (T.concatMap f) | |||
272 | -- | Transform a Pipe of 'Text' into a Pipe of 'ByteString's using UTF-8 | 254 | -- | Transform a Pipe of 'Text' into a Pipe of 'ByteString's using UTF-8 |
273 | -- encoding; @encodeUtf8 = Pipes.Prelude.map TE.encodeUtf8@ so more complex | 255 | -- encoding; @encodeUtf8 = Pipes.Prelude.map TE.encodeUtf8@ so more complex |
274 | -- encoding pipes can easily be constructed with the functions in @Data.Text.Encoding@ | 256 | -- encoding pipes can easily be constructed with the functions in @Data.Text.Encoding@ |
275 | encodeUtf8 :: Monad m => Pipe Text ByteString m r | 257 | -- encodeUtf8 :: Monad m => Pipe Text ByteString m r |
276 | encodeUtf8 = P.map TE.encodeUtf8 | 258 | -- encodeUtf8 = P.map TE.encodeUtf8 |
277 | {-# INLINEABLE encodeUtf8 #-} | 259 | -- {-# INLINEABLE encodeUtf8 #-} |
278 | 260 | -- | |
279 | {-# RULES "p >-> encodeUtf8" forall p . | 261 | -- {-# RULES "p >-> encodeUtf8" forall p . |
280 | p >-> encodeUtf8 = for p (\txt -> yield (TE.encodeUtf8 txt)) | 262 | -- p >-> encodeUtf8 = for p (\txt -> yield (TE.encodeUtf8 txt)) |
281 | #-} | 263 | -- #-} |
282 | 264 | ||
283 | -- | Transform a Pipe of 'String's into one of 'Text' chunks | 265 | -- | Transform a Pipe of 'String's into one of 'Text' chunks |
284 | pack :: Monad m => Pipe String Text m r | 266 | pack :: Monad m => Pipe String Text m r |
diff --git a/Pipes/Text/Encoding.hs b/Pipes/Text/Encoding.hs index 2bb5807..0ab6096 100644 --- a/Pipes/Text/Encoding.hs +++ b/Pipes/Text/Encoding.hs | |||
@@ -31,17 +31,13 @@ module Pipes.Text.Encoding | |||
31 | import Data.Char (ord) | 31 | import Data.Char (ord) |
32 | import Data.ByteString as B | 32 | import Data.ByteString as B |
33 | import Data.ByteString (ByteString) | 33 | import Data.ByteString (ByteString) |
34 | import Data.ByteString.Internal as B | ||
35 | import Data.ByteString.Char8 as B8 | 34 | import Data.ByteString.Char8 as B8 |
36 | import Data.Text (Text) | 35 | import Data.Text (Text) |
37 | import qualified Data.Text as T | 36 | import qualified Data.Text as T |
38 | import qualified Data.Text.Encoding as TE | 37 | import qualified Data.Text.Encoding as TE |
39 | import Data.Text.StreamDecoding | 38 | import Data.Text.StreamDecoding |
40 | import GHC.Word (Word8, Word32) | 39 | import Control.Monad (join) |
41 | import Data.Word (Word8, Word16) | ||
42 | import Control.Monad | ||
43 | import Pipes | 40 | import Pipes |
44 | import Pipes.Core | ||
45 | 41 | ||
46 | 42 | ||
47 | 43 | ||