<?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: C# Dictionary to F# Map</title>
	<atom:link href="http://www.jenkz.org/2008/07/18/c-dictionary-to-f-map/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jenkz.org/2008/07/18/c-dictionary-to-f-map/</link>
	<description>touching people with his noodly appendage</description>
	<pubDate>Fri, 30 Jul 2010 09:50:53 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: grahamsw</title>
		<link>http://www.jenkz.org/2008/07/18/c-dictionary-to-f-map/#comment-26</link>
		<dc:creator>grahamsw</dc:creator>
		<pubDate>Mon, 22 Dec 2008 17:41:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.jenkz.org/?p=13#comment-26</guid>
		<description>Tim, a quick hello from someone following much the same path, moving in a functional direction after many years in C/C++/C# land.

I've found the process slow, and the learning curve painfully steep, but completely fascinating, and rewarding. There's a dearth of good books, but if you have a solid grasp of the basics "F# for Scientists" is pretty good. 

A dictionary enumerates as a sequence of KeyValuePairs, so if d is the same Dictionary as above

d &#124;&#62; Seq.fold_left (fun acc kvp -&#62; acc.add kvp.Key kvp.Value) Map.empty

is all you need.

I'm translating "Programming Collective Intelligence", a pretty damn interesting book on data analysis - something I'm sure you MMO guys are all over - into F# over at http://code.google.com/p/dataviz 

I don't have much to show for it yet, but it's powerful stuff. Take a look if your interested.

http://cs.hubfs.net/ is also worth looking at if you haven't already.</description>
		<content:encoded><![CDATA[<p>Tim, a quick hello from someone following much the same path, moving in a functional direction after many years in C/C++/C# land.</p>
<p>I&#8217;ve found the process slow, and the learning curve painfully steep, but completely fascinating, and rewarding. There&#8217;s a dearth of good books, but if you have a solid grasp of the basics &#8220;F# for Scientists&#8221; is pretty good. </p>
<p>A dictionary enumerates as a sequence of KeyValuePairs, so if d is the same Dictionary as above</p>
<p>d |&gt; Seq.fold_left (fun acc kvp -&gt; acc.add kvp.Key kvp.Value) Map.empty</p>
<p>is all you need.</p>
<p>I&#8217;m translating &#8220;Programming Collective Intelligence&#8221;, a pretty damn interesting book on data analysis - something I&#8217;m sure you MMO guys are all over - into F# over at <a href="http://code.google.com/p/dataviz" rel="nofollow">http://code.google.com/p/dataviz</a> </p>
<p>I don&#8217;t have much to show for it yet, but it&#8217;s powerful stuff. Take a look if your interested.</p>
<p><a href="http://cs.hubfs.net/" rel="nofollow">http://cs.hubfs.net/</a> is also worth looking at if you haven&#8217;t already.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian McNamara</title>
		<link>http://www.jenkz.org/2008/07/18/c-dictionary-to-f-map/#comment-11</link>
		<dc:creator>Brian McNamara</dc:creator>
		<pubDate>Sat, 19 Jul 2008 19:49:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.jenkz.org/?p=13#comment-11</guid>
		<description>Looks like angle brackets were swallowed... trying again


#light

open System.Collections.Generic 
let d = new Dictionary&#60;string,int&#62;()
d.["one"] &#60;- 1
d.["two"] &#60;- 2
d.["three"] &#60;- 3
let keyValuePairs = (d :&#62; seq&#60;_&#62;)
let m = keyValuePairs &#124;&#62; Seq.map (fun kvp -&#62; (kvp.Key, kvp.Value)) &#124;&#62; Map.of_seq 
for kvp in m do
    printfn "%s -&#62; %d" kvp.Key kvp.Value</description>
		<content:encoded><![CDATA[<p>Looks like angle brackets were swallowed&#8230; trying again</p>
<p>#light</p>
<p>open System.Collections.Generic<br />
let d = new Dictionary&lt;string,int&gt;()<br />
d.["one"] &lt;- 1<br />
d.["two"] &lt;- 2<br />
d.["three"] &lt;- 3<br />
let keyValuePairs = (d :&gt; seq&lt;_&gt;)<br />
let m = keyValuePairs |&gt; Seq.map (fun kvp -&gt; (kvp.Key, kvp.Value)) |&gt; Map.of_seq<br />
for kvp in m do<br />
    printfn &#8220;%s -&gt; %d&#8221; kvp.Key kvp.Value</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian McNamara</title>
		<link>http://www.jenkz.org/2008/07/18/c-dictionary-to-f-map/#comment-10</link>
		<dc:creator>Brian McNamara</dc:creator>
		<pubDate>Sat, 19 Jul 2008 19:47:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.jenkz.org/?p=13#comment-10</guid>
		<description>Looks like many angle brackets were swallowed... trying again

#light

open System.Collections.Generic 
let d = new Dictionary&#60;string,int&#62;()
d.["one"] &#60;- 1
d.["two"]  seq&#60;_&#62;)
let m = keyValuePairs &#124;&#62; Seq.map (fun kvp -&#62; (kvp.Key, kvp.Value)) &#124;&#62; Map.of_seq 
for kvp in m do
    printfn "%s -&#62; %d" kvp.Key kvp.Value
</description>
		<content:encoded><![CDATA[<p>Looks like many angle brackets were swallowed&#8230; trying again</p>
<p>#light</p>
<p>open System.Collections.Generic<br />
let d = new Dictionary&lt;string,int&gt;()<br />
d.["one"] &lt;- 1<br />
d.["two"]  seq&lt;_&gt;)<br />
let m = keyValuePairs |&gt; Seq.map (fun kvp -&gt; (kvp.Key, kvp.Value)) |&gt; Map.of_seq<br />
for kvp in m do<br />
    printfn &#8220;%s -&gt; %d&#8221; kvp.Key kvp.Value</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian McNamara</title>
		<link>http://www.jenkz.org/2008/07/18/c-dictionary-to-f-map/#comment-9</link>
		<dc:creator>Brian McNamara</dc:creator>
		<pubDate>Sat, 19 Jul 2008 18:27:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.jenkz.org/?p=13#comment-9</guid>
		<description>I think Map.of_seq is the simplest way to do the conversion; consider:

#light

open System.Collections.Generic 
let d = new Dictionary()
d.["one"] &#60;- 1
d.["two"] &#60;- 2
d.["three"]  seq)
let m = keyValuePairs &#124;&#62; Seq.map (fun kvp -&#62; (kvp.Key, kvp.Value)) &#124;&#62; Map.of_seq 
for kvp in m do
    printfn "%s -&#62; %d" kvp.Key kvp.Value</description>
		<content:encoded><![CDATA[<p>I think Map.of_seq is the simplest way to do the conversion; consider:</p>
<p>#light</p>
<p>open System.Collections.Generic<br />
let d = new Dictionary()<br />
d.["one"] &lt;- 1<br />
d.["two"] &lt;- 2<br />
d.["three"]  seq)<br />
let m = keyValuePairs |&gt; Seq.map (fun kvp -&gt; (kvp.Key, kvp.Value)) |&gt; Map.of_seq<br />
for kvp in m do<br />
    printfn &#8220;%s -&gt; %d&#8221; kvp.Key kvp.Value</p>
]]></content:encoded>
	</item>
</channel>
</rss>
