On Fri, Jul 1, 2011 at 7:38 AM, yi huang
<yi.codeplayer@gmail.com> wrote:
Say i want to compose Enumerator ByteString m b and Iteratee Builder
m b, so I try to transform the enum to Enumerator Builder m b,
providing function ByteString -> Builder. It's like implement a
Functor instance for Enumerator. But i failed, there are no way to
make type system happy.
Am I right that there is no Functor instance of Enumerator?
I'm pretty sure there is one, but it's a functor over b. So something like:
instance Functor (Enumerator a m)
I think you want to use an Enumeratee:
enumerateeByteStringBuilder :: Enumeratee ByteString Builder m b
Check out map :: (a -> b) -> Enumeratee a b m c