<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Adventures in parsing</title>
	<atom:link href="http://therning.org/magnus/archives/289/feed" rel="self" type="application/rss+xml" />
	<link>http://therning.org/magnus/archives/289</link>
	<description>Incoherent mumblings</description>
	<pubDate>Tue, 06 Jan 2009 13:37:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: therning.org/ magnus &#187; Blog Archive &#187; More adventures in parsing</title>
		<link>http://therning.org/magnus/archives/289#comment-51920</link>
		<dc:creator>therning.org/ magnus &#187; Blog Archive &#187; More adventures in parsing</dc:creator>
		<pubDate>Tue, 29 May 2007 22:51:02 +0000</pubDate>
		<guid isPermaLink="false">http://therning.org/magnus/archives/289#comment-51920</guid>
		<description>&lt;p&gt;[...] received an interesting comment from Conal Elliott on my previous post on parsing. I have to admit I wasn&#8217;t sure I understood him at first, I&#8217;m still not sure I do, but [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] received an interesting comment from Conal Elliott on my previous post on parsing. I have to admit I wasn&#8217;t sure I understood him at first, I&#8217;m still not sure I do, but [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Magnus</title>
		<link>http://therning.org/magnus/archives/289#comment-51664</link>
		<dc:creator>Magnus</dc:creator>
		<pubDate>Tue, 29 May 2007 14:28:35 +0000</pubDate>
		<guid isPermaLink="false">http://therning.org/magnus/archives/289#comment-51664</guid>
		<description>&lt;p&gt;Conal,&lt;/p&gt;

&lt;p&gt;Good suggestion. At least if I understand what you mean :-)&lt;/p&gt;

&lt;p&gt;Something along the lines of&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;thenChar c f = f &#62;&#62;= (\ r -&#62; char c &#62;&#62; return r)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;with a specialised one for spaces maybe&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;thenSpace = thenChar ' '
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I suppose &lt;code&gt;liftM&lt;/code&gt; and friends can be employed to remove the function calling in the creation of &lt;code&gt;Address&lt;/code&gt;, &lt;code&gt;Device&lt;/code&gt; and &lt;code&gt;MemRegion&lt;/code&gt;. I'll try to venture into &lt;code&gt;Parsec&lt;/code&gt; territory once again soon and report on my findings. :-)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Conal,</p>
<p>Good suggestion. At least if I understand what you mean <img src='http://therning.org/magnus/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Something along the lines of</p>
<pre><code>thenChar c f = f &gt;&gt;= (\ r -&gt; char c &gt;&gt; return r)
</code></pre>
<p>with a specialised one for spaces maybe</p>
<pre><code>thenSpace = thenChar ' '
</code></pre>
<p>I suppose <code>liftM</code> and friends can be employed to remove the function calling in the creation of <code>Address</code>, <code>Device</code> and <code>MemRegion</code>. I&#8217;ll try to venture into <code>Parsec</code> territory once again soon and report on my findings. <img src='http://therning.org/magnus/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Conal Elliott</title>
		<link>http://therning.org/magnus/archives/289#comment-50636</link>
		<dc:creator>Conal Elliott</dc:creator>
		<pubDate>Mon, 28 May 2007 04:23:58 +0000</pubDate>
		<guid isPermaLink="false">http://therning.org/magnus/archives/289#comment-50636</guid>
		<description>&lt;p&gt;Congrats on your parser!&lt;/p&gt;

&lt;p&gt;Here's an idea that for getting more functional/applicative formulations.  Replace all of the explicitly sequential ("do") parsec code with liftM, liftM2, ....  From a quick read-through, I think you can do it.  For parseRegion, you could use an auxiliary function  that discards a following space, e.g. "thenSpace (many1 digit)".&lt;/p&gt;

&lt;p&gt;Also, play with factoring out some of the repeated patterns in parseAddress, parsePerms and parseDevice.&lt;/p&gt;

&lt;p&gt;The more I play with refactoring in my code, the more elegant it gets and the more insight I get.   Have fun!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Congrats on your parser!</p>
<p>Here&#8217;s an idea that for getting more functional/applicative formulations.  Replace all of the explicitly sequential (&#8221;do&#8221;) parsec code with liftM, liftM2, &#8230;.  From a quick read-through, I think you can do it.  For parseRegion, you could use an auxiliary function  that discards a following space, e.g. &#8220;thenSpace (many1 digit)&#8221;.</p>
<p>Also, play with factoring out some of the repeated patterns in parseAddress, parsePerms and parseDevice.</p>
<p>The more I play with refactoring in my code, the more elegant it gets and the more insight I get.   Have fun!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
