<?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: Project Euler in F# &#8211; Problem 55</title>
	<atom:link href="http://www.fsharp.it/2008/12/17/project-euler-in-f-problem-55/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fsharp.it/2008/12/17/project-euler-in-f-problem-55/</link>
	<description>Functional programming on .Net</description>
	<lastBuildDate>Tue, 23 Feb 2010 22:18:36 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Matt</title>
		<link>http://www.fsharp.it/2008/12/17/project-euler-in-f-problem-55/comment-page-1/#comment-1218</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Thu, 18 Dec 2008 05:14:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.fsharp.it/?p=78#comment-1218</guid>
		<description>Nice work!

3 quick things:
You can extend the String module with a &quot;reverse&quot; method since string implements Seq:
module String =
  let reverse (s : string) =
    new string(s &#124;&gt; Array.of_seq &#124;&gt; Array.rev)
    
Then your reverse method can be written more concisely:
let reverse (n : Math.BigInt) =
  n &#124;&gt; string &#124;&gt; String.reverse &#124;&gt; bigint.Parse

Also, for the filter at the end, you can just write it as:
&#124;&gt; Seq.filter isLychrel</description>
		<content:encoded><![CDATA[<p>Nice work!</p>
<p>3 quick things:<br />
You can extend the String module with a &#8220;reverse&#8221; method since string implements Seq:<br />
module String =<br />
  let reverse (s : string) =<br />
    new string(s |&gt; Array.of_seq |&gt; Array.rev)</p>
<p>Then your reverse method can be written more concisely:<br />
let reverse (n : Math.BigInt) =<br />
  n |&gt; string |&gt; String.reverse |&gt; bigint.Parse</p>
<p>Also, for the filter at the end, you can just write it as:<br />
|&gt; Seq.filter isLychrel</p>
]]></content:encoded>
	</item>
</channel>
</rss>
