by jamii · 12y ago · 0 comments
type Iteratee el m a -- a processor of 'els' in the monad 'm' returning a type 'a'
type Enumerator el m a = Iteratee el m a -> m (Iteratee el m a)
The Enumerators library is complicated by the presence of monads and by trying to automatically close handles when the stream is processed. In some ways it seems that the goal of solving the lazy IO problem led to missing a much simpler abstraction. Transducers seem to be simpler and more focused on just abstracting stream/map-reduce computation.We called the bits in the middle "step functions" , which could be combined with "consumers", "producers" and "transformers".
And the algebra generalizes hugely (not just collections) but to things like concurrent processes, data flow programs etc.
http://metagraph.org/papers/stream_fusion.pdf
Things to think about in a non-Haskell settings: how do you prevent reordering side-effects? Can execeptions/non-termination being reordered be observed?