aboutsummaryrefslogtreecommitdiffhomepage
path: root/Pipes/Text/Encoding.hs
diff options
context:
space:
mode:
authormichaelt <what_is_it_to_do_anything@yahoo.com>2014-02-19 11:15:54 -0500
committermichaelt <what_is_it_to_do_anything@yahoo.com>2014-02-19 11:15:54 -0500
commita4913c420748559aa8bd4618bc97a562e2bd5b8f (patch)
tree81f7306ddf6ff84dc7c7cefdfac914c12d9460c3 /Pipes/Text/Encoding.hs
parent4ea59a8b6fb2d9ea4f7125df67ad3b91e67c6926 (diff)
downloadtext-pipes-a4913c420748559aa8bd4618bc97a562e2bd5b8f.tar.gz
text-pipes-a4913c420748559aa8bd4618bc97a562e2bd5b8f.tar.zst
text-pipes-a4913c420748559aa8bd4618bc97a562e2bd5b8f.zip
generalized signatures
Diffstat (limited to 'Pipes/Text/Encoding.hs')
-rw-r--r--Pipes/Text/Encoding.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/Pipes/Text/Encoding.hs b/Pipes/Text/Encoding.hs
index 4311ad1..d727c2c 100644
--- a/Pipes/Text/Encoding.hs
+++ b/Pipes/Text/Encoding.hs
@@ -12,7 +12,7 @@ module Pipes.Text.Encoding
12 -- $lenses 12 -- $lenses
13 Codec 13 Codec
14 , decode 14 , decode
15 -- * Viewing the Text in a ByteString 15 -- * \'Viewing\' the Text in a byte stream
16 -- $codecs 16 -- $codecs
17 , utf8 17 , utf8
18 , utf8Pure 18 , utf8Pure
@@ -57,7 +57,6 @@ import Control.Monad (join)
57import Data.Word (Word8) 57import Data.Word (Word8)
58import Pipes 58import Pipes
59 59
60
61type Lens' a b = forall f . Functor f => (b -> f b) -> (a -> f a) 60type Lens' a b = forall f . Functor f => (b -> f b) -> (a -> f a)
62 61
63{- $lenses 62{- $lenses
@@ -131,11 +130,11 @@ decode codec a = getConstant (codec Constant a)
131 130
132> zoom utf8 drawChar :: Monad m => StateT (Producer ByteString m r) m (Maybe Char) 131> zoom utf8 drawChar :: Monad m => StateT (Producer ByteString m r) m (Maybe Char)
133 132
134 or, with the type synonymn of @Pipes.Parse@: 133 or, using the type synonymn from @Pipes.Parse@:
135 134
136> zoom utf8 drawChar :: Monad m => Parser ByteString m (Maybe Char) 135> zoom utf8 drawChar :: Monad m => Parser ByteString m (Maybe Char)
137 136
138 Thus we can define ByteString like this: 137 Thus we can define a ByteString parser like this:
139 138
140> withNextByte :: Parser ByteString m (Maybe Char, Maybe Word8))) 139> withNextByte :: Parser ByteString m (Maybe Char, Maybe Word8)))
141> withNextByte = do char_ <- zoom utf8 Text.drawChar 140> withNextByte = do char_ <- zoom utf8 Text.drawChar