[Haskell] Re: [Haskell-cafe] ANNOUNCE: enumerator, an alternative iteratee package

John Millikin jmillikin at gmail.com
Fri Aug 20 11:51:45 EDT 2010


On Fri, Aug 20, 2010 at 04:01, Simon Marlow <marlowsd at gmail.com> wrote:
> Handle IO is also doing Unicode encoding/decoding, which iteratees bypass.
>  Have you thought about how to incorporate encoding/decoding?

Yes; there will be a module Data.Enumerator.Text which contains
locale-based IO, enumeratee-based encoding/decoding, and so forth.
Since "iteratee" doesn't have any text-based IO, I figured it wasn't
necessary for a first release; getting feedback on the basic soundness
of the package was more important.

Currently, I'm planning on the following type signatures for D.E.Text.
'enumHandle' will use Text's hGetLine, since there doesn't seem to be
any text-based equivalent to ByteString's 'hGet'.

--------------------------------------------------------------------------------

enumHandle :: Handle -> Enumerator SomeException Text IO b

enumFile :: FilePath -> Enumerator SomeException Text IO b

data Codec = Codec
	{ codecName :: Text
	, codecEncode :: Text -> Either SomeException ByteString
	, codecDecode :: ByteString -> Either SomeException (Text, ByteString)
	}

encode :: Codec -> Enumeratee SomeException Text ByteString m b

decode :: Codec -> Enumeratee SomeException ByteString Text m b

utf8 :: Codec

utf16le :: Codec

utf16be :: Codec

utf32le :: Codec

utf32be :: Codec

ascii :: Codec

iso8859_1 :: Codec
--------------------------------------------------------------------------------


More information about the Haskell-Cafe mailing list