[Haskell-beginners] Help with enumerator pipeline
Michael Xavier
nemesisdesign at gmail.com
Thu Sep 1 20:07:46 CEST 2011
I don't know how I missed that. I'll be learning blaze-builder then. Thanks!
On Thu, Sep 1, 2011 at 8:40 AM, Michael Snoyman <michael at snoyman.com> wrote:
> Actually, you can use fromValue[1] to get a Builder.
>
> [1]
> http://hackage.haskell.org/packages/archive/aeson/0.3.2.11/doc/html/Data-Aeson-Encode.html#v:fromValue
>
> On Thu, Sep 1, 2011 at 6:33 PM, Michael Xavier <nemesisdesign at gmail.com>
> wrote:
> > I've been meaning to take a look at blaze-builder anyways, but there is a
> > specific reason to use lazy ByteStrings. I'm using the Aeson library for
> > parsing/encoding JSON data. The encode function in that library chose
> lazy
> > ByteStrings as the output format. While performance on this project is a
> > factor, I'm reimplementing a project done in Ruby, so it won't be too
> hard
> > to best it in that dimension in Haskell, regardless of the output format
> ;)
> >
> > On Thu, Sep 1, 2011 at 7:27 AM, Ertugrul Soeylemez <es at ertes.de> wrote:
> >>
> >> 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/
> >>
> >>
> >>
> >> _______________________________________________
> >> Beginners mailing list
> >> Beginners at haskell.org
> >> http://www.haskell.org/mailman/listinfo/beginners
> >
> >
> >
> > --
> > Michael Xavier
> > http://www.michaelxavier.net
> > LinkedIn
> >
> > _______________________________________________
> > Beginners mailing list
> > Beginners at haskell.org
> > http://www.haskell.org/mailman/listinfo/beginners
> >
> >
>
--
Michael Xavier
http://www.michaelxavier.net
LinkedIn <http://www.linkedin.com/pub/michael-xavier/13/b02/a26>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20110901/ae9fa1dd/attachment.htm>
More information about the Beginners
mailing list