X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=Pipes%2FText%2FInternal%2FCodec.hs;h=075a1520795b64e8be713cc26723db071c0df5b6;hb=11645cdce20ff843caf8b53f82f2c32050fdd1fd;hp=4b9367fcd97866bdfeca878babe734460c5a1628;hpb=409759e855afc27cfab263c1ab1b1fd9ab66d38a;p=github%2Ffretlink%2Ftext-pipes.git diff --git a/Pipes/Text/Internal/Codec.hs b/Pipes/Text/Internal/Codec.hs index 4b9367f..075a152 100644 --- a/Pipes/Text/Internal/Codec.hs +++ b/Pipes/Text/Internal/Codec.hs @@ -3,14 +3,16 @@ -- | -- Copyright: 2014 Michael Thompson, 2011 Michael Snoyman, 2010-2011 John Millikin -- License: MIT --- --- Parts of this code were taken from enumerator and conduits, and adapted for pipes. +-- This Parts of this code were taken from enumerator and conduits, and adapted for pipes + +-- This module follows the model of the enumerator and conduits libraries, and defines +-- 'Codec' s for various encodings. Note that we do not export a 'Codec' for ascii and +-- iso8859_1. A 'Lens' in the sense of the pipes library cannot be defined for these, so +-- special functions appear in @Pipes.Text@ + module Pipes.Text.Internal.Codec - ( Decoding(..) - , streamDecodeUtf8 - , decodeSomeUtf8 - , Codec(..) + ( Codec(..) , TextException(..) , utf8 , utf16_le @@ -41,12 +43,11 @@ import Data.Maybe (catMaybes) import Pipes.Text.Internal.Decoding import Pipes -- | A specific character encoding. --- --- Since 0.3.0 + data Codec = Codec { codecName :: Text , codecEncode :: Text -> (ByteString, Maybe (TextException, Text)) - , codecDecode :: ByteString -> Decoding -- (Text, Either (TextException, ByteString) ByteString) + , codecDecode :: ByteString -> Decoding } instance Show Codec where