I don&#39;t know how I missed that. I&#39;ll be learning blaze-builder then. Thanks!<br><br><div class="gmail_quote">On Thu, Sep 1, 2011 at 8:40 AM, Michael Snoyman <span dir="ltr">&lt;<a href="mailto:michael@snoyman.com">michael@snoyman.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Actually, you can use fromValue[1] to get a Builder.<br>
<br>
[1] <a href="http://hackage.haskell.org/packages/archive/aeson/0.3.2.11/doc/html/Data-Aeson-Encode.html#v:fromValue" target="_blank">http://hackage.haskell.org/packages/archive/aeson/0.3.2.11/doc/html/Data-Aeson-Encode.html#v:fromValue</a><br>

<div><div></div><div class="h5"><br>
On Thu, Sep 1, 2011 at 6:33 PM, Michael Xavier &lt;<a href="mailto:nemesisdesign@gmail.com">nemesisdesign@gmail.com</a>&gt; wrote:<br>
&gt; I&#39;ve been meaning to take a look at blaze-builder anyways, but there is a<br>
&gt; specific reason to use lazy ByteStrings. I&#39;m using the Aeson library for<br>
&gt; parsing/encoding JSON data. The encode function in that library chose lazy<br>
&gt; ByteStrings as the output format. While performance on this project is a<br>
&gt; factor, I&#39;m reimplementing a project done in Ruby, so it won&#39;t be too hard<br>
&gt; to best it in that dimension in Haskell, regardless of the output format ;)<br>
&gt;<br>
&gt; On Thu, Sep 1, 2011 at 7:27 AM, Ertugrul Soeylemez &lt;<a href="mailto:es@ertes.de">es@ertes.de</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Michael Xavier &lt;<a href="mailto:nemesisdesign@gmail.com">nemesisdesign@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; &gt; I&#39;ve just recently started learning how to use the enumerator<br>
&gt;&gt; &gt; library. I&#39;m designing a utility that parses a file where each line is<br>
&gt;&gt; &gt; a JSON object.  I&#39;ve designed it to look like:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; source enumerator (enumHandle pretty much) -&gt;<br>
&gt;&gt; &gt; chunk by lines (enumeratee) -&gt;<br>
&gt;&gt; &gt; parse a line into an Object (enumeratee) -&gt;<br>
&gt;&gt; &gt; filter objects based on a criteria (enumeratee) -&gt;<br>
&gt;&gt; &gt; limit some keys from each object (enumeratee) -&gt;<br>
&gt;&gt; &gt; encode the object into a lazy bytestring (enumeratee) -&gt;<br>
&gt;&gt; &gt; output the file to stdout (iteratee)<br>
&gt;&gt;<br>
&gt;&gt; If there is no specific reason to use lazy ByteStrings, I would suggest<br>
&gt;&gt; that you use a concept complementary to iteratees, the blaze-builder<br>
&gt;&gt; library for efficient stream output.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Greets,<br>
&gt;&gt; Ertugrul<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; nightmare = unsafePerformIO (getWrongWife &gt;&gt;= sex)<br>
&gt;&gt; <a href="http://ertes.de/" target="_blank">http://ertes.de/</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Beginners mailing list<br>
&gt;&gt; <a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
&gt;&gt; <a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Michael Xavier<br>
&gt; <a href="http://www.michaelxavier.net" target="_blank">http://www.michaelxavier.net</a><br>
&gt; LinkedIn<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Beginners mailing list<br>
&gt; <a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
&gt; <a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Michael Xavier<br><a href="http://www.michaelxavier.net" target="_blank">http://www.michaelxavier.net</a><div><a href="http://www.linkedin.com/pub/michael-xavier/13/b02/a26" target="_blank">LinkedIn</a></div>
<br>