<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Digital Moose Tracks &#187; F#</title>
	<atom:link href="http://digitalmoosetracks.com/blog/tag/f/feed" rel="self" type="application/rss+xml" />
	<link>http://digitalmoosetracks.com/blog</link>
	<description>.Net, MythTV and Me</description>
	<lastBuildDate>Mon, 08 Mar 2010 06:24:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>F# Active Patterns as function parameters</title>
		<link>http://digitalmoosetracks.com/blog/f-active-patterns-as-function-parameters</link>
		<comments>http://digitalmoosetracks.com/blog/f-active-patterns-as-function-parameters#comments</comments>
		<pubDate>Thu, 23 Jul 2009 23:33:09 +0000</pubDate>
		<dc:creator>joshua</dc:creator>
				<category><![CDATA[Programing]]></category>
		<category><![CDATA[F#]]></category>

		<guid isPermaLink="false">http://digitalmoosetracks.com/blog/f-active-patterns-as-function-parameters</guid>
		<description><![CDATA[When I first learned about active patterns in F# I thought they were pretty great.  Then I saw you this F# video and learned you can patterns as function parameters.  This lets you do stuff like the following. (note I stole the example from this F# video) open System.Drawing let (&#124;RGB&#124;) (color : Color) = [...]]]></description>
			<content:encoded><![CDATA[<p>When I first learned about active patterns in F# I thought they were pretty great.  Then I saw you <a href="http://channel9.msdn.com/posts/kmcgrath/Patterns-and-Match-Expressions-in-F/">this F# video</a> and learned you can patterns as function parameters.  This lets you do stuff like the following. (note I stole the example from <a href="http://channel9.msdn.com/posts/kmcgrath/Active-Patterns-F/">this F# video</a>)</p>
<pre class="brush: scala;">open System.Drawing

let (|RGB|) (color : Color) = (color.R, color.G, color.B)

let printRGB (RGB(r, g, b)) =
    printfn "%d, %d, %d" r g b

printRGB Color.Red</pre>
<p>I find this especially cool because I often have a wrapper function to do this sort of data transformation and this is far more elegant.</p>
]]></content:encoded>
			<wfw:commentRss>http://digitalmoosetracks.com/blog/f-active-patterns-as-function-parameters/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

