<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Transliterating python to haskell: Fibonacci in the state monad</title>
	<atom:link href="http://blog.patch-tag.com/2009/12/07/transliterating-python-to-haskell-fibonacci-in-the-state-monad/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.patch-tag.com/2009/12/07/transliterating-python-to-haskell-fibonacci-in-the-state-monad/</link>
	<description>give your code a home</description>
	<lastBuildDate>Thu, 08 Dec 2011 09:25:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: TIK</title>
		<link>http://blog.patch-tag.com/2009/12/07/transliterating-python-to-haskell-fibonacci-in-the-state-monad/#comment-436</link>
		<dc:creator><![CDATA[TIK]]></dc:creator>
		<pubDate>Thu, 08 Dec 2011 09:25:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.patch-tag.com/?p=266#comment-436</guid>
		<description><![CDATA[Even simpler version:

fib = f n 0 1
f 0 a b = a
f n a b = f (n-1) b (a+b)]]></description>
		<content:encoded><![CDATA[<p>Even simpler version:</p>
<p>fib = f n 0 1<br />
f 0 a b = a<br />
f n a b = f (n-1) b (a+b)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thomashartman1</title>
		<link>http://blog.patch-tag.com/2009/12/07/transliterating-python-to-haskell-fibonacci-in-the-state-monad/#comment-118</link>
		<dc:creator><![CDATA[thomashartman1]]></dc:creator>
		<pubDate>Sun, 17 Jan 2010 18:42:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.patch-tag.com/?p=266#comment-118</guid>
		<description><![CDATA[I kind of doubt it, because if you try to to do any kind of recursive fib in python you run into &quot;maximum recursion levels&quot; exceeded error.]]></description>
		<content:encoded><![CDATA[<p>I kind of doubt it, because if you try to to do any kind of recursive fib in python you run into &#8220;maximum recursion levels&#8221; exceeded error.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thomashartman1</title>
		<link>http://blog.patch-tag.com/2009/12/07/transliterating-python-to-haskell-fibonacci-in-the-state-monad/#comment-117</link>
		<dc:creator><![CDATA[thomashartman1]]></dc:creator>
		<pubDate>Sun, 17 Jan 2010 18:41:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.patch-tag.com/?p=266#comment-117</guid>
		<description><![CDATA[My point is that what&#039;s more idiomatic depends on what your context (or your primary programming language) is.

This post was aimed at pythonistas, and people that claim that haskell is a single paradigm language that is unfriendly to people that only have experience in imperative programming.]]></description>
		<content:encoded><![CDATA[<p>My point is that what&#8217;s more idiomatic depends on what your context (or your primary programming language) is.</p>
<p>This post was aimed at pythonistas, and people that claim that haskell is a single paradigm language that is unfriendly to people that only have experience in imperative programming.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bryanstamour.com/blog &#187; Blog Archive &#187; Decking the halls with fibonaccis</title>
		<link>http://blog.patch-tag.com/2009/12/07/transliterating-python-to-haskell-fibonacci-in-the-state-monad/#comment-116</link>
		<dc:creator><![CDATA[bryanstamour.com/blog &#187; Blog Archive &#187; Decking the halls with fibonaccis]]></dc:creator>
		<pubDate>Tue, 15 Dec 2009 03:33:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.patch-tag.com/?p=266#comment-116</guid>
		<description><![CDATA[[...] below method comes courtesy of Thomas Hartman from the Patch-Tag blog. I belive that it shows how elegant Haskell code can look, even while using the State Monad to hide [...]]]></description>
		<content:encoded><![CDATA[<p>[...] below method comes courtesy of Thomas Hartman from the Patch-Tag blog. I belive that it shows how elegant Haskell code can look, even while using the State Monad to hide [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chaddaï</title>
		<link>http://blog.patch-tag.com/2009/12/07/transliterating-python-to-haskell-fibonacci-in-the-state-monad/#comment-115</link>
		<dc:creator><![CDATA[Chaddaï]]></dc:creator>
		<pubDate>Mon, 14 Dec 2009 17:53:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.patch-tag.com/?p=266#comment-115</guid>
		<description><![CDATA[I would probably write it :

&gt; fib n = flip evalState (0,1) $ do
&gt;   replicateM n $ modify (\(a,b) -&gt; (b,a+b))
&gt;   gets fst]]></description>
		<content:encoded><![CDATA[<p>I would probably write it :</p>
<p>&gt; fib n = flip evalState (0,1) $ do<br />
&gt;   replicateM n $ modify (\(a,b) -&gt; (b,a+b))<br />
&gt;   gets fst</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Leimbach</title>
		<link>http://blog.patch-tag.com/2009/12/07/transliterating-python-to-haskell-fibonacci-in-the-state-monad/#comment-114</link>
		<dc:creator><![CDATA[Dave Leimbach]]></dc:creator>
		<pubDate>Mon, 14 Dec 2009 15:29:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.patch-tag.com/?p=266#comment-114</guid>
		<description><![CDATA[Sorry, I forgot the part where I was wondering if what I just wrote could be written similarly in Python.  

It&#039;s good to see code expressed similarly between languages, but it makes me wonder if there&#039;s another perhaps more expressive way to do the same in Python too!]]></description>
		<content:encoded><![CDATA[<p>Sorry, I forgot the part where I was wondering if what I just wrote could be written similarly in Python.  </p>
<p>It&#8217;s good to see code expressed similarly between languages, but it makes me wonder if there&#8217;s another perhaps more expressive way to do the same in Python too!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Leimbach</title>
		<link>http://blog.patch-tag.com/2009/12/07/transliterating-python-to-haskell-fibonacci-in-the-state-monad/#comment-113</link>
		<dc:creator><![CDATA[Dave Leimbach]]></dc:creator>
		<pubDate>Mon, 14 Dec 2009 15:26:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.patch-tag.com/?p=266#comment-113</guid>
		<description><![CDATA[Nice work!

How about

modify \x -&gt; (snd x, (snd x) + (fst x))

instead of &quot;get&quot; then &quot;put&quot;

for your state update.

And you can do &quot;return $ gets fst&quot;  rather than getting b again and not using it.  :-)

I actually wonder what the point-free version of that modify lambda expression would look like.]]></description>
		<content:encoded><![CDATA[<p>Nice work!</p>
<p>How about</p>
<p>modify \x -&gt; (snd x, (snd x) + (fst x))</p>
<p>instead of &#8220;get&#8221; then &#8220;put&#8221;</p>
<p>for your state update.</p>
<p>And you can do &#8220;return $ gets fst&#8221;  rather than getting b again and not using it.  <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>I actually wonder what the point-free version of that modify lambda expression would look like.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yitz</title>
		<link>http://blog.patch-tag.com/2009/12/07/transliterating-python-to-haskell-fibonacci-in-the-state-monad/#comment-112</link>
		<dc:creator><![CDATA[yitz]]></dc:creator>
		<pubDate>Mon, 14 Dec 2009 14:19:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.patch-tag.com/?p=266#comment-112</guid>
		<description><![CDATA[How about:

fib :: Integer -&gt; Integer
fib n = flip evalState (0,1) $ do
  replicateM n $ do
    modify $ \(a,b) -&gt; (b,a+b)
  gets fst]]></description>
		<content:encoded><![CDATA[<p>How about:</p>
<p>fib :: Integer -&gt; Integer<br />
fib n = flip evalState (0,1) $ do<br />
  replicateM n $ do<br />
    modify $ \(a,b) -&gt; (b,a+b)<br />
  gets fst</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JadeNB</title>
		<link>http://blog.patch-tag.com/2009/12/07/transliterating-python-to-haskell-fibonacci-in-the-state-monad/#comment-111</link>
		<dc:creator><![CDATA[JadeNB]]></dc:creator>
		<pubDate>Mon, 14 Dec 2009 05:56:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.patch-tag.com/?p=266#comment-111</guid>
		<description><![CDATA[Is this really more idiomatic than lifting the assignment to argument-passing in the usual way?

fib n =
    let
        fib 0 a b = a
        fib n a b = fib $ n - 1 $ b $ a + b
    in fib n 0 1]]></description>
		<content:encoded><![CDATA[<p>Is this really more idiomatic than lifting the assignment to argument-passing in the usual way?</p>
<p>fib n =<br />
    let<br />
        fib 0 a b = a<br />
        fib n a b = fib $ n &#8211; 1 $ b $ a + b<br />
    in fib n 0 1</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brent</title>
		<link>http://blog.patch-tag.com/2009/12/07/transliterating-python-to-haskell-fibonacci-in-the-state-monad/#comment-110</link>
		<dc:creator><![CDATA[Brent]]></dc:creator>
		<pubDate>Sun, 13 Dec 2009 16:21:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.patch-tag.com/?p=266#comment-110</guid>
		<description><![CDATA[Instead of

  (a,b) &lt;- get
  put (b, a+b)

you could also do

  modify (snd &amp;&amp;&amp; uncurry (+))

Although whether that is clearer is up for debate. =)]]></description>
		<content:encoded><![CDATA[<p>Instead of</p>
<p>  (a,b) &lt;- get<br />
  put (b, a+b)</p>
<p>you could also do</p>
<p>  modify (snd &amp;&amp;&amp; uncurry (+))</p>
<p>Although whether that is clearer is up for debate. =)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

