aboutsummaryrefslogtreecommitdiffhomepage
path: root/Pipes
diff options
context:
space:
mode:
Diffstat (limited to 'Pipes')
-rw-r--r--Pipes/Text/Encoding.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/Pipes/Text/Encoding.hs b/Pipes/Text/Encoding.hs
index a8be8e4..21269cf 100644
--- a/Pipes/Text/Encoding.hs
+++ b/Pipes/Text/Encoding.hs
@@ -38,16 +38,18 @@ import Control.Monad (join)
38import Data.Word (Word8) 38import Data.Word (Word8)
39import Pipes 39import Pipes
40 40
41 41type Lens' a b = forall f . Functor f => (b -> f b) -> (a -> f a)
42 42
43{- | A 'Codec' is just an improper lens into a byte stream that is expected to contain text. 43{- | A 'Codec' is just an improper lens into a byte stream that is expected to contain text.
44 They are named in accordance with the expected encoding, 'utf8', 'utf16LE' etc. 44 They are named in accordance with the expected encoding, 'utf8', 'utf16LE' etc.
45 The stream of text they 'see' in a bytestream ends by returning the original byte stream 45 The stream of text they 'see' in a bytestream ends by returning the original byte stream
46 beginning at the point of failure, or the empty bytestream with its return value. 46 beginning at the point of failure, or the empty bytestream with its return value.
47 -} 47 -}
48type Codec = forall f m r . (Functor f , Monad m ) => 48type Codec
49 (Producer Text m (Producer ByteString m r) -> f (Producer Text m (Producer ByteString m r))) 49 = forall m r
50 -> Producer ByteString m r -> f (Producer ByteString m r ) 50 . Monad m
51 => Lens' (Producer ByteString m r)
52 (Producer Text m (Producer ByteString m r))
51 53
52decodeStream :: Monad m 54decodeStream :: Monad m
53 => (B.ByteString -> DecodeResult) 55 => (B.ByteString -> DecodeResult)