
1 Jul
2011
1 Jul
'11
1:44 p.m.
On Fri, Jul 1, 2011 at 7:38 AM, yi huang
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 http://hackage.haskell.org/packages/archive/enumerator/0.4.0.1/doc/html/Data...