diff options
author | michaelt <what_is_it_to_do_anything@yahoo.com> | 2014-02-05 00:20:11 -0500 |
---|---|---|
committer | michaelt <what_is_it_to_do_anything@yahoo.com> | 2014-02-05 00:20:11 -0500 |
commit | 4da91c37355b3d688c9dfc6f92ae92266ad4e883 (patch) | |
tree | e523b43654e0dc6dfb5d7a39115aca8bb4b2d1e2 /Pipes/Text/Internal/Codec.hs | |
parent | 7c9f2b8b11f51b2a4e9dcd6e8168e34f1135d6e2 (diff) | |
download | text-pipes-4da91c37355b3d688c9dfc6f92ae92266ad4e883.tar.gz text-pipes-4da91c37355b3d688c9dfc6f92ae92266ad4e883.tar.zst text-pipes-4da91c37355b3d688c9dfc6f92ae92266ad4e883.zip |
little Haddock notes on Internal material
Diffstat (limited to 'Pipes/Text/Internal/Codec.hs')
-rw-r--r-- | Pipes/Text/Internal/Codec.hs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Pipes/Text/Internal/Codec.hs b/Pipes/Text/Internal/Codec.hs index 4b9367f..63cbd74 100644 --- a/Pipes/Text/Internal/Codec.hs +++ b/Pipes/Text/Internal/Codec.hs | |||
@@ -3,8 +3,12 @@ | |||
3 | -- | | 3 | -- | |
4 | -- Copyright: 2014 Michael Thompson, 2011 Michael Snoyman, 2010-2011 John Millikin | 4 | -- Copyright: 2014 Michael Thompson, 2011 Michael Snoyman, 2010-2011 John Millikin |
5 | -- License: MIT | 5 | -- License: MIT |
6 | -- | 6 | -- This Parts of this code were taken from enumerator and conduits, and adapted for pipes |
7 | -- Parts of this code were taken from enumerator and conduits, and adapted for pipes. | 7 | {- | This module follows the model of the enumerator and conduits libraries, and defines |
8 | 'Codec' s for various encodings. Note that we do not export a 'Codec' for ascii and | ||
9 | iso8859_1. A 'Lens' in the sense of the pipes library cannot be defined for these, so | ||
10 | special functions appear in @Pipes.Text@ | ||
11 | -} | ||
8 | 12 | ||
9 | module Pipes.Text.Internal.Codec | 13 | module Pipes.Text.Internal.Codec |
10 | ( Decoding(..) | 14 | ( Decoding(..) |
@@ -41,12 +45,11 @@ import Data.Maybe (catMaybes) | |||
41 | import Pipes.Text.Internal.Decoding | 45 | import Pipes.Text.Internal.Decoding |
42 | import Pipes | 46 | import Pipes |
43 | -- | A specific character encoding. | 47 | -- | A specific character encoding. |
44 | -- | 48 | |
45 | -- Since 0.3.0 | ||
46 | data Codec = Codec | 49 | data Codec = Codec |
47 | { codecName :: Text | 50 | { codecName :: Text |
48 | , codecEncode :: Text -> (ByteString, Maybe (TextException, Text)) | 51 | , codecEncode :: Text -> (ByteString, Maybe (TextException, Text)) |
49 | , codecDecode :: ByteString -> Decoding -- (Text, Either (TextException, ByteString) ByteString) | 52 | , codecDecode :: ByteString -> Decoding |
50 | } | 53 | } |
51 | 54 | ||
52 | instance Show Codec where | 55 | instance Show Codec where |