[Haskell-beginners] Help with enumerator pipeline
Ertugrul Soeylemez
es at ertes.de
Thu Sep 1 16:27:26 CEST 2011
Michael Xavier <nemesisdesign at gmail.com> wrote:
> I've just recently started learning how to use the enumerator
> library. I'm designing a utility that parses a file where each line is
> a JSON object. I've designed it to look like:
>
> source enumerator (enumHandle pretty much) ->
> chunk by lines (enumeratee) ->
> parse a line into an Object (enumeratee) ->
> filter objects based on a criteria (enumeratee) ->
> limit some keys from each object (enumeratee) ->
> encode the object into a lazy bytestring (enumeratee) ->
> output the file to stdout (iteratee)
If there is no specific reason to use lazy ByteStrings, I would suggest
that you use a concept complementary to iteratees, the blaze-builder
library for efficient stream output.
Greets,
Ertugrul
--
nightmare = unsafePerformIO (getWrongWife >>= sex)
http://ertes.de/
More information about the Beginners
mailing list