
23 Aug
2010
23 Aug
'10
3:14 a.m.
On Sat, 21 Aug 2010 13:36:08 -0700, John Millikin
On Sat, Aug 21, 2010 at 12:44, Magnus Therning
wrote: As an aside, has anyone written the code necessary to convert a parser, such as e.g. attoparsec, into an enumerator-iteratee[1]?
This sort of conversion is trivial. For an example, I've uploaded the attoparsec-enumerator package at < http://hackage.haskell.org/package/attoparsec-enumerator > -- iterParser is about 20 lines, excluding the module header and imports.
< A.Done extra a -> E.yield a (E.Chunks [extra]) Maybe it would be better to check if extra is empty to produce an empty list of chunks? -- Nicolas Pouillard http://nicolaspouillard.fr