aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormichaelt <what_is_it_to_do_anything@yahoo.com>2013-10-22 18:52:50 -0400
committermichaelt <what_is_it_to_do_anything@yahoo.com>2013-10-22 18:52:50 -0400
commitc0343bc936515472b7218f7f8d6d0f4cf4e3d1c1 (patch)
tree7262658f53db849c17dc2274b57c401fdf34d919
parent7faef8bceff2440056da59920fb932b5b76f6541 (diff)
downloadtext-pipes-c0343bc936515472b7218f7f8d6d0f4cf4e3d1c1.tar.gz
text-pipes-c0343bc936515472b7218f7f8d6d0f4cf4e3d1c1.tar.zst
text-pipes-c0343bc936515472b7218f7f8d6d0f4cf4e3d1c1.zip
Readme corrected
-rw-r--r--Pipes/Text.hs14
-rw-r--r--README.md12
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)
158import qualified GHC.IO.Exception as G 158import qualified GHC.IO.Exception as G
159import Pipes 159import Pipes
160import qualified Pipes.ByteString.Parse as PBP 160import qualified Pipes.ByteString.Parse as PBP
161import Data.Text.Pipes.Parse ( 161import Pipes.Text.Parse (
162 nextChar, drawChar, unDrawChar, peekChar, isEndOfChars ) 162 nextChar, drawChar, unDrawChar, peekChar, isEndOfChars )
163import Pipes.Core (respond, Server') 163import Pipes.Core (respond, Server')
164import qualified Pipes.Parse as PP 164import qualified Pipes.Parse as PP
@@ -318,33 +318,33 @@ encodeUtf8 :: Monad m => Pipe Text ByteString m r
318encodeUtf8 = P.map TE.encodeUtf8 318encodeUtf8 = 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
322pack :: Monad m => Pipe String Text m r 322pack :: Monad m => Pipe String Text m r
323pack = P.map T.pack 323pack = 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
327unpack :: Monad m => Pipe Text String m r 327unpack :: Monad m => Pipe Text String m r
328unpack = P.map T.unpack 328unpack = 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
333toCaseFold :: Monad m => Pipe Text Text m () 333toCaseFold :: Monad m => Pipe Text Text m ()
334toCaseFold = P.map T.toCaseFold 334toCaseFold = P.map T.toCaseFold
335{-# INLINEABLE toCaseFold #-} 335{-# INLINEABLE toCaseFold #-}
336 336
337--| lowercase incoming 'Text' 337-- | lowercase incoming 'Text'
338toLower :: Monad m => Pipe Text Text m () 338toLower :: Monad m => Pipe Text Text m ()
339toLower = P.map T.toLower 339toLower = P.map T.toLower
340{-# INLINEABLE toLower #-} 340{-# INLINEABLE toLower #-}
341 341
342--| uppercase incoming 'Text' 342-- | uppercase incoming 'Text'
343toUpper :: Monad m => Pipe Text Text m () 343toUpper :: Monad m => Pipe Text Text m ()
344toUpper = P.map T.toUpper 344toUpper = 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
348stripStart :: Monad m => Pipe Text Text m r 348stripStart :: Monad m => Pipe Text Text m r
349stripStart = do 349stripStart = do
350 chunk <- await 350 chunk <- await
diff --git a/README.md b/README.md
index 71550b8..6aac0ad 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,8 @@
1text-pipes 1pipes-text
2========== 2==========
3 3
4Text pipes, somehow to be fused with [`pipes-text`](https://github.com/ibotty/pipes-text) 4These modules `Pipes.Text` and `Pipes.Text.Parse` use materials from [`pipes-text`](https://github.com/ibotty/pipes-text) and
5which uses an upcoming version of the `text` library to link bytestring and text. 5otherwise follows the pattern of [`pipes-bytestring`](https://github.com/Gabriel439/Haskell-Pipes-ByteString-Library), adding a few `pipes-prelude`-like operations.
6
7This module follows the pattern of `pipes-bytestring` (largely by skillful use of the
8expedient 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