<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: My shame is complete</title>
	<atom:link href="http://www.dougalstanton.net/blog/index.php/2008/02/26/my-shame-is-complete/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dougalstanton.net/blog/index.php/2008/02/26/my-shame-is-complete/</link>
	<description></description>
	<lastBuildDate>Wed, 30 Nov 2011 18:21:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Porges</title>
		<link>http://www.dougalstanton.net/blog/index.php/2008/02/26/my-shame-is-complete/comment-page-1/#comment-462</link>
		<dc:creator>Porges</dc:creator>
		<pubDate>Wed, 12 Mar 2008 04:32:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.dougalstanton.net/blog/index.php/2008/02/26/my-shame-is-complete#comment-462</guid>
		<description>&lt;p&gt;I had a similar version which I posted shortly after I saw this... it doesn’t seem to have shown up in the trackbacks for this post, so I’ll link it manually :)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://porg.es/blog/&quot; rel=&quot;nofollow&quot;&gt;My version.&lt;/a&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I had a similar version which I posted shortly after I saw this&#8230; it doesn’t seem to have shown up in the trackbacks for this post, so I’ll link it manually :)</p>

<p><a href="http://porg.es/blog/" rel="nofollow">My version.</a></p>]]></content:encoded>
	</item>
	<item>
		<title>By: apfelmus</title>
		<link>http://www.dougalstanton.net/blog/index.php/2008/02/26/my-shame-is-complete/comment-page-1/#comment-406</link>
		<dc:creator>apfelmus</dc:creator>
		<pubDate>Thu, 28 Feb 2008 03:12:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.dougalstanton.net/blog/index.php/2008/02/26/my-shame-is-complete#comment-406</guid>
		<description>&lt;p&gt;Seeing &lt;code&gt;Maybe a&lt;/code&gt; as the a finite map (container) with only one possible key (think of &lt;code&gt;Data.Map () a&lt;/code&gt;), the canonical name for &lt;code&gt;maybeWith&lt;/code&gt; would be &lt;code&gt;unionWith&lt;/code&gt;. This doesn&#039;t conceptually fit into Monad or MonadPlus, so I don&#039;t know a really short way to get it from there.&lt;/p&gt;

&lt;p&gt;However, the cases &lt;code&gt;maybeWith (++)&lt;/code&gt; and &lt;code&gt;maybeWith const&lt;/code&gt; are special. The latter is the monoid operation on &lt;code&gt;Maybe [a]&lt;/code&gt; and the latter is &lt;code&gt;mplus&lt;/code&gt;. (It can be debated whether the Monoid instance is wrong in the sense that we should have &lt;code&gt;mappend = mplus&lt;/code&gt;.) In other words, we have&lt;/p&gt;

&lt;p&gt;maybeWith (++) = mappend
   maybeWith const = mplus&lt;/p&gt;

&lt;p&gt;And to avoid the potentially &quot;unsafe&quot; call to &lt;code&gt;fromJust&lt;/code&gt; (could raise an exception), we can appeal to&lt;/p&gt;

&lt;p&gt;x &lt;code&gt;mplus&lt;/code&gt; Just y = fromMaybe y x&lt;/p&gt;

&lt;p&gt;Putting everything together, we get the solution&lt;/p&gt;

&lt;p&gt;
&lt;pre&gt;...
fizzbuzz = zipWith mappend fizz buzz
numbers = map show [1..]
results = zipWith fromMaybe numbers fizzbuzz&lt;/pre&gt;
&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Seeing <code>Maybe a</code> as the a finite map (container) with only one possible key (think of <code>Data.Map () a</code>), the canonical name for <code>maybeWith</code> would be <code>unionWith</code>. This doesn&#8217;t conceptually fit into Monad or MonadPlus, so I don&#8217;t know a really short way to get it from there.</p>

<p>However, the cases <code>maybeWith (++)</code> and <code>maybeWith const</code> are special. The latter is the monoid operation on <code>Maybe [a]</code> and the latter is <code>mplus</code>. (It can be debated whether the Monoid instance is wrong in the sense that we should have <code>mappend = mplus</code>.) In other words, we have</p>

<p>maybeWith (++) = mappend
   maybeWith const = mplus</p>

<p>And to avoid the potentially &#8220;unsafe&#8221; call to <code>fromJust</code> (could raise an exception), we can appeal to</p>

<p>x <code>mplus</code> Just y = fromMaybe y x</p>

<p>Putting everything together, we get the solution</p>

<p>
<pre>...
fizzbuzz = zipWith mappend fizz buzz
numbers = map show [1..]
results = zipWith fromMaybe numbers fizzbuzz</pre>
</p>]]></content:encoded>
	</item>
	<item>
		<title>By: liz Hare</title>
		<link>http://www.dougalstanton.net/blog/index.php/2008/02/26/my-shame-is-complete/comment-page-1/#comment-404</link>
		<dc:creator>liz Hare</dc:creator>
		<pubDate>Wed, 27 Feb 2008 23:27:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.dougalstanton.net/blog/index.php/2008/02/26/my-shame-is-complete#comment-404</guid>
		<description>&lt;p&gt;I wish I understood  these replies, but I can tell tell it&#039;s exciting stuff&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I wish I understood  these replies, but I can tell tell it&#8217;s exciting stuff</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Dougal</title>
		<link>http://www.dougalstanton.net/blog/index.php/2008/02/26/my-shame-is-complete/comment-page-1/#comment-398</link>
		<dc:creator>Dougal</dc:creator>
		<pubDate>Wed, 27 Feb 2008 12:36:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.dougalstanton.net/blog/index.php/2008/02/26/my-shame-is-complete#comment-398</guid>
		<description>&lt;p&gt;Yeah Rob, it&#039;s a wee bit embarrassing considering the less-than-intellectually-heavyweight subject of this post. ;-)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Yeah Rob, it&#8217;s a wee bit embarrassing considering the less-than-intellectually-heavyweight subject of this post. ;-)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Hulme</title>
		<link>http://www.dougalstanton.net/blog/index.php/2008/02/26/my-shame-is-complete/comment-page-1/#comment-397</link>
		<dc:creator>Robert Hulme</dc:creator>
		<pubDate>Wed, 27 Feb 2008 12:08:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.dougalstanton.net/blog/index.php/2008/02/26/my-shame-is-complete#comment-397</guid>
		<description>&lt;p&gt;You made programming.reddit!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>You made programming.reddit!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Dougal</title>
		<link>http://www.dougalstanton.net/blog/index.php/2008/02/26/my-shame-is-complete/comment-page-1/#comment-396</link>
		<dc:creator>Dougal</dc:creator>
		<pubDate>Wed, 27 Feb 2008 10:22:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.dougalstanton.net/blog/index.php/2008/02/26/my-shame-is-complete#comment-396</guid>
		<description>&lt;p&gt;@Greg:&lt;/p&gt;

&lt;p&gt;Yep, you&#039;re right. That works perfectly. (I fixed the formatting for you. The comments use Markdown syntax for future reference.)&lt;/p&gt;

&lt;p&gt;@Chris:&lt;/p&gt;

&lt;p&gt;That looks pretty interesting. I still don&#039;t have a proper understanding of continuation use but I can see the gist of your solution.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Greg:</p>

<p>Yep, you&#8217;re right. That works perfectly. (I fixed the formatting for you. The comments use Markdown syntax for future reference.)</p>

<p>@Chris:</p>

<p>That looks pretty interesting. I still don&#8217;t have a proper understanding of continuation use but I can see the gist of your solution.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Chris K</title>
		<link>http://www.dougalstanton.net/blog/index.php/2008/02/26/my-shame-is-complete/comment-page-1/#comment-395</link>
		<dc:creator>Chris K</dc:creator>
		<pubDate>Wed, 27 Feb 2008 03:52:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.dougalstanton.net/blog/index.php/2008/02/26/my-shame-is-complete#comment-395</guid>
		<description>&lt;p&gt;Well, Robert, you could look at the &quot;main1&quot; version at http://hpaste.org/5934 to see &quot;ContT IO&quot;  used. And using a new Monoid in main2 and main3 is one of my favorite styles.   It combines the separate Fizz and Buzz specifications to solve the problem.  So adding new rules that combine in the same way is trivial.  And they all should scale well to large numbers.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Well, Robert, you could look at the &#8220;main1&#8221; version at <a href="http://hpaste.org/5934" rel="nofollow">http://hpaste.org/5934</a> to see &#8220;ContT IO&#8221;  used. And using a new Monoid in main2 and main3 is one of my favorite styles.   It combines the separate Fizz and Buzz specifications to solve the problem.  So adding new rules that combine in the same way is trivial.  And they all should scale well to large numbers.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Buchholz</title>
		<link>http://www.dougalstanton.net/blog/index.php/2008/02/26/my-shame-is-complete/comment-page-1/#comment-394</link>
		<dc:creator>Greg Buchholz</dc:creator>
		<pubDate>Wed, 27 Feb 2008 02:04:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.dougalstanton.net/blog/index.php/2008/02/26/my-shame-is-complete#comment-394</guid>
		<description>&lt;p&gt;...there&#039;s supposed to be backquotes around the &quot;mplus&quot;.  Might be nice to have a preview feature.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>&#8230;there&#8217;s supposed to be backquotes around the &#8220;mplus&#8221;.  Might be nice to have a preview feature.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Buchholz</title>
		<link>http://www.dougalstanton.net/blog/index.php/2008/02/26/my-shame-is-complete/comment-page-1/#comment-393</link>
		<dc:creator>Greg Buchholz</dc:creator>
		<pubDate>Wed, 27 Feb 2008 02:02:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.dougalstanton.net/blog/index.php/2008/02/26/my-shame-is-complete#comment-393</guid>
		<description>&lt;p&gt;What about (untested):&lt;/p&gt;

&lt;pre&gt;maybeWith f a b = liftM2 f a b `mplus` a `mplus` b&lt;/pre&gt;
</description>
		<content:encoded><![CDATA[<p>What about (untested):</p>

<pre>maybeWith f a b = liftM2 f a b `mplus` a `mplus` b</pre>]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Hulme</title>
		<link>http://www.dougalstanton.net/blog/index.php/2008/02/26/my-shame-is-complete/comment-page-1/#comment-392</link>
		<dc:creator>Robert Hulme</dc:creator>
		<pubDate>Wed, 27 Feb 2008 02:01:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.dougalstanton.net/blog/index.php/2008/02/26/my-shame-is-complete#comment-392</guid>
		<description>&lt;p&gt;What the hell? There&#039;s no way I&#039;m accepting this.&lt;/p&gt;

&lt;p&gt;I want a solution with Monad Transformers and Arrows.&lt;/p&gt;

&lt;p&gt;What are they teaching you kids these days?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>What the hell? There&#8217;s no way I&#8217;m accepting this.</p>

<p>I want a solution with Monad Transformers and Arrows.</p>

<p>What are they teaching you kids these days?</p>]]></content:encoded>
	</item>
</channel>
</rss>

