[Haskell-cafe] Re: Fwd: Semantics of iteratees, enumerators, enumeratees?

Luke Palmer lrpalmer at gmail.com
Mon Aug 23 07:13:55 EDT 2010

On Mon, Aug 23, 2010 at 1:06 AM, Heinrich Apfelmus
<apfelmus at quantentunnel.de> wrote:
> Conal Elliott wrote:
>> For anyone interested in iteratees (etc) and not yet on the iteratees
>> mailing list.
>> I'm asking about what iteratees *mean* (denote), independent of the
>> various
>> implementations.  My original note (also at the end below):
> In my world view, iteratees are just a monad M with a single operation
>    symbol :: M Char
> that reads the next symbol from an input stream.

So perhaps this could be a reasonable semantics?

Iteratee a = [Char] -> Maybe (a, [Char])
           = MaybeT (State [Char]) a

symbol [] = Nothing
symbol (c:cs) = Just (c, cs)

I'm not experienced with iteratees. Does this miss something?


More information about the Haskell-Cafe mailing list