diff options
-rw-r--r-- | Pipes/Text.hs | 14 | ||||
-rw-r--r-- | README.md | 12 |
2 files changed, 11 insertions, 15 deletions
diff --git a/Pipes/Text.hs b/Pipes/Text.hs index b0d90f0..022855f 100644 --- a/Pipes/Text.hs +++ b/Pipes/Text.hs | |||
@@ -158,7 +158,7 @@ import Foreign.C.Error (Errno(Errno), ePIPE) | |||
158 | import qualified GHC.IO.Exception as G | 158 | import qualified GHC.IO.Exception as G |
159 | import Pipes | 159 | import Pipes |
160 | import qualified Pipes.ByteString.Parse as PBP | 160 | import qualified Pipes.ByteString.Parse as PBP |
161 | import Data.Text.Pipes.Parse ( | 161 | import Pipes.Text.Parse ( |
162 | nextChar, drawChar, unDrawChar, peekChar, isEndOfChars ) | 162 | nextChar, drawChar, unDrawChar, peekChar, isEndOfChars ) |
163 | import Pipes.Core (respond, Server') | 163 | import Pipes.Core (respond, Server') |
164 | import qualified Pipes.Parse as PP | 164 | import qualified Pipes.Parse as PP |
@@ -318,33 +318,33 @@ encodeUtf8 :: Monad m => Pipe Text ByteString m r | |||
318 | encodeUtf8 = P.map TE.encodeUtf8 | 318 | encodeUtf8 = P.map TE.encodeUtf8 |
319 | {-# INLINEABLE encodeUtf8 #-} | 319 | {-# INLINEABLE encodeUtf8 #-} |
320 | 320 | ||
321 | --| Transform a Pipe of 'String's into one of 'Text' chunks | 321 | -- | Transform a Pipe of 'String's into one of 'Text' chunks |
322 | pack :: Monad m => Pipe String Text m r | 322 | pack :: Monad m => Pipe String Text m r |
323 | pack = P.map T.pack | 323 | pack = P.map T.pack |
324 | {-# INLINEABLE pack #-} | 324 | {-# INLINEABLE pack #-} |
325 | 325 | ||
326 | --| Transforma a Pipes of 'Text' chunks into one of 'String's | 326 | -- | Transforma a Pipes of 'Text' chunks into one of 'String's |
327 | unpack :: Monad m => Pipe Text String m r | 327 | unpack :: Monad m => Pipe Text String m r |
328 | unpack = P.map T.unpack | 328 | unpack = P.map T.unpack |
329 | {-# INLINEABLE unpack #-} | 329 | {-# INLINEABLE unpack #-} |
330 | 330 | ||
331 | --| @toCaseFold@, @toLower@, @toUpper@ and @stripStart@ are standard 'Text' utility, | 331 | -- | @toCaseFold@, @toLower@, @toUpper@ and @stripStart@ are standard 'Text' utility, |
332 | -- here acting on a 'Text' pipe, rather as they would on a lazy text | 332 | -- here acting on a 'Text' pipe, rather as they would on a lazy text |
333 | toCaseFold :: Monad m => Pipe Text Text m () | 333 | toCaseFold :: Monad m => Pipe Text Text m () |
334 | toCaseFold = P.map T.toCaseFold | 334 | toCaseFold = P.map T.toCaseFold |
335 | {-# INLINEABLE toCaseFold #-} | 335 | {-# INLINEABLE toCaseFold #-} |
336 | 336 | ||
337 | --| lowercase incoming 'Text' | 337 | -- | lowercase incoming 'Text' |
338 | toLower :: Monad m => Pipe Text Text m () | 338 | toLower :: Monad m => Pipe Text Text m () |
339 | toLower = P.map T.toLower | 339 | toLower = P.map T.toLower |
340 | {-# INLINEABLE toLower #-} | 340 | {-# INLINEABLE toLower #-} |
341 | 341 | ||
342 | --| uppercase incoming 'Text' | 342 | -- | uppercase incoming 'Text' |
343 | toUpper :: Monad m => Pipe Text Text m () | 343 | toUpper :: Monad m => Pipe Text Text m () |
344 | toUpper = P.map T.toUpper | 344 | toUpper = P.map T.toUpper |
345 | {-# INLINEABLE toUpper #-} | 345 | {-# INLINEABLE toUpper #-} |
346 | 346 | ||
347 | --| Remove leading white space from an incoming succession of 'Text's | 347 | -- | Remove leading white space from an incoming succession of 'Text's |
348 | stripStart :: Monad m => Pipe Text Text m r | 348 | stripStart :: Monad m => Pipe Text Text m r |
349 | stripStart = do | 349 | stripStart = do |
350 | chunk <- await | 350 | chunk <- await |
@@ -1,11 +1,8 @@ | |||
1 | text-pipes | 1 | pipes-text |
2 | ========== | 2 | ========== |
3 | 3 | ||
4 | Text pipes, somehow to be fused with [`pipes-text`](https://github.com/ibotty/pipes-text) | 4 | These modules `Pipes.Text` and `Pipes.Text.Parse` use materials from [`pipes-text`](https://github.com/ibotty/pipes-text) and |
5 | which uses an upcoming version of the `text` library to link bytestring and text. | 5 | otherwise follows the pattern of [`pipes-bytestring`](https://github.com/Gabriel439/Haskell-Pipes-ByteString-Library), adding a few `pipes-prelude`-like operations. |
6 | |||
7 | This module follows the pattern of `pipes-bytestring` (largely by skillful use of the | ||
8 | expedient of regular expressions), and adds a few `pipes-prelude`-like operations. | ||
9 | 6 | ||
10 | 7 | ||
11 | >>> runEffect $ stdinLn >-> P.takeWhile (/= "quit") >-> stdoutLn | 8 | >>> runEffect $ stdinLn >-> P.takeWhile (/= "quit") >-> stdoutLn |
@@ -13,7 +10,6 @@ expedient of regular expressions), and adds a few `pipes-prelude`-like operation | |||
13 | hi | 10 | hi |
14 | quit<Return> | 11 | quit<Return> |
15 | >>> runSafeT $ runEffect $ readFile "README.md" >-> map toUpper >-> hoist lift stdout | 12 | >>> runSafeT $ runEffect $ readFile "README.md" >-> map toUpper >-> hoist lift stdout |
16 | TEXT-PIPES | 13 | PIPES-TEXT |
17 | ========== | 14 | ========== |
18 | TEXT PIPES, SOMEHOW TO BE FUSED WITH `PIPES-TEXT`. | ||
19 | ... \ No newline at end of file | 15 | ... \ No newline at end of file |