Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1. Re:  Help with enumerator pipeline (Ertugrul Soeylemez)
   2. Re:  Help with enumerator pipeline (Michael Xavier)
   3. Re:  Help with enumerator pipeline (Michael Snoyman)
   4. Re:  Help with enumerator pipeline (Michael Xavier)


----------------------------------------------------------------------

Message: 1
Date: Thu, 1 Sep 2011 16:27:26 +0200
From: Ertugrul Soeylemez <[email protected]>
Subject: Re: [Haskell-beginners] Help with enumerator pipeline
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=US-ASCII

Michael Xavier <[email protected]> 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/





------------------------------

Message: 2
Date: Thu, 1 Sep 2011 08:33:34 -0700
From: Michael Xavier <[email protected]>
Subject: Re: [Haskell-beginners] Help with enumerator pipeline
To: Ertugrul Soeylemez <[email protected]>
Cc: [email protected]
Message-ID:
        <CANk=zmGq9wCzBQ5BsU6dxYV5MKPTi11dqO=ptpxybhhbqfb...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

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 <[email protected]> wrote:

> Michael Xavier <[email protected]> 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
> [email protected]
> 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/cece8aed/attachment-0001.htm>

------------------------------

Message: 3
Date: Thu, 1 Sep 2011 18:40:12 +0300
From: Michael Snoyman <[email protected]>
Subject: Re: [Haskell-beginners] Help with enumerator pipeline
To: Michael Xavier <[email protected]>
Cc: [email protected], Ertugrul Soeylemez <[email protected]>
Message-ID:
        <caka2jg+mn+umq617vgksbjpkcvof6-7dp1g5g09nkj-qsox...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

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 <[email protected]> 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 <[email protected]> wrote:
>>
>> Michael Xavier <[email protected]> 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
>> [email protected]
>> http://www.haskell.org/mailman/listinfo/beginners
>
>
>
> --
> Michael Xavier
> http://www.michaelxavier.net
> LinkedIn
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>



------------------------------

Message: 4
Date: Thu, 1 Sep 2011 11:07:46 -0700
From: Michael Xavier <[email protected]>
Subject: Re: [Haskell-beginners] Help with enumerator pipeline
To: Michael Snoyman <[email protected]>
Cc: [email protected], Ertugrul Soeylemez <[email protected]>
Message-ID:
        <CANk=zmFuguFRbKBOYW_qe6adN-A4aHaF21Cu1qz=mqt+jff...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

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 <[email protected]> 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 <[email protected]>
> 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 <[email protected]> wrote:
> >>
> >> Michael Xavier <[email protected]> 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
> >> [email protected]
> >> http://www.haskell.org/mailman/listinfo/beginners
> >
> >
> >
> > --
> > Michael Xavier
> > http://www.michaelxavier.net
> > LinkedIn
> >
> > _______________________________________________
> > Beginners mailing list
> > [email protected]
> > 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-0001.htm>

------------------------------

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 39, Issue 2
****************************************

Reply via email to