
On Mon, Dec 26, 2011 at 12:32:13PM +0400, Eugene Kirpichov wrote:
2011/12/26 Gábor Lehel
On Sun, Dec 25, 2011 at 9:19 PM, Eugene Kirpichov
wrote: Hello Heinrich,
Thanks, that's sure some food for thought!
A few notes: * This is indeed analogous to Iteratees. I tried doing the same with Iteratees but failed, so I decided to put together something simple of my own. * The Applicative structure over this stuff is very nice. I was thinking, what structure to put on - and Applicative seems the perfect fit. It's also possible to implement Arrows - but I once tried and failed; however, I was trying that for a more complex stream transformer datatype (a hybrid of Iteratee and Enumerator). * StreamSummary is trivially a bifunctor. I actually wanted to make it an instance of Bifunctor, but it was in the category-extras package and I hesitated to reference this giant just for this purpose :) Probably bifunctors should be in prelude.
Edward Kmett has been splitting that up into a variety of smaller packages, for instance:
Actually it's not a bifunctor - it's a functor in one argument and contrafunctor in the other. Is there a name for such a structure?
"Bifunctor" is usually used for such things as well. Data.Bifunctor only covers bifunctors which are covariant in both arguments. -Brent