<?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: Even Digits Multiple Of Nine</title>
	<atom:link href="http://www.fsharp.it/2008/04/07/even-digits-multiple-of-nine/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fsharp.it/2008/04/07/even-digits-multiple-of-nine/</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: claudio</title>
		<link>http://www.fsharp.it/2008/04/07/even-digits-multiple-of-nine/comment-page-1/#comment-258</link>
		<dc:creator>claudio</dc:creator>
		<pubDate>Tue, 08 Apr 2008 12:41:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.fsharp.it/?p=25#comment-258</guid>
		<description>What about this one-liner?

[fsharp]
let answer = Seq.init_infinite (fun x -&gt; Int32.to_string (9*(x+1))) &#124;&gt; Seq.find (String.for_all (fun digit -&gt; (int_of_char digit) % 2 = 0))
[/fsharp]

However, the initial solution is much easier to understand than these new ones.</description>
		<content:encoded><![CDATA[<p>What about this one-liner?</p>
<pre class="brush: fsharp">
let answer = Seq.init_infinite (fun x -&gt; Int32.to_string (9*(x+1))) |&gt; Seq.find (String.for_all (fun digit -&gt; (int_of_char digit) % 2 = 0))
</pre>
<p>However, the initial solution is much easier to understand than these new ones.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: claudio</title>
		<link>http://www.fsharp.it/2008/04/07/even-digits-multiple-of-nine/comment-page-1/#comment-257</link>
		<dc:creator>claudio</dc:creator>
		<pubDate>Tue, 08 Apr 2008 10:46:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.fsharp.it/?p=25#comment-257</guid>
		<description>I can replace the Haskell show function with ToString().ToCharArray() to break a number into an array of digits and then I should be able to translate your code into F#.

I don&#039;t know if there is a better way, I&#039;ll test a little bit more and let you know.

Thanks for the suggestion!</description>
		<content:encoded><![CDATA[<p>I can replace the Haskell show function with ToString().ToCharArray() to break a number into an array of digits and then I should be able to translate your code into F#.</p>
<p>I don&#8217;t know if there is a better way, I&#8217;ll test a little bit more and let you know.</p>
<p>Thanks for the suggestion!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg M</title>
		<link>http://www.fsharp.it/2008/04/07/even-digits-multiple-of-nine/comment-page-1/#comment-256</link>
		<dc:creator>Greg M</dc:creator>
		<pubDate>Tue, 08 Apr 2008 10:14:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.fsharp.it/?p=25#comment-256</guid>
		<description>I wonder how this will come out...

&lt;code&gt;
head$filter (all (`elem` &quot;02468&quot;) . show) [9,18..]
&lt;/code&gt;

If that&#039;s visible at all, that&#039;s the way I&#039;d do it in Haskell. I don&#039;t know the F# syntax or libs so well, but you might be able to simplify your solution along these lines. Using show to break things into digits is a bit of a hack, but show is the only use case for digitization significant enough for inclusion in the standard libs - I can&#039;t quite convince myself it&#039;s wrong, since digits are fundamentally defined fundamentally as a display concern.</description>
		<content:encoded><![CDATA[<p>I wonder how this will come out&#8230;</p>
<p><code><br />
head$filter (all (`elem` "02468") . show) [9,18..]<br />
</code></p>
<p>If that&#8217;s visible at all, that&#8217;s the way I&#8217;d do it in Haskell. I don&#8217;t know the F# syntax or libs so well, but you might be able to simplify your solution along these lines. Using show to break things into digits is a bit of a hack, but show is the only use case for digitization significant enough for inclusion in the standard libs &#8211; I can&#8217;t quite convince myself it&#8217;s wrong, since digits are fundamentally defined fundamentally as a display concern.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
