<?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>Rash thoughts about .NET, C#, F# and Dynamics NAV. &#187; F#</title>
	<atom:link href="http://www.navision-blog.de/tag/f-sharp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.navision-blog.de</link>
	<description>This Blog is about Microsoft Dynamics NAV (f.k.a Navision incl. C/SIDE and C/AL), C#, F# and .NET in general.</description>
	<lastBuildDate>Wed, 14 Jul 2010 11:12:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>&quot;Fake &#8211; F# Make&quot; 1.40.5.0 released &#8211; Bugfixes for CruiseControl.NET</title>
		<link>http://www.navision-blog.de/2010/07/14/fake-f-make-1-40-5-0-released-bugfixes-for-cruisecontrol-net/</link>
		<comments>http://www.navision-blog.de/2010/07/14/fake-f-make-1-40-5-0-released-bugfixes-for-cruisecontrol-net/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 09:15:05 +0000</pubDate>
		<dc:creator>Steffen Forkmann</dc:creator>
				<category><![CDATA[F#]]></category>
		<category><![CDATA[FAKE - F# Make]]></category>
		<category><![CDATA[docu]]></category>
		<category><![CDATA[F-sharp Make]]></category>
		<category><![CDATA[Fake]]></category>

		<guid isPermaLink="false">http://www.navision-blog.de/2010/07/14/fake-f-make-1-40-5-0-released-bugfixes-for-cruisecontrol-net/</guid>
		<description><![CDATA[Today I released “FAKE – F# Make” version 1.40.5.0. This release fixes some issues with CruiseControl.NET compatibility and improves the MSBuild task. Important links: Project page Download HTML Documentation Repository Changes for CruiseControl.NET Daniel Nauck created a FAKE task for CC.Net. This task allows a much easier configuration of FAKE. Please download the latest CC.NET [...]]]></description>
			<content:encoded><![CDATA[<p>Today I released “FAKE – F# Make” version 1.40.5.0. This release fixes some issues with <a href="http://confluence.public.thoughtworks.org/display/CCNET/Welcome+to+CruiseControl.NET">CruiseControl.NET</a> compatibility and improves the MSBuild task.</p>
<p>Important links:</p>
<ul>
<li><a href="http://bitbucket.org/forki/fake/wiki/Home">Project page</a></li>
<li><a href="http://bitbucket.org/forki/fake/downloads">Download</a></li>
<li><a href="http://www.navision-blog.de/fake/">HTML Documentation</a></li>
<li><a href="http://github.com/forki/FAKE">Repository</a></li>
<li><script src="http://www.ohloh.net/p/483999/widgets/project_thin_badge.js" type="text/javascript"></script></li>
</ul>
<h5>Changes for CruiseControl.NET</h5>
<p><a href="http://twitter.com/dnauck">Daniel Nauck</a> created a <a href="http://confluence.public.thoughtworks.org/display/CCNET/FAKE+Task">FAKE task for CC.Net</a>. This task allows a much easier configuration of FAKE. Please download the <a href="http://ccnetlive.thoughtworks.com/CCNet-builds/1.6.0/">latest CC.NET build</a> if you want to use it.</p>
<p>Daniel also created a <a href="http://build.nauck-it.de/server/build.nauck-it.de/ViewServerReport.aspx?Category=FAKE">FAKE build project on his server</a> which showed us some compatibility issues:</p>
<ul>
<li>In FAKE:
<ul>
<li>Race condition in FAKE’s trace functionality</li>
<li>Better XML tracing if something fails</li>
<li>The tracing buffer will be flushed after every build target</li>
<li>Every task has a Timeout property (Default: 5 min.)</li>
<li>Setting of environment variables fixed</li>
<li><a href="http://www.nunit.org/index.php?p=consoleCommandLine&amp;r=2.2">Showing labels in NUnit</a> is now the default</li>
</ul>
</li>
<li>In <a href="http://docu.jagregory.com/">Docu</a>:
<ul>
<li><a href="http://github.com/forki/docu/commit/80daa6b48cb7f652ff5646a45fce4b94619fad1f">Unhandled exception in Docu.exe</a></li>
</ul>
</li>
<li>In CC.NET:
<ul>
<li>Implemented <a href="http://confluence.public.thoughtworks.org/display/CCNET/Git+Source+Control+Block">support for git submodules</a> (<a href="http://jira.public.thoughtworks.org/browse/CCNET-1922">CCNET-1922</a>)</li>
</ul>
</li>
</ul>
<p>@Daniel: Thank you very much for helping me on this CruiseControl.NET stuff. I really appreciate this.</p>
<h5>MSBuild task changes</h5>
<p>The MSBuild task in FAKE gets a sequence of project files and compiles them in the given order. This might be slow if you have lots of dependent projects. Then MSBuild might analyze the dependencies over and over again. To fix this issue I currently see two possible solutions:</p>
<ol>
<li>Generate a temporary solution file and use this for compilation.</li>
<li>Analyze the given projects and remove all dependent projects from the list.</li>
</ol>
<p>FAKE 1.40.5.0 implements the second idea. If you have a better idea please contact me.</p>
<p>&copy;2010 <a href="http://www.navision-blog.de">Rash thoughts about .NET, C#, F# and Dynamics NAV.</a>. All Rights Reserved.</p>.]]></content:encoded>
			<wfw:commentRss>http://www.navision-blog.de/2010/07/14/fake-f-make-1-40-5-0-released-bugfixes-for-cruisecontrol-net/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>&#8220;Fake &#8211; F# Make&#8221; 1.33.0 released</title>
		<link>http://www.navision-blog.de/2010/07/11/fake-f-make-1-33-0-released/</link>
		<comments>http://www.navision-blog.de/2010/07/11/fake-f-make-1-33-0-released/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 15:11:49 +0000</pubDate>
		<dc:creator>Steffen Forkmann</dc:creator>
				<category><![CDATA[F#]]></category>
		<category><![CDATA[FAKE - F# Make]]></category>
		<category><![CDATA[F-sharp Make]]></category>
		<category><![CDATA[Fake]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[SideBySideSpecification]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[XPath]]></category>

		<guid isPermaLink="false">http://www.navision-blog.de/2010/07/11/fake-f-make-1-33-0-released/</guid>
		<description><![CDATA[Yesterday I released “FAKE – F# Make” version 1.33.0. This release has lots of small bug fixes and a couple of new features. Important links: Project page Download Repository Git helpers -Fake.Git.dll Git is a distributed revision control system with an emphasis on speed. Git was initially designed and developed by Linus Torvalds for Linux [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I released “FAKE – F# Make” version 1.33.0. This release has lots of small bug fixes and a couple of new features.</p>
<p>Important links:</p>
<ul>
<li><a href="http://bitbucket.org/forki/fake/wiki/Home">Project page</a></li>
<li><a href="http://bitbucket.org/forki/fake/downloads">Download</a></li>
<li><a href="http://github.com/forki/FAKE">Repository</a></li>
</ul>
<h5>Git helpers -Fake.Git.dll</h5>
<blockquote><p>Git is a distributed revision control system with an emphasis on speed. Git was initially designed and developed by Linus Torvalds for Linux kernel development. Every Git working directory is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server.</p>
<p>[<a href="http://en.wikipedia.org/wiki/Git_%28software%29">Wikipedia</a>]</p></blockquote>
<p>In the last couple of months I worked on small helper library for controlling <a href="http://en.wikipedia.org/wiki/Git_%28software%29">Git</a>. This library is now released as part of “FAKE – F# Make”. You can find the source code at <a title="http://github.com/forki/FAKE/tree/master/src/app/Fake.Git/" href="http://github.com/forki/FAKE/tree/master/src/app/Fake.Git/">http://github.com/forki/FAKE/tree/master/src/app/Fake.Git/</a>.</p>
<p>Features:</p>
<ul>
<li>Repository handling
<ul>
<li>init, clone</li>
</ul>
</li>
<li>Submodules
<ul>
<li>init, clone, information about submodules</li>
</ul>
</li>
<li>Branches
<ul>
<li>checkout, create, delete, merge, rebase, tag, pull, push, reset, commit, …</li>
</ul>
</li>
<li>SHA1 calculation</li>
</ul>
<h5>Documentation generation with James Gregory&#8217;s docu tool</h5>
<blockquote><p><strong>What&#8217;s a docu?</strong> A documentation generator for .Net that isn&#8217;t complicated, awkward, or difficult to use. Given an assembly and the XML that&#8217;s generated by Visual Studio, docu can produce an entire website of documentation with a single command.</p>
<p>[<a href="http://docu.jagregory.com/">docu website</a>]</p></blockquote>
<p>Fake comes bundled with James Gregory’s documentations generator “<a href="http://docu.jagregory.com/">docu</a>”, which converts <a href="http://msdn.microsoft.com/en-us/library/b2s063f7%28VS.71%29.aspx">XML-Documentation</a> comments into HTML files. All you need to do is downloading a <a href="http://bitbucket.org/forki/fake/downloads/templates.zip">template</a> and calling the docu task inside your build script:</p>
<pre style="font-family: consolas;">!+ (buildDir + <span style="color: maroon;">"*.dll"</span>)
     |&gt; Scan
     |&gt; Docu (<span style="color: blue;">fun</span> p <span style="color: blue;">-&gt;
</span>         {p <span style="color: blue;">with
</span>             ToolPath = docuPath + <span style="color: maroon;">"docu.exe"</span>
             TemplatesPath = templatesSrcDir
             OutputPath = docsDir })</pre>
<p>Since FAKE builds its own documentation with docu I started to add more (and hopefully better) XML doc comments. My plan is to describe more and more of the internal FAKE functions in the next releases. An updated HTML-document (generated via a <a href="http://docu.jagregory.com/">docu</a> task) can be found at <a title="http://www.navision-blog.de/fake/" href="http://www.navision-blog.de/fake/">http://www.navision-blog.de/fake/</a>.</p>
<h5>Side by side specification</h5>
<p>For Test-driven development (TDD) it’s sometimes nice to have the specifications next to the implementation files since the specs are considered as documentation.</p>
<p>By using a tool like <a title="VsCommands" href="http://mokosh.co.uk/vscommands/">VSCommands</a> it is possible to group the implementation with the specs (see also <a href="http://gist.github.com/457248">http://gist.github.com/457248</a>).</p>
<p>This “side by side specification” makes TDD a lot easier but of course  we don&#8217;t want to deploy the specification classes and the test data.</p>
<table>
<tbody>
<tr>
<td><img style="display: inline; border-width: 0px;" title="Side by side specification" src="http://www.navision-blog.de/images/FakeFMake1.33.0released_B55F/image.png" border="0" alt="Side by side specification" width="221" height="201" /></td>
<td>==&gt;</td>
<td><img style="display: inline; border-width: 0px;" title="After &quot;RemoveTestFromProject&quot;" src="http://www.navision-blog.de/images/FakeFMake1.33.0released_B55F/image_3.png" border="0" alt="After &quot;RemoveTestFromProject&quot;" width="142" height="117" /></td>
</tr>
</tbody>
</table>
<p>FAKE has a new feature which automatically removes all specification files and test framework references according to a given convention:</p>
<pre style="font-family: consolas;">Target <span style="color: maroon;">"BuildApp"</span> (<span style="color: blue;">fun</span> _ –<span style="color: blue;">&gt;
</span>      !+ <span style="color: maroon;">@"src\app\**\*.csproj"</span>
         |&gt; Scan
         |&gt; <strong>Seq.map (
             RemoveTestsFromProject
                 AllNUnitReferences      <span style="color: green;">// a default references convention</span>
                 AllSpecAndTestDataFiles <span style="color: green;">// a default file convention
</span>                 )</strong>
         |&gt; MSBuildRelease buildDir <span style="color: maroon;">"Build"</span>
         |&gt; Log <span style="color: maroon;">"AppBuild-Output: "</span>
)</pre>
<p>The conventions are simple functions and can be customized e.g.:</p>
<pre style="font-family: consolas;"><span style="color: green;">/// All Spec.cs or Spec.fs files and all files containing TestData</span>
<span style="color: blue;">let</span> AllSpecAndTestDataFiles elementName (s:string) =
     s.EndsWith <span style="color: maroon;">"Specs.cs"</span> ||
       s.EndsWith <span style="color: maroon;">"Specs.fs"</span> ||
       (elementName = <span style="color: maroon;">"Content"</span> &amp;&amp; s.Contains <span style="color: maroon;">"TestData"</span>)</pre>
<h5>Miscellaneous</h5>
<ul>
<li>SQL Server helpers are moved to Fake.SQL.dll
<ul>
<li>Additional functions for attaching and detaching databases.</li>
</ul>
</li>
<li>FileHelper.CopyCached function was added
<ul>
<li>Copies the files from a cache folder. If the files are not cached or the original files have a different write time the cache will be refreshed.</li>
</ul>
</li>
<li>EnvironmentHelper.environVarOrDefault added
<ul>
<li>Retrieves the environment variable or a given default.</li>
</ul>
</li>
<li>Fixed <a href="http://github.com/forki/FAKE/issues/closed#issue/3">Issue 3</a>: toRelativePath calculates paths with ..\..\ if needed</li>
<li>Added a build time report to the build output.</li>
<li>XPathReplace and XMLPoke tasks added.
<ul>
<li>Replaces text in an XML file at the location specified by an XPath expression.</li>
</ul>
</li>
<li><a href="http://research.microsoft.com/en-us/people/mbarnett/ilmerge.aspx">ILMerge</a> task added</li>
<li><a href="http://wix.sourceforge.net/">Windows Installer XML (WiX)</a> task added</li>
</ul>
<p>&copy;2010 <a href="http://www.navision-blog.de">Rash thoughts about .NET, C#, F# and Dynamics NAV.</a>. All Rights Reserved.</p>.]]></content:encoded>
			<wfw:commentRss>http://www.navision-blog.de/2010/07/11/fake-f-make-1-33-0-released/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>&#8220;FAKE &#8211; F# Make&#8221; 1.20.0 released</title>
		<link>http://www.navision-blog.de/2010/05/12/fake-f-make-1-20-0-released/</link>
		<comments>http://www.navision-blog.de/2010/05/12/fake-f-make-1-20-0-released/#comments</comments>
		<pubDate>Wed, 12 May 2010 12:26:43 +0000</pubDate>
		<dc:creator>Steffen Forkmann</dc:creator>
				<category><![CDATA[F#]]></category>
		<category><![CDATA[FAKE - F# Make]]></category>
		<category><![CDATA[F-sharp Make]]></category>

		<guid isPermaLink="false">http://www.navision-blog.de/2010/05/12/fake-f-make-1-20-0-released/</guid>
		<description><![CDATA[Today I released a new bugfix release for “FAKE – F# Make”. We fixed some path and logging issues and as a new feature we introduced the @@ operator which allows to combine paths. Download Repository &#169;2010 Rash thoughts about .NET, C#, F# and Dynamics NAV.. All Rights Reserved..]]></description>
			<content:encoded><![CDATA[<p>Today I released a new bugfix release for “FAKE – F# Make”. We fixed some path and logging issues and as a new feature we introduced the <a href="http://github.com/forki/FAKE/commit/540f8bc19b4a9dccecdee82ced779b7ac5036668">@@ operator</a> which allows to combine paths.</p>
<ul>
<li><a href="http://bitbucket.org/forki/fake/downloads">Download</a> </li>
<li><a href="http://github.com/forki/FAKE">Repository</a> </li>
</ul>
<p>&copy;2010 <a href="http://www.navision-blog.de">Rash thoughts about .NET, C#, F# and Dynamics NAV.</a>. All Rights Reserved.</p>.]]></content:encoded>
			<wfw:commentRss>http://www.navision-blog.de/2010/05/12/fake-f-make-1-20-0-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using a MailboxProcessor to speedup &#8220;FAKE &#8211; F# MAKE&#8221;</title>
		<link>http://www.navision-blog.de/2010/05/07/using-a-mailboxprocessor-to-speedup-fake-f-make/</link>
		<comments>http://www.navision-blog.de/2010/05/07/using-a-mailboxprocessor-to-speedup-fake-f-make/#comments</comments>
		<pubDate>Fri, 07 May 2010 11:37:28 +0000</pubDate>
		<dc:creator>Steffen Forkmann</dc:creator>
				<category><![CDATA[F#]]></category>
		<category><![CDATA[FAKE - F# Make]]></category>
		<category><![CDATA[F-sharp Make]]></category>
		<category><![CDATA[Fake]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.navision-blog.de/2010/05/07/using-a-mailboxprocessor-to-speedup-fake-f-make/</guid>
		<description><![CDATA[Earlier today I released “FAKE – F# Make” version 1.10.0. This new release contains a lot path issue fixes for Mono and a new architecture for logging and tracing. A guy named Joel Mueller had an awesome idea and sent me some patches. He noticed that TraceHelper.fs writes all messages synchronously to the console and/or [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier today I released <a href="http://bitbucket.org/forki/fake/downloads">“FAKE – F# Make” version 1.10.0</a>. This new release contains a lot path issue fixes for <a href="http://www.mono-project.com/Main_Page">Mono</a> and a new architecture for logging and tracing. </p>
<p>A guy named Joel Mueller had an awesome idea and sent me some patches. He noticed that TraceHelper.fs writes all messages synchronously to the console and/or a XML output file, which means the actual build operations must wait on the writing of hundreds of trace messages, slowing down the actual build.</p>
<p>His idea was to use a MailboxProcessor to buffer up the trace messages and write them out asynchronously, so that the actual build can proceed at full speed.</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: blue">type</span> Message = </p>
<p style="margin: 0px">&#160;&#160;&#160; { Text&#160;&#160;&#160;&#160;&#160; : string</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; Color&#160;&#160;&#160;&#160; : ConsoleColor</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; Newline&#160;&#160; : bool</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; Important : bool}</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// &#8230;.</span></p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">let</span> buffer = MailboxProcessor.Start (<span style="color: blue">fun</span> inbox <span style="color: blue">-&gt;</span></p>
<p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">let</span> <span style="color: blue">rec</span> loop () = </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; async {</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">let!</span> (msg:Message) = inbox.Receive()</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">match</span> traceMode <span style="color: blue">with</span></p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; | Console <span style="color: blue">-&gt;</span> logMessageToConsole msg</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; | Xml&#160;&#160;&#160;&#160; <span style="color: blue">-&gt;</span> appendXML msg.Text</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">return!</span> loop ()}</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">&#160;&#160;&#160; loop ())&#160;&#160;&#160;&#160;&#160; </p>
</p></div>
<p>Now all internal logging and tracing functions can post their their messages to the inbox of the MailboxProcessor:</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: green">/// Logs the specified string (via message buffer)</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> logMessage important newLine message =</p>
<p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">match</span> traceMode <span style="color: blue">with</span></p>
<p style="margin: 0px">&#160;&#160;&#160; | Console <span style="color: blue">-&gt;</span></p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; { Text = message; </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Important = important; </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Newline = newLine; </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Color = ConsoleColor.White }</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; |&gt; buffer.Post</p>
<p style="margin: 0px">&#160;&#160;&#160; | Xml&#160;&#160;&#160;&#160; <span style="color: blue">-&gt;</span> </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; { defaultMessage <span style="color: blue">with</span> </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Text = sprintf <span style="color: maroon">&quot;&lt;message&gt;&lt;![CDATA[%s]]&gt;&lt;/message&gt;&quot;</span> </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; message }</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; |&gt; buffer.Post </p>
</p></div>
<p>This idea reduces the build time of FAKE’s self build from 3 min. to 2 min. Which is really amazing, since I didn’t have to change anything in the build script. This version is compatible to the last released version.</p>
<p>Please download <a href="http://bitbucket.org/forki/fake/downloads">“FAKE – F# Make” version 1.10.0</a> and tell me what you think.</p>
<p>&copy;2010 <a href="http://www.navision-blog.de">Rash thoughts about .NET, C#, F# and Dynamics NAV.</a>. All Rights Reserved.</p>.]]></content:encoded>
			<wfw:commentRss>http://www.navision-blog.de/2010/05/07/using-a-mailboxprocessor-to-speedup-fake-f-make/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Solving KataYahtzee with F# and NaturalSpec</title>
		<link>http://www.navision-blog.de/2010/04/24/solving-kata-yahtzee-with-fsharp-and-naturalspec/</link>
		<comments>http://www.navision-blog.de/2010/04/24/solving-kata-yahtzee-with-fsharp-and-naturalspec/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 19:04:36 +0000</pubDate>
		<dc:creator>Steffen Forkmann</dc:creator>
				<category><![CDATA[F#]]></category>
		<category><![CDATA[Informatik]]></category>
		<category><![CDATA[Kata]]></category>
		<category><![CDATA[BDD]]></category>
		<category><![CDATA[Code Quality]]></category>
		<category><![CDATA[KataYahtzee]]></category>
		<category><![CDATA[NaturalSpec]]></category>
		<category><![CDATA[nunit]]></category>
		<category><![CDATA[TDD]]></category>

		<guid isPermaLink="false">http://www.navision-blog.de/2010/04/24/solving-kata-yahtzee-with-fsharp-and-naturalspec/</guid>
		<description><![CDATA[Today I’m starting a new blog post series about solving code katas in F# and with the help of my NaturalSpec project. A code kata is a programming exercise which helps to improve your skills through practice and repetition. In this series we want to use the Test Driven Development TDD approach which means in [...]]]></description>
			<content:encoded><![CDATA[<p>Today I’m starting a new blog post series about solving code katas in <a href="http://msdn.microsoft.com/en-us/fsharp/default.aspx">F#</a> and with the help of my <a href="http://bitbucket.org/forki/naturalspec/wiki/Home">NaturalSpec</a> project. A code kata is a programming exercise which helps to improve your skills through practice and repetition. In this series we want to use the <a href="http://en.wikipedia.org/wiki/Test-driven_development">Test Driven Development TDD</a> approach which means in the context of NaturalSpec that we have to write our specs before we implement the algorithm.</p>
<h4>Problem Description</h4>
<blockquote><p>“The game of yahtzee is a simple dice game. Each round, each player rolls five six sided dice. The player may choose to reroll some or all of the dice up to three times (including the original roll). The player then places the roll at a category, such as ones, twos, sixes, pair, two pairs etc. If the roll is compatible with the score, the player gets a score for this roll according to the rules. If the roll is not compatible, the player gets a score of zero for this roll. </p>
<p>The kata consists of creating the rules to score a roll in any of a predefined category. Given a roll and a category, the final solution should output the score for this roll placed in this category.”</p>
<p align="right">[<a href="http://www.codingdojo.org/cgi-bin/wiki.pl?KataYahtzee">codingdojo.org</a>]</p>
</blockquote>
<h5>Category 1 – Ones, Twos, Threes, Fours, Fives, Sixes</h5>
<blockquote><p>“Ones, Twos, Threes, Fours, Fives, Sixes: The player scores the sum of the dice that reads one, two, three, four, five or six, respectively. For example, 1, 1, 2, 4, 4 placed on &quot;fours&quot; gives 8 points.”</p>
</blockquote>
<p>After reading this category description we could come up with the following spec:</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: blue">module</span> Yahtzee.Specs</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">open</span> NaturalSpec</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">let</span> placed_on category list =</p>
<p style="margin: 0px">&#160;&#160;&#160; printMethod category</p>
<p style="margin: 0px">&#160;&#160;&#160; calcValue category list</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">[&lt;Scenario&gt;]&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given 1,1,2,4,4 placed on &quot;fours&quot; gives 8 points.&#8220; () =&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (1, 1, 2, 4, 4)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on Fours)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 8</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify</p>
</p></div>
<p>Since we really want to implement six different categories we should also add some more scenarios like this one:</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px">[&lt;Scenario&gt;]&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given 1,1,6,4,6 placed on &quot;sixes&quot; gives 12 points.&#8220; ()=&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (1, 1, 6, 4, 6)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on Sixes)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 12</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">// &#8230;</p>
</p></div>
<p>Now we have some specs but they will all fail since we don’t have anything implemented yet. So we have to come up with a model of dice rolls and categories. As the specs suggests we model the dice roll as a tuple of ints and the category as a <a href="http://msdn.microsoft.com/en-us/library/dd233226.aspx">discriminated union</a>:</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: blue">module</span> Yahtzee.Model</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">type</span> Roll = int * int * int * int * int</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">type</span> Category =</p>
<p style="margin: 0px">| Ones</p>
<p style="margin: 0px">| Twos</p>
<p style="margin: 0px">| Threes</p>
<p style="margin: 0px">| Fours</p>
<p style="margin: 0px">| Fives</p>
<p style="margin: 0px">| Sixes&#160;&#160; </p>
</p></div>
<p>The tuple is a natural choice for the dice roll, but for easier calculation we add a helper function which converts it into a list. This allows use to use the standard list functions and therefore summing the values becomes trivial:</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: blue">let</span> toList (roll:Roll) =</p>
<p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">let</span> a,b,c,d,e = roll</p>
<p style="margin: 0px">&#160;&#160;&#160; [a;b;c;d;e]</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">let</span> sumNumber number =</p>
<p style="margin: 0px">&#160;&#160;&#160; Seq.filter ((=) number)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; &gt;&gt; Seq.sum</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">let</span> calcValue category roll =</p>
<p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">let</span> list = toList roll</p>
<p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">match</span> category <span style="color: blue">with</span></p>
<p style="margin: 0px">&#160;&#160;&#160; | Ones&#160;&#160; <span style="color: blue">-&gt;</span> sumNumber 1 list</p>
<p style="margin: 0px">&#160;&#160;&#160; | Twos&#160;&#160; <span style="color: blue">-&gt;</span> sumNumber 2 list</p>
<p style="margin: 0px">&#160;&#160;&#160; | Threes <span style="color: blue">-&gt;</span> sumNumber 3 list</p>
<p style="margin: 0px">&#160;&#160;&#160; | Fours&#160; <span style="color: blue">-&gt;</span> sumNumber 4 list</p>
<p style="margin: 0px">&#160;&#160;&#160; | Fives&#160; <span style="color: blue">-&gt;</span> sumNumber 5 list</p>
<p style="margin: 0px">&#160;&#160;&#160; | Sixes&#160; <span style="color: blue">-&gt;</span> sumNumber 6 list</p>
</p></div>
<p>Now we can run our scenarios with any NUnit runner. I’m using the default <a href="http://www.nunit.org/">NUnit</a> GUI runner here, which gives me a picture like this:</p>
<p><img class="bordered" title="Both specs in NUnit" border="0" alt="Both specs in NUnit" src="http://www.navision-blog.de/images/SolvingKataYahtzeewithFandNaturalSpec_11049/image_thumb.png" width="500" height="342" /></p>
<h5>Category 2 – Pair</h5>
<blockquote><p>“Pair: The player scores the sum of the two highest matching dice. For example, 3, 3, 3, 4, 4 placed on &quot;pair&quot; gives 8.”</p>
</blockquote>
<p>The kata description gives us some new scenarios. As seen above we should specify them before writing the code.</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px">[&lt;Scenario&gt;]&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given 3,3,3,4,4 placed on &quot;pair&quot; gives 8.&#8220; () =&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (3, 3, 3, 4, 4)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on Pair)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 8</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">[&lt;Scenario&gt;]&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given 5,3,5,4,4 placed on &quot;pair&quot; gives 10.&#8220; () =&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (5, 3, 5, 4, 4)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on Pair)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 10</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify&#160;&#160;&#160; </p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">[&lt;Scenario&gt;]&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given 1,2,3,4,5 placed on &quot;pair&quot; gives 0.&#8220; () =&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (1, 2, 3, 4, 5)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on Pair)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 0</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify&#160;&#160;&#160;&#160;&#160; </p>
</p></div>
<p>Since we use a new category we now have to extend our model and the <strong>calcValue</strong> function:</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: blue">type</span> Category =</p>
<p style="margin: 0px">| Ones</p>
<p style="margin: 0px">&#160; <span style="color: green">// &#8230;</span></p>
<p style="margin: 0px">| Sixes</p>
<p style="margin: 0px">| Pair</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">// &#8230;</span></p>
<p style="margin: 0px"><span style="color: green"></span></p>
<p style="margin: 0px"><span style="color: blue">let</span> sumAsPair list number =</p>
<p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">let</span> numberCount = </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; list </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; |&gt; Seq.filter ((=) number) </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; |&gt; Seq.length</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">if</span> numberCount &gt;= 2 <span style="color: blue">then</span> 2 * number <span style="color: blue">else</span> 0</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">let</span> calcValue category roll =</p>
<p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">let</span> list = toList roll</p>
<p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">match</span> category <span style="color: blue">with</span></p>
<p style="margin: 0px">&#160;&#160;&#160; | Ones&#160;&#160; <span style="color: blue">-&gt;</span> sumNumber 1 list</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: green">// &#8230;</span></p>
<p style="margin: 0px">&#160;&#160;&#160; | Sixes&#160; <span style="color: blue">-&gt;</span> sumNumber 6 list</p>
<p style="margin: 0px">&#160;&#160;&#160; | Pair&#160;&#160; <span style="color: blue">-&gt;</span> </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; [1..6]</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; |&gt; Seq.map (sumAsPair list)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; |&gt; Seq.max&#160;&#160; </p>
</p></div>
<h5>Category 3 &#8211; Two pairs</h5>
<blockquote><p>“Two pairs: If there are two pairs of dice with the same number, the player scores the sum of these dice. If not, the player scores 0. For example, 1, 1, 2, 3, 3 placed on &quot;two pairs&quot; gives 8.”</p>
</blockquote>
<p> <strong></strong>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px">[&lt;Scenario&gt;]&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given 1,1,2,3,3 placed on &quot;two pair&quot; gives 8.&#8220; () =&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (1, 1, 2, 3, 3)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on TwoPair)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 8</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">[&lt;Scenario&gt;]&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given 1,6,6,3,3 placed on &quot;two pair&quot; gives 18.&#8220; () =&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (1, 6, 6, 3, 3)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on TwoPair)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 18</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">[&lt;Scenario&gt;]&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given 1,1,2,4,3 placed on &quot;two pair&quot; gives 0.&#8220; () =&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (1, 1, 2, 4, 3)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on TwoPair)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 0</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify&#160; </p>
</p></div>
<p>Implementing this category is a little bit tricky but with the help of our Pair function and some more standard sequence combinators we can get our spec green:</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: blue">type</span> Category =</p>
<p style="margin: 0px">| Ones</p>
<p style="margin: 0px">&#160; <span style="color: green">// &#8230;</span></p>
<p style="margin: 0px">| TwoPair</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">let</span> allPairs =</p>
<p style="margin: 0px">&#160;&#160;&#160; [<span style="color: blue">for</span> i <span style="color: blue">in</span> 1..6 <span style="color: blue">do</span></p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">for</span> j <span style="color: blue">in</span> 1..6 <span style="color: blue">-&gt;</span> i,j]</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">let</span> calcValue category roll =</p>
<p style="margin: 0px">&#160;&#160;&#160; <span style="color: green">// &#8230;</span></p>
<p style="margin: 0px">&#160;&#160;&#160; | TwoPair&#160;&#160; <span style="color: blue">-&gt;</span> </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; allPairs</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; |&gt; Seq.filter (<span style="color: blue">fun</span> (a,b) <span style="color: blue">-&gt;</span> a &lt;&gt; b)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; |&gt; Seq.map (<span style="color: blue">fun</span> (a,b) <span style="color: blue">-&gt;</span> </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">let</span> a&#8217; = sumAsPair list a</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">let</span> b&#8217; = sumAsPair list b</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">if</span> a&#8217; = 0 || b&#8217; = 0 <span style="color: blue">then</span> 0 <span style="color: blue">else</span> a&#8217; + b&#8217;)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; |&gt; Seq.max&#160;&#160;&#160;&#160; </p>
</p></div>
<h5>Category 4 &#8211; Three of a kind</h5>
<blockquote><p>“Three of a kind: If there are three dice with the same number, the player scores the sum of these dice. Otherwise, the player scores 0. For example, 3, 3, 3, 4, 5 places on &quot;three of a kind&quot; gives 9.”</p>
</blockquote>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px">[&lt;Scenario&gt;]&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given 3,3,3,4,5 placed on &quot;three of a kind&quot; gives 9&#8220;()=&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (3, 3, 3, 4, 5)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on ThreeOfAKind)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 9</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">[&lt;Scenario&gt;]&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given 3,4,3,4,5 placed on &quot;three of a kind&quot; gives 0&#8220;()=&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (3, 4, 3, 4, 5)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on ThreeOfAKind)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 0</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify </p>
</p></div>
<p>Now it is time to refactor our code. The <b>sumAsPair</b> function should be extended to a sumAsTuple function:</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: blue">type</span> Category =</p>
<p style="margin: 0px">| Ones</p>
<p style="margin: 0px">&#160; <span style="color: green">// &#8230;</span></p>
<p style="margin: 0px">| ThreeOfAKind</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">let</span> sumAsTuple value list number =</p>
<p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">let</span> numberCount = </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; list </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; |&gt; Seq.filter ((=) number) </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; |&gt; Seq.length</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">let</span> takeBestTuple value list =</p>
<p style="margin: 0px">&#160;&#160;&#160; [1..6]</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; |&gt; Seq.map (sumAsTuple value list)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; |&gt; Seq.max&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">if</span> numberCount &gt;= value <span style="color: blue">then</span> value * number <span style="color: blue">else</span> 0</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">let</span> calcValue category roll =</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; <span style="color: green">// &#8230;</span></p>
<p style="margin: 0px">&#160;&#160;&#160; | Pair&#160;&#160; <span style="color: blue">-&gt;</span> takeBestTuple 2 list</p>
<p style="margin: 0px">&#160;&#160;&#160; | TwoPair&#160;&#160; <span style="color: blue">-&gt;</span> </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; allPairs</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; |&gt; Seq.filter (<span style="color: blue">fun</span> (a,b) <span style="color: blue">-&gt;</span> a &lt;&gt; b)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; |&gt; Seq.map (<span style="color: blue">fun</span> (a,b) <span style="color: blue">-&gt;</span> </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">let</span> a&#8217; = sumAsTuple 2 list a</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">let</span> b&#8217; = sumAsTuple 2 list b</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">if</span> a&#8217; = 0 || b&#8217; = 0 <span style="color: blue">then</span> 0 <span style="color: blue">else</span> a&#8217; + b&#8217;)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; |&gt; Seq.max</p>
<p style="margin: 0px">&#160;&#160;&#160; | ThreeOfAKind –<span style="color: blue">&gt;</span> takeBestTuple 3 list</p>
</p></div>
<h5>Category 5 &#8211; Four of a kind</h5>
<blockquote><p>“Four of a kind: If there are four dice with the same number, the player scores the sum of these dice. Otherwise, the player scores 0. For example, 2, 2, 2, 2, 5 places on &quot;four of a kind&quot; gives 8.”</p>
</blockquote>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px">[&lt;Scenario&gt;]&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given 2,2,2,2,5 placed on &quot;four of a kind&quot; gives 8&#8220; ()=&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (2, 2, 2, 2, 5)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on FourOfAKind)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 8</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">[&lt;Scenario&gt;]&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given 2,6,2,2,5 placed on &quot;four of a kind&quot; gives 0&#8220; ()=&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (2, 6, 2, 2, 5)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on FourOfAKind)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 0</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify&#160;&#160; </p>
</p></div>
<p>With the help of the takeBestTuple function this becomes trivial:</p>
<p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"><span style="color: blue">type</span> Category =</p>
<p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt">| Ones</p>
<p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt">&#160; <span style="color: green">// &#8230;</span></p>
<p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt">| FourOfAKind</p>
<p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt">&#160;</p>
<p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"><span style="color: blue">let</span> calcValue category roll =</p>
<p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt">&#160;&#160;&#160;&#160;&#160; <span style="color: green">// &#8230;</span></p>
<p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt">&#160;&#160;&#160; | FourOfAKind&#160; <span style="color: blue">-&gt;</span> takeBestTuple 4 list</p>
<p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt">&#160;</p>
<h5>Category 6 – Small straight</h5>
<blockquote><p style="margin: 0px">“Small straight: If the dice read 1,2,3,4,5, the player scores 15 (the sum of all the dice), otherwise 0.”</p>
</blockquote>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px">[&lt;Scenario&gt;]&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given 1,2,3,4,5 placed on &quot;Small Straight&quot; gives 15&#8220;()=&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (1,2,3,4,5)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on SmallStraight)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 15</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">[&lt;Scenario&gt;]&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given 1,2,5,4,3 placed on &quot;Small Straight&quot; gives 15&#8220;()=&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (1,2,5,4,3)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on SmallStraight)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 15</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">[&lt;Scenario&gt;]&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given 1,2,6,4,3 placed on &quot;Small Straight&quot; gives 0&#8220;()=&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (1,2,6,4,3)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on SmallStraight)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 0</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify&#160; </p>
</p></div>
<p>As in all the above scenarios we don’t assume any specific order in our rolls but for this category it is easier to test if the data is sorted:</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: blue">type</span> Category =</p>
<p style="margin: 0px">| Ones</p>
<p style="margin: 0px">&#160; <span style="color: green">// &#8230;</span></p>
<p style="margin: 0px">| SmallStraight</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">let</span> calcValue category roll =</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; <span style="color: green">// &#8230;</span></p>
<p style="margin: 0px">&#160;&#160;&#160; | SmallStraight <span style="color: blue">-&gt;</span> </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">match</span> list |&gt; List.sort <span style="color: blue">with</span></p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; | [1;2;3;4;5] <span style="color: blue">-&gt;</span> 15</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; | _ <span style="color: blue">-&gt;</span> 0</p>
</p></div>
<h5>Category 7 – Large straight</h5>
<blockquote><p>“Large straight: If the dice read 2,3,4,5,6, the player scores 20 (the sum of all the dice), otherwise 0.”</p>
</blockquote>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px">[&lt;Scenario&gt;]&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given 2,3,4,5,6 placed on &quot;Large Straight&quot; gives 20&#8220;()=&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (2,3,4,5,6)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on LargeStraight)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 20</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">[&lt;Scenario&gt;]&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given 6,2,5,4,3 placed on &quot;Large Straight&quot; gives 20&#8220;()=&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (6,2,5,4,3)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on LargeStraight)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 20</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">[&lt;Scenario&gt;]&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given 1,2,6,4,3 placed on &quot;Large Straight&quot; gives 0&#8220;()=&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (1,2,6,4,3)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on LargeStraight)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 0</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify&#160; </p>
</p></div>
<p>Of course the implementation is exactly the same as for the small straight:</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: blue">type</span> Category =</p>
<p style="margin: 0px">| Ones</p>
<p style="margin: 0px">&#160; <span style="color: green">// &#8230;</span></p>
<p style="margin: 0px">| LargeStraight</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">let</span> calcValue category roll =</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; <span style="color: green">// &#8230;</span></p>
<p style="margin: 0px">&#160;&#160;&#160; | LargeStraight <span style="color: blue">-&gt;</span> </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">match</span> list |&gt; List.sort <span style="color: blue">with</span></p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; | [2;3;4;5;6] <span style="color: blue">-&gt;</span> 20</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; | _ <span style="color: blue">-&gt;</span> 0</p>
</p></div>
<h5>Category 8 – Full house</h5>
<blockquote><p>“Full house: If the dice are two of a kind and three of a kind, the player scores the sum of all the dice. For example, 1,1,2,2,2 placed on &quot;full house&quot; gives 8. 4,4,4,4,4 is not &quot;full house&quot;.”</p>
</blockquote>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px">[&lt;Scenario&gt;]&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given 1,1,2,2,2 placed on &quot;full house&quot; gives 8.&#8220; () =&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (1,1,2,2,2)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on FullHouse)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 8</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">[&lt;Scenario&gt;]&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given 4,4,4,4,4 placed on &quot;full house&quot; gives 0.&#8220; () =&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (4,4,4,4,4)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on FullHouse)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 0</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">[&lt;Scenario&gt;]&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given 1,1,2,3,2 placed on &quot;full house&quot; gives 0.&#8220; () =&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (1,1,2,3,2)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on FullHouse)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 0</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify </p>
</p></div>
<p>Implementing the FullHouse category is easy if we reuse our solutions to the Two pairs category:</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: blue">type</span> Category =</p>
<p style="margin: 0px">| Ones</p>
<p style="margin: 0px">&#160; <span style="color: green">// &#8230;</span></p>
<p style="margin: 0px">| FullHouse</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">let</span> takeBestCombo value1 value2 list =</p>
<p style="margin: 0px">&#160;&#160;&#160; allPairs</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; |&gt; Seq.filter (<span style="color: blue">fun</span> (a,b) <span style="color: blue">-&gt;</span> a &lt;&gt; b)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; |&gt; Seq.map (<span style="color: blue">fun</span> (a,b) <span style="color: blue">-&gt;</span> </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">let</span> a&#8217; = sumAsTuple value1 list a</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">let</span> b&#8217; = sumAsTuple value2 list b</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">if</span> a&#8217; = 0 || b&#8217; = 0 <span style="color: blue">then</span> 0 <span style="color: blue">else</span> a&#8217; + b&#8217;)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; |&gt; Seq.max</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">let</span> calcValue category roll =</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; <span style="color: green">// &#8230;</span></p>
<p style="margin: 0px">&#160;&#160;&#160; | TwoPair&#160;&#160; <span style="color: blue">-&gt;</span> takeBestCombo 2 2 list</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; <span style="color: green">// &#8230;</span></p>
<p style="margin: 0px">&#160;&#160;&#160; | FullHouse&#160;&#160; <span style="color: blue">-&gt;</span> takeBestCombo 2 3 list</p>
</p></div>
<h5>Category 9 – Yahtzee</h5>
<blockquote><p>“Yahtzee: If all dice are the have the same number, the player scores 50 points, otherwise 0.”</p>
</blockquote>
<p>Here we can use NaturalSpec&#8217;s ScenarioTemplates in order to specify all Yahtzees:</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px">[&lt;ScenarioTemplate(1)&gt;]</p>
<p style="margin: 0px">[&lt;ScenarioTemplate(2)&gt;]</p>
<p style="margin: 0px">[&lt;ScenarioTemplate(3)&gt;]</p>
<p style="margin: 0px">[&lt;ScenarioTemplate(4)&gt;]</p>
<p style="margin: 0px">[&lt;ScenarioTemplate(5)&gt;]</p>
<p style="margin: 0px">[&lt;ScenarioTemplate(6)&gt;]</p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given n,n,n,n,n placed on &quot;Yahtzee&quot; gives 50.&#8220; n =&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (n,n,n,n,n)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on Yahtzee)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 50</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">[&lt;Scenario&gt;]&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given 1,1,1,2,1 placed on &quot;Yahtzee&quot; gives 50.&#8220; () =&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (1,1,1,2,1)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on Yahtzee)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 0</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify</p>
</p></div>
<p>The implementation is pretty easy:</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: blue">type</span> Category =</p>
<p style="margin: 0px">| Ones</p>
<p style="margin: 0px">&#160; <span style="color: green">// &#8230;</span></p>
<p style="margin: 0px">| Yahtzee</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">let</span> calcValue category roll =</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; <span style="color: green">// &#8230;</span></p>
<p style="margin: 0px">&#160;&#160;&#160; | Yahtzee <span style="color: blue">-&gt;</span> </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">let</span> a,b,c,d,e = roll</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">if</span> a = b &amp;&amp; a = c &amp;&amp; a = d &amp;&amp; a = e <span style="color: blue">then</span> 50 <span style="color: blue">else</span> 0 </p>
</p></div>
<h5>Category 10 – Chance</h5>
<blockquote><p>“Chance: The player gets the sum of all dice, no matter what they read.”</p>
</blockquote>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px">[&lt;Scenario&gt;]&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given 1,1,1,2,1 placed on &quot;Chance&quot; gives 6.&#8220; () =&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (1,1,1,2,1)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on Chance)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 6</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">[&lt;Scenario&gt;]&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;Given 1,6,1,2,1 placed on &quot;Chance&quot; gives 11.&#8220; () =&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160;&#160; Given (1,6,1,2,1)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; When (placed_on Chance)</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; It should equal 11</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; |&gt; Verify</p>
</p></div>
<p>This seems to be the easiest category as we only have to sum the values:</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: blue">type</span> Category =</p>
<p style="margin: 0px">| Ones</p>
<p style="margin: 0px">&#160; <span style="color: green">// &#8230;</span></p>
<p style="margin: 0px">| Chance</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">let</span> calcValue category roll =</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; <span style="color: green">// &#8230;</span></p>
<p style="margin: 0px">&#160;&#160;&#160; | Chance <span style="color: blue">-&gt;</span> List.sum list</p>
</p></div>
<h5>Conclusion</h5>
<p>We used a lot of F#’s sequence combinators, pattern matching and discriminated unions in this kata. I think this shows that F# is very well suited for such a problem and with NaturalSpec we can easily use a TDD/BDD approach.</p>
<p>The complete source code can be found in the <a href="http://github.com/forki/NaturalSpec/tree/master/src/test/Spec.KataYahtzee/">NaturalSpec repository</a>.</p>
<p>If you want to know more about a specific part of the kata or NaturalSpec feel free to contact me.</p>
<p>&copy;2010 <a href="http://www.navision-blog.de">Rash thoughts about .NET, C#, F# and Dynamics NAV.</a>. All Rights Reserved.</p>.]]></content:encoded>
			<wfw:commentRss>http://www.navision-blog.de/2010/04/24/solving-kata-yahtzee-with-fsharp-and-naturalspec/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;FAKE &#8211; F# Make&#8221; and NaturalSpec released</title>
		<link>http://www.navision-blog.de/2010/04/13/fake-f-sharp-make-and-naturalspec-released/</link>
		<comments>http://www.navision-blog.de/2010/04/13/fake-f-sharp-make-and-naturalspec-released/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 08:06:46 +0000</pubDate>
		<dc:creator>Steffen Forkmann</dc:creator>
				<category><![CDATA[F#]]></category>
		<category><![CDATA[FAKE - F# Make]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[F-sharp Make]]></category>
		<category><![CDATA[NaturalSpec]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://www.navision-blog.de/2010/04/13/fake-f-make-and-naturalspec-released/</guid>
		<description><![CDATA[Yesterday Microsoft released the RTM versions of Visual Studio 2010, .NET Framework 4.0 and F# 2.0.0.0 and so it is time to announce the first official releases of “Fake – F# Make” and NaturalSpec. Both projects are now compatible with Visual Studio 2010 RC and RTM and the corresponding F# versions. Fake – F# Make [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday Microsoft released the RTM versions of <a href="http://www.microsoft.com/visualstudio/en-us/download">Visual Studio 2010</a>, .NET Framework 4.0 and <a href="http://msdn.microsoft.com/de-de/fsharp/cc835251%28en-us%29.aspx">F# 2.0.0.0</a> and so it is time to announce the first official releases of “<a href="http://bitbucket.org/forki/fake/wiki/Home">Fake – F# Make</a>” and <a href="http://bitbucket.org/forki/naturalspec/wiki/Home">NaturalSpec</a>. Both projects are now compatible with Visual Studio 2010 RC and RTM and the corresponding F# versions.</p>
<h5>Fake – F# Make version 1.0.0</h5>
<p>&quot;FAKE &#8211; F# Make&quot; is a build automation system, which is intended to provide a much better tooling support than XML-based build languages like MSBuild or NAnt. Due to its integration in F#, all benefits of the .NET Framework and functional programming can be used, including the extensive class library, powerful debuggers and integrated development environments like Visual Studio 2008, Visual Studio 2010 or SharpDevelop, which provide syntax highlighting and code completion.</p>
<p>Like F# itself the new build language was designed to be succinct, typed, declarative, extensible and easy to use.</p>
<ul>
<li><a href="http://bitbucket.org/forki/fake/wiki/Home">Project page</a> with samples and articles </li>
<li><a href="http://bitbucket.org/forki/fake/downloads/">Download page</a> </li>
<li><a href="http://github.com/forki/FAKE">Github repository</a> </li>
</ul>
<h5>NaturalSpec version 1.0.0</h5>
<p>NaturalSpec is a UnitTest framework based on <a href="http://www.nunit.org/">NUnit</a> and completely written in F# &#8211; but you don&#8217;t have to learn F# to use it. The idea is that you can write your spec mostly in a natural language like in the following sample:</p>
</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px">[&lt;Scenario&gt;]</p>
<p style="margin: 0px"><span style="color: blue">let</span> &#8220;When removing an element from a list it should not contain the element&#8220;() =</p>
<p style="margin: 0px">&#160; Given [1;2;3;4;5]&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: green">// &quot;Arrange&quot; test context</span></p>
<p style="margin: 0px">&#160;&#160;&#160; |&gt; When removing 3&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: green">// &quot;Act&quot;</span></p>
<p style="margin: 0px">&#160;&#160;&#160; |&gt; It shouldn&#8217;t contain 3&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: green">// &quot;Assert&quot;</span></p>
<p style="margin: 0px">&#160;&#160;&#160; |&gt; It should contain 4&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: green">// another assertion</span></p>
<p style="margin: 0px">&#160;&#160;&#160; |&gt; It should have (Length 4)&#160;&#160;&#160; <span style="color: green">// Assertion for length</span></p>
<p style="margin: 0px">&#160;&#160;&#160; |&gt; It shouldn&#8217;t have Duplicates <span style="color: green">// it contains duplicates ?</span></p>
<p style="margin: 0px">&#160;&#160;&#160; |&gt; Verify&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: green">// Verify scenario</span></p>
</p></div>
</p>
<ul>
<li><a href="http://bitbucket.org/forki/naturalspec/wiki/Home">Project page</a> with samples and articles </li>
<li><a href="http://bitbucket.org/forki/naturalspec/downloads/">Download page</a> </li>
<li><a href="http://github.com/forki/NaturalSpec">Github repository</a> </li>
</ul>
<p>If you have any questions about the projects feel free to contact me.</p>
<p>&copy;2010 <a href="http://www.navision-blog.de">Rash thoughts about .NET, C#, F# and Dynamics NAV.</a>. All Rights Reserved.</p>.]]></content:encoded>
			<wfw:commentRss>http://www.navision-blog.de/2010/04/13/fake-f-sharp-make-and-naturalspec-released/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>F# Vortrag in Hamburg-Altona</title>
		<link>http://www.navision-blog.de/2010/03/15/f-vortrag-in-hamburg-altona/</link>
		<comments>http://www.navision-blog.de/2010/03/15/f-vortrag-in-hamburg-altona/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 09:25:30 +0000</pubDate>
		<dc:creator>Steffen Forkmann</dc:creator>
				<category><![CDATA[F#]]></category>
		<category><![CDATA[Veranstaltungen]]></category>

		<guid isPermaLink="false">http://www.navision-blog.de/2010/03/15/f-vortrag-in-hamburg-altona/</guid>
		<description><![CDATA[Am Mittwoch, den 17.03.2010 werde ich in Hamburg-Altona einen Vortrag zu “Funktionaler Programmierung mit F#” halten. “Funktionale Programmiersprachen nehmen seit geraumer Zeit einen hohen Stellenwert in der Wissenschaft ein. Demn&#228;chst k&#246;nnte es eine dieser Sprachen sogar aus dem Forschungsbereich direkt in den Mainstream schaffen. Visual Studio 2010 wird neben C# und VB.NET die funktionale Programmiersprache [...]]]></description>
			<content:encoded><![CDATA[<p>Am Mittwoch, den 17.03.2010 werde ich in Hamburg-Altona einen Vortrag zu “Funktionaler Programmierung mit F#” halten.</p>
<blockquote><p>“Funktionale Programmiersprachen nehmen seit geraumer Zeit einen hohen Stellenwert in der Wissenschaft ein. Demn&#228;chst k&#246;nnte es eine dieser Sprachen sogar aus dem Forschungsbereich direkt in den Mainstream schaffen. Visual Studio 2010 wird neben C# und VB.NET die funktionale Programmiersprache F# als dritte Hauptsprache anbieten. Der Vortrag soll einen Einblick in funktionale Konzepte und deren Umsetzung in F# geben. Insbesondere soll auf “Funktionen h&#246;herer Ordnung”, Typinferenz, Currying, Pattern Matching, “Unver&#228;nderlichkeit” und parallele Programmierung eingegangen werden.”</p>
</blockquote>
<p>Mittwoch, 17.03.2010 um 19:00 Uhr   <br />Kinderkrankenhaus Altona     <br />Bleickenallee 38     <br />22763 Hamburg     <br />Treffpunkt: Haupteingang Empfang</p>
<p>&copy;2010 <a href="http://www.navision-blog.de">Rash thoughts about .NET, C#, F# and Dynamics NAV.</a>. All Rights Reserved.</p>.]]></content:encoded>
			<wfw:commentRss>http://www.navision-blog.de/2010/03/15/f-vortrag-in-hamburg-altona/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;FAKE &#8211; F# Make&#8221; 0.29 released &#8211; Ready for F# February 2010 CTP and .NET 4.0 RC</title>
		<link>http://www.navision-blog.de/2010/02/14/fake-f-make-0-29-released-ready-for-f-february-2010-ctp-and-net-4-0-rc/</link>
		<comments>http://www.navision-blog.de/2010/02/14/fake-f-make-0-29-released-ready-for-f-february-2010-ctp-and-net-4-0-rc/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 16:56:07 +0000</pubDate>
		<dc:creator>Steffen Forkmann</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[FAKE - F# Make]]></category>
		<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[F-sharp Make]]></category>

		<guid isPermaLink="false">http://www.navision-blog.de/2010/02/14/fake-f-make-0-29-released-ready-for-f-february-2010-ctp-and-net-4-0-rc/</guid>
		<description><![CDATA[Last week I released version 0.29 of my build automation tool “FAKE – F# Make”. The new version comes along with a couple of changes which I will now describe. F# February 2010 CTP and .NET 4.0 RC “FAKE – F# Make” should be completely compatible with both, the F# February 2010 CTP and the [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I released version 0.29 of my build automation tool “FAKE – F# Make”. The new version comes along with a couple of changes which I will now describe.</p>
<h5>F# February 2010 CTP and .NET 4.0 RC</h5>
<p>“FAKE – F# Make” should be completely compatible with both, the <a href="http://go.microsoft.com/fwlink/?LinkId=151924">F# February 2010 CTP</a> and the F# version which is included in <a href="http://go.microsoft.com/fwlink/?LinkId=151923">Visual Studio 2010 RC</a>.</p>
<h5>FAKE self build and binaries on teamcity.codebetter.com</h5>
<p>Since “FAKE – F# Make” is a build automation tool, it was always used for it’s own build process. Now this build process could be moved to an open CI server at <a href="http://teamcity.codebetter.com/viewType.html?buildTypeId=bt114&amp;tab=buildTypeStatusDiv">teamcity.codebetter.com</a>. If you login as a guest you can download the latest “FAKE – F# Make” binaries from there.</p>
<h5>FAKE on build servers without F#</h5>
<p>With the new F# CTP there is no longer a need for installing F# on the build agents. In fact FAKE itself was built on build agents which don’t have a F# installation. </p>
<p>If you want to create such build scripts you have to do the following:</p>
<ol>
<li>Download the standalone zip file of the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ba52e650-4e77-4b0b-b987-9f9ecd3bab3b&amp;displaylang=en">F# CTP</a> </li>
<li>Put the bin subfolder into your project tree </li>
<li>Modify the FSIPath value in the FAKE.exe.config file to match your FSharp bin folder
<ol>
<li>If you copy the contents the F# bin folder into ./tools/FSharp/ it should just work. </li>
</ol>
</li>
</ol>
<p>If you have F# projects you also need to modify your .fsproj files like this:</p>
<p>&lt;PropertyGroup&gt;    <br />&#160;&#160; ….     <br />&#160; &lt;FscToolPath&gt;..\..\..\tools\FSharp\&lt;/FscToolPath&gt;     <br />&lt;/PropertyGroup&gt;     <br />…     <br />&lt;Import Project=&quot;..\..\..\tools\FSharp\Microsoft.FSharp.Targets&quot; /&gt;</p>
<p>This modifications should take care that MSBuild will use the F# compiler from your tools paths.</p>
<h5>Generate your documentations with “docu”</h5>
<blockquote><p><strong>“What&#8217;s a docu?</strong> A documentation generator for .Net that isn&#8217;t complicated, awkward, or difficult to use. Given an assembly and the XML that&#8217;s generated by Visual Studio, docu can produce an entire website of documentation with a single command.” [<a href="http://docu.jagregory.com/">docu Homepage</a>]</p>
</blockquote>
<p>“FAKE – F# Make” 0.29 is bundled with this new documentation tool which can easily convert your xml-Documentation into some nice html pages. You can use the tool with the new Docu task like this:</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px">Target? GenerateDocumentation &lt;-</p>
<p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">fun</span> _ <span style="color: blue">-&gt;</span></p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; Docu (<span style="color: blue">fun</span> p <span style="color: blue">-&gt;</span></p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {p <span style="color: blue">with</span></p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ToolPath = <span style="color: maroon">@&quot;.\tools\FAKE\docu.exe&quot;</span></p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; TemplatesPath = <span style="color: maroon">@&quot;.\tools\FAKE\templates&quot;</span></p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; OutputPath = docDir })</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (buildDir + <span style="color: maroon">&quot;MyAssembly.dll&quot;</span>)</p>
</p></div>
<p>You will also need the docu templates, which you can download from the product homepage. I’m planning to bundle some basic templates with the next version of FAKE.</p>
<h5>What’s next?</h5>
<p>At the moment I’m working on <a href="http://research.microsoft.com/en-us/people/mbarnett/ilmerge.aspx">ILMerge</a> task for FAKE. I hope to release this with the next version. There are also some open issues with the Mono support but since teamcity.codebetter.com is getting a mono build agent I hope to make some progress here too.</p>
<p>If you have any questions or ideas for new features please contact me.</p>
<p>&copy;2010 <a href="http://www.navision-blog.de">Rash thoughts about .NET, C#, F# and Dynamics NAV.</a>. All Rights Reserved.</p>.]]></content:encoded>
			<wfw:commentRss>http://www.navision-blog.de/2010/02/14/fake-f-make-0-29-released-ready-for-f-february-2010-ctp-and-net-4-0-rc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New syntactic sugar for &#8220;FAKE &#8211; F# Make&#8221; &#8211; Getting rid of magic strings</title>
		<link>http://www.navision-blog.de/2010/02/08/new-syntactic-sugar-for-fake-f-make-getting-rid-of-magic-strings/</link>
		<comments>http://www.navision-blog.de/2010/02/08/new-syntactic-sugar-for-fake-f-make-getting-rid-of-magic-strings/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 17:58:12 +0000</pubDate>
		<dc:creator>Steffen Forkmann</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[FAKE - F# Make]]></category>
		<category><![CDATA[F-sharp Make]]></category>
		<category><![CDATA[Fake]]></category>

		<guid isPermaLink="false">http://www.navision-blog.de/2010/02/08/new-syntactic-sugar-for-fake-f-make-getting-rid-of-magic-strings/</guid>
		<description><![CDATA[The new version 0.27 of “FAKE – F# Make” comes with new syntactic sugar for build targets and build dependencies. Don’t be afraid the old version is still supported &#8211; all scripts should still work with the new version. The problem Consider the following target definition: let buildDir = &#34;./build/&#34; &#160; Target &#34;Clean&#34; (fun _ [...]]]></description>
			<content:encoded><![CDATA[<p>The new version 0.27 of “FAKE – F# Make” comes with new syntactic sugar for build targets and build dependencies. Don’t be afraid the old version is still supported &#8211; all scripts should still work with the new version.</p>
<h5>The problem</h5>
<p>Consider the following target definition:</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: blue">let</span> buildDir = <span style="color: maroon">&quot;./build/&quot;</span></p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">Target <span style="color: maroon">&quot;Clean&quot;</span> (<span style="color: blue">fun</span> _ <span style="color: blue">-&gt;</span></p>
<p style="margin: 0px">&#160; CleanDir buildDir</p>
<p style="margin: 0px">)</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">Target <span style="color: maroon">&quot;Default&quot;</span> (<span style="color: blue">fun</span> _ <span style="color: blue">-&gt;</span></p>
<p style="margin: 0px">&#160; trace <span style="color: maroon">&quot;Hello World from FAKE&quot;</span></p>
<p style="margin: 0px">)</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: maroon">&quot;Default&quot;</span> &lt;== [<span style="color: maroon">&quot;Clean&quot;</span>]</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">run <span style="color: maroon">&quot;Default&quot;</span></p>
</p></div>
<p>As you can see we are having a lot of “magic strings” for the target names and the dependency definitions. This was always a small shortcoming in FAKE, since this doesn’t allow refactoring and may result in runtime errors. </p>
<p>One of my goals for “FAKE – F# Make” is to remove these strings in future versions. Unfortunately this is not that easy, because it causes a lot of internal issues. In particular logging to the build server is much harder if you don’t have a target name.</p>
<h5></h5>
<h5>The first step</h5>
<p>As posted in a <a href="http://bitbucket.org/forki/fake/issue/5/mono-support-is-not-working">bitbucket</a> comment by <a href="http://bitbucket.org/cipher/">cipher</a> we could use the “<a href="http://weblogs.asp.net/podwysocki/archive/2010/02/05/using-and-abusing-the-f-dynamic-lookup-operator.aspx">dynamic lookup operator</a>” to remove some of the magic strings without breaking any internal code.</p>
<p>As a result we can rewrite the above sample as:</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: blue">let</span> buildDir = <span style="color: maroon">&quot;./build/&quot;</span></p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">Target? Clean &lt;-</p>
<p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">fun</span> _ <span style="color: blue">-&gt;</span> CleanDir buildDir</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">Target? Default &lt;-</p>
<p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">fun</span> _ <span style="color: blue">-&gt;</span> trace <span style="color: maroon">&quot;Hello World from FAKE&quot;</span></p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">For? Default &lt;- Dependency? Clean</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">Run? Default</p>
</p></div>
<p>All magic strings suddenly disappeared. I think this syntax looks really nice, but unfortunately the strings are not really gone, since the token <strong>Default</strong> is only checked at runtime.</p>
<h5>The idea for future versions</h5>
<p>Since the new syntax is really just syntactic sugar I’m always interested in a better solution. Currently I’m working on a syntax using monads. The result could look like this:</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: blue">let</span> buildDir = <span style="color: maroon">&quot;./build/&quot;</span></p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">let</span> Clean = target { CleanDir buildDir }</p>
<p style="margin: 0px"><span style="color: blue">let</span> Default = </p>
<p style="margin: 0px">&#160; target { </p>
<p style="margin: 0px">&#160;&#160;&#160; trace <span style="color: maroon">&quot;Hello World from FAKE&quot;</span> </p>
<p style="margin: 0px">&#160;&#160;&#160; trace <span style="color: maroon">&quot;Another line&quot;</span></p>
<p style="margin: 0px">&#160; }</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">Default &lt;== [Clean]</p>
<p style="margin: 0px"><span style="color: green"></span></p>
</p></div>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px">Run Default</p>
</p></div>
<p>This way the magic string are really gone, but my current problem is retrieving the target name from the let-binding name. Please leave a comment if you have an idea to solve this issue.</p>
<p>&copy;2010 <a href="http://www.navision-blog.de">Rash thoughts about .NET, C#, F# and Dynamics NAV.</a>. All Rights Reserved.</p>.]]></content:encoded>
			<wfw:commentRss>http://www.navision-blog.de/2010/02/08/new-syntactic-sugar-for-fake-f-make-getting-rid-of-magic-strings/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Terminverschiebung des F#-Vortrages in Bad Homburg</title>
		<link>http://www.navision-blog.de/2010/01/11/terminverschiebung-des-f-vortrages-in-bad-homburg/</link>
		<comments>http://www.navision-blog.de/2010/01/11/terminverschiebung-des-f-vortrages-in-bad-homburg/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 14:04:47 +0000</pubDate>
		<dc:creator>Steffen Forkmann</dc:creator>
				<category><![CDATA[F#]]></category>
		<category><![CDATA[.NET Usergroup Frankfurt]]></category>
		<category><![CDATA[Funktionale Programmierung]]></category>

		<guid isPermaLink="false">http://www.navision-blog.de/2010/01/11/terminverschiebung-des-f-vortrages-in-bad-homburg/</guid>
		<description><![CDATA[Der Termin f&#252;r meinen F#-Talk bei der .NET Usergroup Frankfurt hat sich auf n&#228;chste Woche Donnerstag (21.01.2010) 18:30 verschoben. Veranstaltungsort ist die Gesch&#228;ftsstelle von Microsoft in Bad Homburg, Siemensstrasse (Anfahrtsbeschreibung). Bitte beachten Sie, dass f&#252;r den Besuch dieses User Group Meetings eine Anmeldung auf der Web Seite der .NET User Group zwingend notwendig ist. Abstract: [...]]]></description>
			<content:encoded><![CDATA[<p>Der Termin f&#252;r meinen F#-Talk bei der <a href="http://www.dotnet-ug-frankfurt.de/">.NET Usergroup Frankfurt</a> hat sich auf n&#228;chste Woche Donnerstag (21.01.2010) 18:30 verschoben.</p>
<p>Veranstaltungsort ist die Gesch&#228;ftsstelle von <strong>Microsoft</strong> in Bad Homburg, Siemensstrasse (<a href="http://www.microsoft.com/germany/unternehmen/informationen/gmbh_profil/niederlassungen/badhomburg.mspx">Anfahrtsbeschreibung</a>).</p>
<p>Bitte beachten Sie, dass f&#252;r den Besuch dieses User Group Meetings eine <strong>Anmeldung</strong> auf der <a href="http://www.dotnet-ug-frankfurt.de/">Web Seite der .NET User Group</a><strong> zwingend notwendig</strong> ist.</p>
<p>Abstract:</p>
<blockquote><p>Funktionale Programmiersprachen nehmen seit geraumer Zeit einen hohen Stellenwert in der Wissenschaft ein. Demn&#228;chst k&#246;nnte es eine dieser Sprachen sogar aus dem Forschungsbereich direkt in den Mainstream schaffen. Visual Studio 2010 wird neben C# und VB.NET die funktionale Programmiersprache F# als dritte Hauptsprache anbieten. Der Vortrag soll einen Einblick in funktionale Konzepte und deren Umsetzung in F# geben. Insbesondere soll auf “Funktionen h&#246;herer Ordnung”, Typinferenz, Currying, Pattern Matching, “Unver&#228;nderlichkeit” und parallele Programmierung eingegangen werden.</p>
</blockquote>
<p>&copy;2010 <a href="http://www.navision-blog.de">Rash thoughts about .NET, C#, F# and Dynamics NAV.</a>. All Rights Reserved.</p>.]]></content:encoded>
			<wfw:commentRss>http://www.navision-blog.de/2010/01/11/terminverschiebung-des-f-vortrages-in-bad-homburg/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
