<?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/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>Tue, 31 Jan 2012 17:13:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Aufzeichnung meines Vortrages zu Higher-Order-Functions in C# verf&#252;gbar</title>
		<link>http://www.navision-blog.de/2010/11/24/aufzeichnung-meines-vortrages-zu-higher-order-functions-in-c-verfuegbar/</link>
		<comments>http://www.navision-blog.de/2010/11/24/aufzeichnung-meines-vortrages-zu-higher-order-functions-in-c-verfuegbar/#comments</comments>
		<pubDate>Wed, 24 Nov 2010 15:12:21 +0000</pubDate>
		<dc:creator>Steffen Forkmann</dc:creator>
				<category><![CDATA[Informatik]]></category>
		<category><![CDATA[Veranstaltungen]]></category>
		<category><![CDATA[WebCasts]]></category>
		<category><![CDATA[.NET Online User Group]]></category>
		<category><![CDATA[F#]]></category>

		<guid isPermaLink="false">http://www.navision-blog.de/2010/11/24/aufzeichnung-meines-vortrages-zu-higher-order-functions-in-c-verfuegbar/</guid>
		<description><![CDATA[Letzte Woche habe ich im Rahmen der F# Gruppe der .NET Online User Group einen Vortrag zu “Higher-Order-Functions in C#” gehalten. Unter http://vimeo.com/17048170 ist die Aufzeichnung nun zu finden. Funktionale Programmiersprachen nehmen seit geraumer Zeit einen hohen Stellenwert in der Wissenschaft ein. Mittlerweile ziehen viele der funktionalen Konzepte bereits in den Mainstream ein. Bei diesem [...]]]></description>
			<content:encoded><![CDATA[<p>Letzte Woche habe ich im Rahmen der <a href="http://online-usergroup.de/gruppen.fsharp.ashx">F# Gruppe</a> der <a href="http://online-usergroup.de/">.NET Online User Group</a> einen Vortrag zu “Higher-Order-Functions in C#” gehalten. Unter <a title="http://vimeo.com/17048170" href="http://vimeo.com/17048170">http://vimeo.com/17048170</a> ist die Aufzeichnung nun zu finden.</p>
<blockquote><p>Funktionale Programmiersprachen nehmen seit geraumer Zeit einen hohen Stellenwert in der Wissenschaft ein. Mittlerweile ziehen viele der funktionalen Konzepte bereits in den Mainstream ein. Bei diesem Treffen wollen wir einen Einblick in funktionale Konzepte und deren Umsetzung in C# gewinnen. Insbesondere soll auf &quot;Funktionen h&#246;herer Ordnung&quot;, &quot;Pattern Matching&quot;, &quot;Unver&#228;nderlichkeit&quot; und parallele Programmierung eingegangen werden.</p>
<p align="right">Vortragsabstract</p>
</blockquote>
<p>&copy;2012 <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/11/24/aufzeichnung-meines-vortrages-zu-higher-order-functions-in-c-verfuegbar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Erstes Treffen der .NET Online User Group war schon ein Erfolg</title>
		<link>http://www.navision-blog.de/2010/11/09/erstes-treffen-der-net-online-user-group-war-schon-ein-erfolg/</link>
		<comments>http://www.navision-blog.de/2010/11/09/erstes-treffen-der-net-online-user-group-war-schon-ein-erfolg/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 08:57:18 +0000</pubDate>
		<dc:creator>Steffen Forkmann</dc:creator>
				<category><![CDATA[Online User group]]></category>
		<category><![CDATA[.NET Online User Group]]></category>
		<category><![CDATA[CQRS]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[Rhino.ServiceBus]]></category>

		<guid isPermaLink="false">http://www.navision-blog.de/2010/11/09/erstes-treffen-der-net-online-user-group-war-schon-ein-erfolg/</guid>
		<description><![CDATA[Gestern hat Bj&#246;rn Rochel mit seinem Vortrag zum Thema Rhino.ServiceBus den aktiven Start der .NET Online User Group vollzogen. Mit 28 Teilnehmern war dies (trotz einiger technischer Probleme bei mir als geplantem Co-Moderator) schon ein voller Erfolg. Wenn die n&#228;chsten Treffen auch so in der Art stattfinden, dann kann die NOUG (Twitter-Hashtag #NOUG) echt etwas [...]]]></description>
			<content:encoded><![CDATA[<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 10px; border-left-width: 0px; margin-right: 0px; margin-bootom: 10px" title="Bj&#246;rn Rochel live" border="0" alt="Bj&#246;rn Rochel live" align="right" src="http://www.navision-blog.de/images/Erst.NETOnlineUserGroupwarschoneinErfolg_8BFB/bjoern_rhino.png" width="244" height="138" /> Gestern hat <a href="http://online-usergroup.de/mitglieder.rochel_bjoern.ashx">Bj&#246;rn Rochel</a> mit seinem Vortrag zum Thema Rhino.ServiceBus den aktiven Start der <a href="http://online-usergroup.de/">.NET Online User Group</a> vollzogen. Mit 28 Teilnehmern war dies (trotz einiger technischer Probleme bei mir als geplantem Co-Moderator) schon ein voller Erfolg. Wenn die n&#228;chsten Treffen auch so in der Art stattfinden, dann kann die NOUG (Twitter-Hashtag #NOUG) echt etwas Gro&#223;es werden. Danke an alle die mitmachen und der NOUG in so kurzer Zeit schon ein Gesicht und Struktur geben.
</p>
<p>Bj&#246;rn hat aus seinem Vortrag auch schon eine geniale weiterf&#252;hrende Idee f&#252;r die NOUG entwickelt. In einer <a href="http://online-usergroup.de/gruppen.gruppen-build-your-own-cqrs.ashx">&quot;Build your own CQRS&quot;-Gruppe</a> will er gemeinsam mit anderen Interessierten eine vollst&#228;ndige Implementierung einer CQRS – Beispielanwendung vorantreiben.</p>
<p>N&#228;chsten Montag hat dann die <a href="http://online-usergroup.de/gruppen.fsharp.ashx">F#-Gruppe</a> ihr Kick-Off-Meeting. Ich w&#252;rde mich &#252;ber viele interessierte Teilnehmer freuen. Bei diesem Treffen wollen wir einen ersten Einblick in funktionale Konzepte gewinnen. Insbesondere soll auf &quot;Funktionen h&#246;herer Ordnung&quot;, &quot;Pattern Matching&quot;, &quot;Unver&#228;nderlichkeit&quot; und parallele Programmierung eingegangen werden. Damit wir uns nicht zu sehr in Diskussionen zur F#-Syntax verfangen wollen wir dies beim ersten Treffen in C# probieren. Damit wir auch ein m&#246;glichst interaktives Treffen hinbekommen w&#228;re ein Mikrofon und im Idealfall auch eine Webcam nicht schlecht. <img src='http://www.navision-blog.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Wichtige Links:</p>
<ul>
<li><a href="http://online-usergroup.de/gruppen.MainPage.ashx">Gruppen und Bereiche der NOUG</a> </li>
<li><a href="http://online-usergroup.de/termine.MainPage.ashx">Die n&#228;chsten Termine</a> </li>
<li><a href="http://online-usergroup.de/faq.ashx">FAQ zur NOUG</a> </li>
</ul>
<p>[Das Bild habe ich schamlos von <a href="http://twitter.com/#!/DerAlbert">DerAlbert</a> geklaut.]</p>
<p>&copy;2012 <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/11/09/erstes-treffen-der-net-online-user-group-war-schon-ein-erfolg/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>.NET Online User Group gegr&#252;ndet</title>
		<link>http://www.navision-blog.de/2010/11/04/online-net-user-group-gegruendet/</link>
		<comments>http://www.navision-blog.de/2010/11/04/online-net-user-group-gegruendet/#comments</comments>
		<pubDate>Thu, 04 Nov 2010 19:24:34 +0000</pubDate>
		<dc:creator>Steffen Forkmann</dc:creator>
				<category><![CDATA[Coding Dojo]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[Online User group]]></category>
		<category><![CDATA[Online User Group]]></category>

		<guid isPermaLink="false">http://www.navision-blog.de/2010/11/04/online-net-user-group-gegruendet/</guid>
		<description><![CDATA[Nach einigen Diskussionen und Anregungen auf Twitter und einer konstitutionellen Skype-Session (zwischen DerAlbert, Bj&#246;rn Rochel und mir) wurde heute die “.NET Online User Group” gegr&#252;ndet. Ziele und Einordnung der Gruppe Unter dem Deckmantel dieser Gruppe wollen wir versuchen m&#246;glichst oft und regelm&#228;&#223;ig Online-Treffen f&#252;r .NET-Entwickler aus dem deutschsprachigen Raum zu organisieren. Die Online User Group [...]]]></description>
			<content:encoded><![CDATA[<p>Nach einigen Diskussionen und Anregungen auf Twitter und einer konstitutionellen Skype-Session (zwischen <a href="http://onlineusergroup.de/mitglieder.weinert_albert.ashx">DerAlbert</a>, <a href="http://onlineusergroup.de/mitglieder.rochel_bjoern.ashx">Bj&#246;rn Rochel</a> und mir) wurde heute die “<a href="http://onlineusergroup.de/">.NET Online User Group</a>” gegr&#252;ndet.</p>
<h5>Ziele und Einordnung der Gruppe</h5>
<p>Unter dem Deckmantel dieser Gruppe wollen wir versuchen m&#246;glichst oft und regelm&#228;&#223;ig Online-Treffen f&#252;r .NET-Entwickler aus dem deutschsprachigen Raum zu organisieren.    <br />Die Online User Group sieht sich damit keinesfalls als Konkurrenz zu den bereits bestehenden lokalen User Groups. Wir stellen uns dabei eher vor durch ein breites Angebot an Formaten und das gro&#223;e Einzugsgebiet auch in speziellere Themen tief reinschauen zu k&#246;nnen, die bei den lokalen Gruppen aufgrund der heterogenen Interessen eher vermieden werden. </p>
<h5>Gruppen</h5>
<h6></h6>
<p>So ist es z.B. geplant Gruppen zu bilden, die sich zu bestimmten “Randgruppen”-Themen ganz intensiv austauschen k&#246;nnen. Den Anfang machen wir mit einer <a href="http://onlineusergroup.de/.gruppen.fsharp.ashx">F# Gruppe</a>, deren Ziel es ist die Sprache F# im Speziellen und Funktionale Programmierung im Allgemeinen detailliert zu beleuchten. Beim <a href="http://onlineusergroup.de/termine.20101115.ashx">ersten Treffen am 15.11.</a> wollen wir uns mit “Funktionen h&#246;herer Ordnung” besch&#228;ftigen. </p>
<p>Jede der Gruppen wird min. einen Paten haben. Die Aufgabe des Paten ist es als Ansprechpartner zu fungieren und Termine zu koordinieren. Das soll aber nicht hei&#223;en, dass der Pate bei jedem Treffen selbst einen Vortrag halten soll.</p>
<h5>Kurzfristige Treffen</h5>
<p>In letzter Zeit ist es des &#214;fteren vorgekommen, dass einige Themen auf Twitter oder in Newsgroups pl&#246;tzlich sehr intensiv diskutiert wurden. Wir wollen mit der User Group nun auch eine Kommunikationsplattform bieten, die in der Lage ist kurzfristig in einem direkteren Rahmen &#252;ber solche Themen zu diskutieren. Wir k&#246;nnen uns dabei gut vorstellen, dass spontan verabredet wird (z.B. &#252;ber Twitter) sich am Abend zu einem bestimmten Thema &#252;ber die Kan&#228;le der User Group (insbesondere LiveMeeting) zu unterhalten.</p>
<h5>Coding Dojo</h5>
<p>Auch das bereits etablierte <a href="http://onlineusergroup.de/termine.20101118.ashx">Online Coding Dojo</a> mit <a href="http://onlineusergroup.de/mitglieder.weinert_albert.ashx">Albert Weinert</a> und <a href="http://onlineusergroup.de/mitglieder.cetinkaya_ilker.ashx">Ilker Cetinkaya</a> wird ab jetzt unter der Flagge der .NET Online User Group durchgef&#252;hrt werden. Der erste Termin hierf&#252;r ist der 18. November.</p>
<h5>Klassische Vortr&#228;ge</h5>
<p>Aber auch Vortr&#228;ge wird es bei der .NET Online User Group geben. Zum jetzigen Zeitpunkt stehen bereits 4 Termine fest:</p>
<ul>
<li><a href="http://onlineusergroup.de/termine.20101108.ashx"><b>Rhino Service Bus</b>, 8. November 2010, 19 Uhr</a> </li>
<li><a href="http://onlineusergroup.de/termine.20101122.ashx"><b>ASP.NET MVC 3, Neuerungen</b>, 22. November 2010, 19 Uhr</a> </li>
<li><a href="http://onlineusergroup.de/termine.20101213.ashx"><b>NuGet, und nu?</b>, 13. Dezember 2010, 19 Uhr</a> </li>
<li><a href="http://onlineusergroup.de/termine.20101220.ashx"><b>Reaktive Programmierung mit EBC, Rx und Co.</b>, 20. Dezember 2010, 19 Uhr</a> </li>
</ul>
<h5>Weitere Schritte</h5>
<p>Um die .NET Online User Group ordentlich anlaufen lassen zu k&#246;nnen ben&#246;tigen wir nat&#252;rlich jede Menge Hilfe:</p>
<ul>
<li>Bitte helft uns die User Group bekannt zu machen. Twitter, Email, Blogs, Briefe, Faxe, TV-Spots, pers&#246;nliche Kommunikation usw. </li>
<li>Bitte registriert euch auf der <a href="http://onlineusergroup.de/">Webseite der User Grouo</a> </li>
<li>Bitte schlagt Vortr&#228;ge vor </li>
<li>Bitte nennt uns Themenw&#252;nsche und Ideen </li>
<li>Bitte meldet euch freiwillig als Paten f&#252;r bestimmte Untergruppen bzw. Themenbereiche </li>
<li>Bitte schlagt uns vor wie ihr sonst noch helfen k&#246;nnt <img src='http://www.navision-blog.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  </li>
</ul>
<p>&copy;2012 <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/11/04/online-net-user-group-gegruendet/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;2012 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;2012 <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>Generating an IObservable&lt;T&gt; from an IEvent in F#</title>
		<link>http://www.navision-blog.de/2009/11/24/generating-an-iobservablet-from-an-ievent-in-f/</link>
		<comments>http://www.navision-blog.de/2009/11/24/generating-an-iobservablet-from-an-ievent-in-f/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 11:39:29 +0000</pubDate>
		<dc:creator>Steffen Forkmann</dc:creator>
				<category><![CDATA[F#]]></category>
		<category><![CDATA[Reactive Framework]]></category>

		<guid isPermaLink="false">http://www.navision-blog.de/2009/11/24/generating-an-iobservablet-from-an-ievent-in-f/</guid>
		<description><![CDATA[Yesterday I showed how we can map some of the Rx operators to an API which looks more like the F# base classes. Today I wanted to use these mapped operators in a WPF-application written in F#. F# gives us a nice way to use events as first class citizen (via IEvent) but these events [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I showed how we can <a href="http://www.navision-blog.de/2009/11/23/mapping-the-reactive-framework-rx-operators-for-f/">map some of the Rx operators to an API which looks more like the F# base classes</a>. Today I wanted to use these mapped operators in a WPF-application written in F#. </p>
<p>F# gives us a nice way to use events as first class citizen (via IEvent) but these events implement their own version of IObservable&lt;T&gt; (in FSharp.Core.dll), which is unfortunately incompatible with the Rx version and therefore with the mapped API.</p>
<p>The solution I found is to wrap the F# IEvent with a Rx IObservable&lt;T&gt;:</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: green">/// Generates an observable from an IEvent</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> fromEvent (event:IEvent&lt;_,_&gt;) =&#160;&#160;&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px">&#160; Observable.Create&lt;_&gt;(<span style="color: blue">fun</span> x <span style="color: blue">-&gt;</span></p>
<p style="margin: 0px">&#160;&#160;&#160; event.Subscribe x.OnNext |&gt; ignore</p>
<p style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">new</span> System.Action(<span style="color: blue">fun</span> () <span style="color: blue">-&gt;</span> ()))&#160;&#160;&#160;&#160;&#160; </p>
</p></div>
<p>Now we are able to use the WPF events as observables:</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: green">// Register ListBox Commands</span></p>
<p style="margin: 0px">listBox1.KeyDown</p>
<p style="margin: 0px">&#160; |&gt; Observable.fromEvent</p>
<p style="margin: 0px">&#160; |&gt; Observable.filter (<span style="color: blue">fun</span> args <span style="color: blue">-&gt;</span> args.Key = Key.Delete)</p>
<p style="margin: 0px">&#160; |&gt; Observable.subscribe deleteElement</p>
</p></div>
<p>I am interested if someone has a different and maybe better solution to this problem.</p>
<p>Updated: 21.12.2009 – Observable.Context is no longer supported by Rx ==&gt; Removed</p>
<p>&copy;2012 <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/2009/11/24/generating-an-iobservablet-from-an-ievent-in-f/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mapping the Reactive Framework (Rx) operators for F#</title>
		<link>http://www.navision-blog.de/2009/11/23/mapping-the-reactive-framework-rx-operators-for-f/</link>
		<comments>http://www.navision-blog.de/2009/11/23/mapping-the-reactive-framework-rx-operators-for-f/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 12:35:39 +0000</pubDate>
		<dc:creator>Steffen Forkmann</dc:creator>
				<category><![CDATA[F#]]></category>
		<category><![CDATA[IObservable]]></category>
		<category><![CDATA[PLINQ]]></category>
		<category><![CDATA[Reactive Framework]]></category>

		<guid isPermaLink="false">http://www.navision-blog.de/2009/11/23/mapping-the-reactive-framework-rx-operators-for-f/</guid>
		<description><![CDATA[The “Reactive Extensions for .NET (Rx)” comes with lot’s of operators for using IObservable&#60;T&#62;. This code mimics the signature of the default F# sequence combinators and allows to use observables like sequences. It is a similar approach like Matthews Podwysocki’s blog post about mapping the IParallelEnumerable. I will update this post from time to time [...]]]></description>
			<content:encoded><![CDATA[<p>The “<a href="http://msdn.microsoft.com/en-us/devlabs/ee794896.aspx">Reactive Extensions for .NET (Rx)</a>” comes with lot’s of operators for using IObservable&lt;T&gt;. This code mimics the signature of the default F# sequence combinators and allows to use observables like sequences. It is a similar approach like Matthews Podwysocki’s blog post about <a href="http://weblogs.asp.net/podwysocki/archive/2009/02/23/adding-parallel-extensions-to-f.aspx">mapping the IParallelEnumerable</a>.</p>
<p>I will update this post from time to time to include more of the operators.</p>
<ul>
<li>Update: 25.11.2009 – new operators mapped </li>
<li>Update: 21.11.2009 – Updated to new Rx release </li>
</ul>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: blue">module</span> RxExtensions.Observable</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">open</span> System.Linq</p>
<p style="margin: 0px"><span style="color: blue">open</span> System</p>
<p style="margin: 0px"><span style="color: blue">open</span> System.Threading</p>
<p style="margin: 0px"><span style="color: blue">open</span> System.Windows.Threading</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">type</span> &#8216;a observable = IObservable&lt;&#8217;a&gt;</p>
<p style="margin: 0px"><span style="color: blue">type</span> &#8216;a observer = IObserver&lt;&#8217;a&gt;</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// converts a lambda in a System.Action</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> asAction f = <span style="color: blue">new</span> System.Action(f)</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// System.Action whichs does nothing</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> doNothing = asAction (<span style="color: blue">fun</span> () <span style="color: blue">-&gt;</span> ())</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Creates an observer</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> createObserver next error completed =</p>
<p style="margin: 0px">&#160; {<span style="color: blue">new</span> System.IObserver&lt;_&gt; <span style="color: blue">with</span></p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; <span style="color: blue">member</span> this.OnCompleted() = completed()</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; <span style="color: blue">member</span> this.OnError(e) = error e</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; <span style="color: blue">member</span> this.OnNext(args) = next args}</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Creates a new observable </span></p>
<p style="margin: 0px"><span style="color: blue">let</span> create f =</p>
<p style="margin: 0px">&#160; Observable.Create&lt;_&gt;(<span style="color: blue">fun</span> x <span style="color: blue">-&gt;</span></p>
<p style="margin: 0px">&#160;&#160;&#160; f x</p>
<p style="margin: 0px">&#160;&#160;&#160; doNothing)&#160;&#160; </p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Creates a observable from a async</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> ofAsync async =</p>
<p style="margin: 0px">&#160; create</p>
<p style="margin: 0px">&#160;&#160;&#160; (<span style="color: blue">fun</span> obs <span style="color: blue">-&gt;</span></p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160; Async.StartWithContinuations</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (async,obs.OnNext,obs.OnError,obs.OnError))</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Gets a dispatcher Schdeuler for the current dispatcher</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> getDispatcherScheduler _ = </p>
<p style="margin: 0px">&#160; <span style="color: blue">new</span> DispatcherScheduler(Dispatcher.CurrentDispatcher)</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Generates an observable from an IEvent</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> fromEvent (event:IEvent&lt;_,_&gt;) = create (<span style="color: blue">fun</span> x <span style="color: blue">-&gt;</span> event.Add x.OnNext)</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Generates an empty observable </span></p>
<p style="margin: 0px"><span style="color: blue">let</span> empty&lt;&#8217;a&gt; = Observable.Empty&lt;&#8217;a&gt;() </p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Takes the head of the elements</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> head = Observable.First </p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Merges the two observables</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> mergeWith obs1 obs2 = Observable.Merge(obs2, obs1)</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Merges all observables</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> mergeAll (observables:IObservable&lt;IObservable&lt;&#8217;a&gt;&gt;) = </p>
<p style="margin: 0px">&#160; Observable.Merge observables </p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Merges all observables</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> merge (observables:(IObservable&lt;&#8217;a&gt;) seq) = </p>
<p style="margin: 0px">&#160; Observable.Merge observables </p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Creates a range as an observable</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> range start count = Observable.Range(start, count)</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Converts a seq in an observable</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> toObservable (seq: &#8216;a seq) = Observable.ToObservable seq</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Converts a observable in a seq</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> toEnumerable = Observable.ToEnumerable</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Subscribes to the Observable with all 3 callbacks</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> subscribeComplete next error completed (observable: &#8216;a observable) = </p>
<p style="margin: 0px">&#160;&#160; observable.Subscribe(</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160; (<span style="color: blue">fun</span> x <span style="color: blue">-&gt;</span> next x), </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160; (<span style="color: blue">fun</span> e <span style="color: blue">-&gt;</span> error e), </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160; (<span style="color: blue">fun</span> () <span style="color: blue">-&gt;</span> completed()))</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Subscribes to the Observable with a</span></p>
<p style="margin: 0px"><span style="color: green">/// next and an error-function</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> subscribeWithError next error observable = </p>
<p style="margin: 0px">&#160; subscribeComplete next error (<span style="color: blue">fun</span> () <span style="color: blue">-&gt;</span> ()) observable</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Subscribes to the Observable with just a next-function</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> subscribe next observable = </p>
<p style="margin: 0px">&#160; subscribeWithError next ignore observable</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// throttles the observable for the given interval</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> throttle interval observable = </p>
<p style="margin: 0px">&#160; Observable.Throttle(observable,interval)&#160;&#160;&#160; </p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// throttles the observable scheduled on the current dispatcher</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> throttleOnCurrentDispatcher interval observable = </p>
<p style="margin: 0px">&#160; Observable.Throttle(</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160; observable,getDispatcherScheduler(),interval) </p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// samples the observable at the given interval</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> sample interval observable = </p>
<p style="margin: 0px">&#160; Observable.Sample(observable,interval)&#160;&#160;&#160; </p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// samples the observable at the given interval </span></p>
<p style="margin: 0px"><span style="color: green">/// scheduled on the current dispatcher</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> sampleOnCurrentDispatcher interval observable = </p>
<p style="margin: 0px">&#160; Observable.Sample(</p>
<p style="margin: 0px">&#160;&#160;&#160; observable,getDispatcherScheduler(),interval) </p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// returns the observable sequence that reacts first.</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> takeFirstOf2Reactions obs1 obs2 = </p>
<p style="margin: 0px">&#160; Observable.Amb(obs1,obs2)</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// returns the observable sequence that reacts first.</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> amb (obs: IObservable&lt;&#8217;a&gt; seq) = </p>
<p style="margin: 0px">&#160; Observable.Amb obs&#160;&#160; </p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// returns the observable sequence that reacts first.</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> takeFirstReaction (obs: IObservable&lt;&#8217;a&gt; seq) = </p>
<p style="margin: 0px">&#160; Observable.Amb obs&#160;&#160; </p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Matches when both observable sequences </span></p>
<p style="margin: 0px"><span style="color: green">/// have an available value. </span></p>
<p style="margin: 0px"><span style="color: blue">let</span> both obs1 obs2 = Observable.And(obs1,obs2)</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Merges two observable sequences</span></p>
<p style="margin: 0px"><span style="color: green">/// into one observable sequence.</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> zip obs1 obs2 =&#160;&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160; Observable.Zip(obs1, obs2, Func&lt;_,_,_&gt;(<span style="color: blue">fun</span> a b <span style="color: blue">-&gt;</span> a, b))</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Merges two observable sequences into one observable sequence </span></p>
<p style="margin: 0px"><span style="color: green">/// whenever one of the observable sequences has a new value.</span></p>
<p style="margin: 0px"><span style="color: green">///&#160;&#160;&#160; ==&gt; More results than zip</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> combineLatest obs1 obs2 =&#160;&#160;&#160; </p>
<p style="margin: 0px">&#160;&#160; Observable.CombineLatest(</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160; obs1, obs2, Func&lt;_,_,_&gt;(<span style="color: blue">fun</span> a b <span style="color: blue">-&gt;</span> a, b))&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Concats the two observables to one observable</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> concat observable = </p>
<p style="margin: 0px">&#160; Observable.SelectMany(</p>
<p style="margin: 0px">&#160;&#160;&#160; observable,</p>
<p style="margin: 0px">&#160;&#160;&#160; Func&lt;_,_&gt;(<span style="color: blue">fun</span> (x:IObservable&lt;&#8217;a&gt;) <span style="color: blue">-&gt;</span> x)) </p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// maps the given observable with the given function</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> map f observable = </p>
<p style="margin: 0px">&#160; Observable.Select(observable,Func&lt;_,_&gt;(f))&#160;&#160; </p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// maps the given observable with the given function</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> mapi f observable = </p>
<p style="margin: 0px">&#160; Observable.Select(observable,Func&lt;_,_,_&gt;(<span style="color: blue">fun</span> x i <span style="color: blue">-&gt;</span>f i x))&#160;&#160; </p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Filters all elements where the given predicate is satified</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> filter f observable = </p>
<p style="margin: 0px">&#160; Observable.Where(observable, Func&lt;_,_&gt;(f)) </p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Splits the observable into two observables</span></p>
<p style="margin: 0px"><span style="color: green">/// Containing the elements for which the predicate returns</span></p>
<p style="margin: 0px"><span style="color: green">/// true and false respectively</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> partition predicate observable =</p>
<p style="margin: 0px">&#160; filter predicate observable,</p>
<p style="margin: 0px">&#160; filter (predicate &gt;&gt; not) observable</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Skips n elements</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> skip n observable = Observable.Skip(observable, n)</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Skips elements while the predicate is satisfied</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> skipWhile f observable = </p>
<p style="margin: 0px">&#160; Observable.SkipWhile(observable, Func&lt;_,_&gt;(f)) </p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Runs all observable sequences in parallel </span></p>
<p style="margin: 0px"><span style="color: green">/// and combines their first values. </span></p>
<p style="margin: 0px"><span style="color: blue">let</span> forkJoin (observables: (&#8216;a observable) seq) =</p>
<p style="margin: 0px">&#160; Observable.ForkJoin observables</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Counts the elements</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> length = Observable.Count</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Takes n elements</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> take n observable =</p>
<p style="margin: 0px">&#160; Observable.Take(observable, n)&#160;&#160; </p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Determines whether the given observable is empty&#160; </span></p>
<p style="margin: 0px"><span style="color: blue">let</span> isEmpty observable = Observable.IsEmpty observable</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Determines whether the given observable is not empty&#160; </span></p>
<p style="margin: 0px"><span style="color: blue">let</span> isNotEmpty observable = not (Observable.IsEmpty observable)</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Determines whether an observable sequence </span></p>
<p style="margin: 0px"><span style="color: green">/// contains a specified value</span></p>
<p style="margin: 0px"><span style="color: green">/// which satisfies the given predicate</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> exists predicate observable =</p>
<p style="margin: 0px">&#160; observable</p>
<p style="margin: 0px">&#160;&#160;&#160; |&gt; skipWhile (predicate &gt;&gt; not)</p>
<p style="margin: 0px">&#160;&#160;&#160; |&gt; isNotEmpty</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Continues an observable sequence that is terminated </span></p>
<p style="margin: 0px"><span style="color: green">/// by an exception with the next observable sequence. </span></p>
<p style="margin: 0px"><span style="color: blue">let</span> catch (newObservable:IObservable&lt;&#8217;a&gt;) failingObservable = </p>
<p style="margin: 0px">&#160; Observable.Catch(failingObservable,newObservable)&#160; </p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Takes elements while the predicate is satisfied</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> takeWhile f observable = </p>
<p style="margin: 0px">&#160; Observable.TakeWhile(observable, Func&lt;_,_&gt;(f)) </p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Iterates through the observable </span></p>
<p style="margin: 0px"><span style="color: green">/// and performs the given side-effect</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> perform f observable =</p>
<p style="margin: 0px">&#160; Observable.Do(observable,<span style="color: blue">fun</span> x <span style="color: blue">-&gt;</span> f x)</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Invokes finallyAction after source observable </span></p>
<p style="margin: 0px"><span style="color: green">/// sequence terminates normally or by an exception. </span></p>
<p style="margin: 0px"><span style="color: blue">let</span> performFinally f observable =</p>
<p style="margin: 0px">&#160; Observable.Finally(observable,<span style="color: blue">fun</span> _ <span style="color: blue">-&gt;</span> f())</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Folds the observable</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> fold f seed observable = </p>
<p style="margin: 0px">&#160; Observable.Aggregate(observable, seed, Func&lt;_,_,_&gt;(f))&#160;&#160; </p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Retruns an observable from a async pattern&#160; </span></p>
<p style="margin: 0px"><span style="color: blue">let</span> fromAsync beginF endF =</p>
<p style="margin: 0px">&#160;&#160; Observable.FromAsyncPattern&lt;_&gt;(</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160; Func&lt;_,_,_&gt;(<span style="color: blue">fun</span> x y <span style="color: blue">-&gt;</span> beginF(x,y)),</p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160; (<span style="color: blue">fun</span> x <span style="color: blue">-&gt;</span> endF x)).Invoke()</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: green">/// Runs all observable sequences in parallel </span></p>
<p style="margin: 0px"><span style="color: green">/// and combines their first values. </span></p>
<p style="margin: 0px"><span style="color: blue">let</span> subscribeAll next observables =</p>
<p style="margin: 0px">&#160; observables |&gt; Seq.map (subscribe next) |&gt; Seq.toList&#160;&#160;&#160;&#160;&#160; </p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">type</span> IObservable&lt;&#8217;a&gt; <span style="color: blue">with</span></p>
<p style="margin: 0px">&#160; <span style="color: green">/// Subscribes to the Observable with just a next-function</span></p>
<p style="margin: 0px">&#160; <span style="color: blue">member</span> this.Subscribe(next) = </p>
<p style="margin: 0px">&#160;&#160;&#160; subscribe next this</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">&#160; <span style="color: green">/// Subscribes to the Observable with a next </span></p>
<p style="margin: 0px">&#160; <span style="color: green">/// and an error-function</span></p>
<p style="margin: 0px">&#160; <span style="color: blue">member</span> this.Subscribe(next,error) = </p>
<p style="margin: 0px">&#160;&#160;&#160; subscribeWithError next error this</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">&#160; <span style="color: green">/// Subscribes to the Observable with all 3 callbacks</span></p>
<p style="margin: 0px">&#160; <span style="color: blue">member</span> this.Subscribe(next,error,completed) = </p>
<p style="margin: 0px">&#160;&#160;&#160; subscribeComplete next error completed this</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">open</span> System.Net</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">type</span> WebRequest <span style="color: blue">with</span></p>
<p style="margin: 0px">&#160; <span style="color: blue">member</span> this.GetRequestStreamAsync() =</p>
<p style="margin: 0px">&#160;&#160;&#160; fromAsync </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160; this.BeginGetRequestStream </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160; this.EndGetRequestStream</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">&#160; <span style="color: blue">member</span> this.GetResponseAsync() =</p>
<p style="margin: 0px">&#160;&#160;&#160; fromAsync </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; this.BeginGetResponse </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; this.EndGetResponse </p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">&#160; <span style="color: blue">member</span> this.GetResponseStreamAsync() =</p>
<p style="margin: 0px">&#160;&#160;&#160; fromAsync </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; this.BeginGetRequestStream </p>
<p style="margin: 0px">&#160;&#160;&#160;&#160;&#160; this.EndGetRequestStream</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px"><span style="color: blue">type</span> Async&lt;&#8217;a&gt; <span style="color: blue">with</span></p>
<p style="margin: 0px">&#160; <span style="color: blue">member</span> this.ToObservable() = ofAsync this</p>
</p></div>
<p>&copy;2012 <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/2009/11/23/mapping-the-reactive-framework-rx-operators-for-f/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>&#8220;FAKE &#8211; F# Make&#8221; Version 0.10 released</title>
		<link>http://www.navision-blog.de/2009/10/06/fake-fsharp_make_version_0_10_released/</link>
		<comments>http://www.navision-blog.de/2009/10/06/fake-fsharp_make_version_0_10_released/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 09:59:10 +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>

		<guid isPermaLink="false">http://www.navision-blog.de/2009/10/06/fake-fsharp_make_version_0_10_released/</guid>
		<description><![CDATA[I just released a new version of my Open Source Build Automation Framework “FAKE – F# Make”. You can read more about FAKE on the project website or in the Getting started with &#34;FAKE &#8211; F# Make&#34;-article. Although the new release contains many bugfixes, I only want to show the two major improvements here. 1. [...]]]></description>
			<content:encoded><![CDATA[<p>I just released a new version of my Open Source Build Automation Framework <a href="http://code.google.com/p/fake/">“FAKE – F# Make”</a>. You can read more about FAKE on the <a href="http://code.google.com/p/fake/">project website</a> or in the <a href="http://www.navision-blog.de/2009/04/01/getting-started-with-fake-a-f-sharp-make-tool/">Getting started with &quot;FAKE &#8211; F# Make&quot;</a>-article.</p>
<p>Although the new release contains many bugfixes, I only want to show the two major improvements here.</p>
<h4>1. FAKE 0.10 uses FSI instead of FSC</h4>
<p>From now on FAKE uses the “F# Interactive” (fsi.exe) instead of the F# Compiler (fsc.exe) to run the build scripts, which brings two major improvements.</p>
<h5>No TempPath for compiled binaries needed</h5>
<p>Due to the fact that FAKE scripts are no longer compiled at the beginning of the build process, we don’t need a temporary folder for the created binaries. </p>
<h5>Loading modules at runtime</h5>
<p>The <font color="#0080ff">#load</font> command in F# scripts allows us to load modules at runtime. Now we are able to put reusable Targets or TargetTemplates (see below) into external build script files.</p>
<h4>2. TargetTemplates</h4>
<p>TargetTemplates provide an easy way to reuse common Targets. Let’s consider a (very) small sample:</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px">Target <span style="color: maroon">&quot;TraceHello&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></div>
<p>This Target “TraceHello” traces a “Hello World” string into our build log. Now we want it to be slightly more generic and to trace a custom string. We can do this by using a TargetTemplate: </p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: green">/// createTraceTarget: string -&gt; string -&gt; Target</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> createTraceTarget = TargetTemplate (<span style="color: blue">fun</span> s <span style="color: blue">-&gt;</span></p>
<p style="margin: 0px">&#160; trace s</p>
<p style="margin: 0px">)</p>
</p></div>
<p>Now we have a template (or a function which generates targets) that gets a string for the target name and a string for the trace text and generates&#160; a usable target:</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px">createTraceTarget <span style="color: maroon">&quot;TraceHello&quot;</span> <span style="color: maroon">&quot;Hello World from FAKE&quot;</span></p>
<p style="margin: 0px">createTraceTarget <span style="color: maroon">&quot;Trace2&quot;</span> <span style="color: maroon">&quot;Trace another text&quot;</span></p>
</p></div>
<p>Of course the TargetTemplate function is generic and can be used with any tuple as parameter:</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: green">/// createTraceTarget: string -&gt; string*int -&gt; Target</span></p>
<p style="margin: 0px"><span style="color: blue">let</span> createTraceTarget = TargetTemplate (<span style="color: blue">fun</span> (s,d) <span style="color: blue">-&gt;</span></p>
<p style="margin: 0px">&#160; trace s</p>
<p style="margin: 0px">&#160; trace &lt;| sprintf <span style="color: maroon">&quot;my int: %d&quot;</span> d</p>
<p style="margin: 0px">)</p>
<p style="margin: 0px">&#160;</p>
<p style="margin: 0px">createTraceTarget <span style="color: maroon">&quot;TraceHello&quot;</span> (<span style="color: maroon">&quot;Hello World from FAKE&quot;</span>,2)</p>
<p style="margin: 0px">createTraceTarget <span style="color: maroon">&quot;Trace2&quot;</span> (<span style="color: maroon">&quot;Trace another text&quot;</span>,42)</p>
</p></div>
<p>&copy;2012 <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/2009/10/06/fake-fsharp_make_version_0_10_released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using PLINQ in F# – Parallel Map and Reduce (Fold) functions &#8211; part 1</title>
		<link>http://www.navision-blog.de/2008/10/23/using-plinq-in-fsharp-parallel-map-and-reduce-fold-functions/</link>
		<comments>http://www.navision-blog.de/2008/10/23/using-plinq-in-fsharp-parallel-map-and-reduce-fold-functions/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 16:25:37 +0000</pubDate>
		<dc:creator>Steffen Forkmann</dc:creator>
				<category><![CDATA[.NET 3.0]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Map and fold]]></category>
		<category><![CDATA[MapReduce]]></category>
		<category><![CDATA[Parallel Computing]]></category>
		<category><![CDATA[Parallel Extensions]]></category>
		<category><![CDATA[PLINQ]]></category>

		<guid isPermaLink="false">http://www.navision-blog.de/2008/10/23/using-plinq-in-f-parallel-map-and-fold-functions/</guid>
		<description><![CDATA[If your wondering how Google computes query results in such a short time you have to read the famous “MapReduce”-Paper by Jeffrey Dean and Sanjay Ghemawat (2004). It shows how one can split large tasks into a mapping and a reduce step which could then be processed in parallel. With PLINQ (part of the Parallel [...]]]></description>
			<content:encoded><![CDATA[<p>If your wondering how Google computes query results in such a short time you have to read the famous <a title="MapReduce: Simplified Data Processing on Large Clusters" href="http://labs.google.com/papers/mapreduce.html">“MapReduce”-Paper by Jeffrey Dean and Sanjay Ghemawat</a> (2004). It shows how one can split large tasks into a mapping and a reduce step which could then be processed in parallel.</p>
<p>With PLINQ (part of the <a href="http://msdn.microsoft.com/en-us/concurrency/default.aspx">Parallel Extensions to the .NET Framework</a>) you can easily use “MapReduce”-pattern in .NET and especially F#. PLINQ will take care of all the MultiThreading and load balancing stuff. You only have to give PLINQ a map and a reduce (or fold) function.</p>
<p>Lets consider a small example. Someone wants to compute the sum of the factorials of all integers from 1 to 3000. With <em>List.map</em> and <em>List.fold_left</em> this is a very easy task in F#:</p>
<div style="font-size: 10pt; background: white; color: black; font-family: courier new">
<pre style="margin: 0px"><span style="color: blue">#light</span></pre>
<pre style="margin: 0px"><span style="color: blue">open</span> System</pre>
<pre style="margin: 0px"></pre>
<pre style="margin: 0px"><span style="color: blue">let</span> add a b = a + b</pre>
<pre style="margin: 0px"><span style="color: blue">let</span> fac (x:bigint) = [1I..x] |&gt; List.fold_left (*) 1I</pre>
<pre style="margin: 0px"></pre>
<pre style="margin: 0px"><strong><span style="color: blue">let</span> sum =</strong></pre>
<pre style="margin: 0px"><strong>  [1I..3000I]</strong></pre>
<pre style="margin: 0px"><strong>    |&gt; List.map fac</strong></pre>
<pre style="margin: 0px"><strong>    |&gt; List.fold_left add 0I</strong></pre>
<pre style="margin: 0px"></pre>
<pre style="margin: 0px">printfn <span style="color: maroon">"Sum of Factorials: %A"</span> sum</pre>
<pre style="margin: 0px"></pre>
</div>
<p>Of course you could do much much better if you don’t compute every factorial on its own (I will show this in one of the next parts) &#8211; but for this time I need an easy function that is time consuming.</p>
<p>This simple Task needs 27 sec. on my Core 2 Duo E6550 with 2.33 GHz and 3.5 GB RAM.</p>
<p>But we can do better if we use parallel map and fold functions with help of PLINQ:</p>
<div style="font-size: 10pt; background: white; color: black; font-family: courier new">
<pre style="margin: 0px"><span style="color: blue">let</span> pMap (mapF:'a <span style="color: blue">-&gt;</span> 'b) (data:IParallelEnumerable&lt;'a&gt;) =</pre>
<pre style="margin: 0px">  ParallelEnumerable.Select(data, mapF)</pre>
<pre style="margin: 0px"></pre>
<pre style="margin: 0px"><span style="color: blue">let</span> pFold foldF seed (data:IParallelEnumerable&lt;'a&gt;)=</pre>
<pre style="margin: 0px">  ParallelEnumerable.Aggregate&lt;'a,'b&gt;(</pre>
<pre style="margin: 0px">    data, seed, <span style="color: blue">new</span> Func&lt;'b,'a,'b&gt;(foldF))</pre>
</div>
<p>Now we can easily transform our calculation to a parallel version:</p>
<div style="font-size: 10pt; background: white; color: black; font-family: courier new">
<pre style="margin: 0px"><strong><span style="color: blue">let</span> sum =</strong></pre>
<pre style="margin: 0px"><strong>  [1I..3000I].AsParallel&lt;bigint&gt;()</strong></pre>
<pre style="margin: 0px"><strong>    |&gt; pMap fac </strong></pre>
<pre style="margin: 0px"><strong>    |&gt; pFold add 0I</strong></pre>
</div>
<p>Putting all together we can write a small test application:</p>
<div style="font-size: 10pt; background: white; color: black; font-family: courier new">
<pre style="margin: 0px"><span style="color: blue">#light </span></pre>
<pre style="margin: 0px"><span style="color: blue">open</span> System</pre>
<pre style="margin: 0px"><span style="color: blue">open</span> System.Linq</pre>
<pre style="margin: 0px"><span style="color: blue">open</span> System.Diagnostics</pre>
<pre style="margin: 0px"></pre>
<pre style="margin: 0px"><span style="color: blue">let</span> testRuntime f =</pre>
<pre style="margin: 0px">  <span style="color: blue">let</span> watch = <span style="color: blue">new</span> Stopwatch()</pre>
<pre style="margin: 0px">  watch.Start()</pre>
<pre style="margin: 0px">  (f(),watch.Elapsed)</pre>
<pre style="margin: 0px"></pre>
<pre style="margin: 0px"><span style="color: blue">let</span> add a b = a + b</pre>
<pre style="margin: 0px"><span style="color: blue">let</span> fac (x:bigint) = [1I..x] |&gt; List.fold_left (*) 1I</pre>
<pre style="margin: 0px"></pre>
<pre style="margin: 0px"><span style="color: blue">let</span> list = [1I..3000I]</pre>
<pre style="margin: 0px"></pre>
<pre style="margin: 0px"><span style="color: blue">let</span> pMap (mapF:'a <span style="color: blue">-&gt;</span> 'b) (data:IParallelEnumerable&lt;'a&gt;)=</pre>
<pre style="margin: 0px">  ParallelEnumerable.Select(data, mapF)</pre>
<pre style="margin: 0px"></pre>
<pre style="margin: 0px"><span style="color: blue">let</span> pFold foldF seed (data:IParallelEnumerable&lt;'a&gt;)=</pre>
<pre style="margin: 0px">  ParallelEnumerable.Aggregate&lt;'a,'b&gt;(</pre>
<pre style="margin: 0px">    data, seed, <span style="color: blue">new</span> Func&lt;'b,'a,'b&gt;(foldF))</pre>
<pre style="margin: 0px"></pre>
<pre style="margin: 0px"><span style="color: blue">let</span> PLINQ() =</pre>
<pre style="margin: 0px">  list.AsParallel&lt;bigint&gt;()</pre>
<pre style="margin: 0px">    |&gt; pMap fac</pre>
<pre style="margin: 0px">    |&gt; pFold add 0I</pre>
<pre style="margin: 0px"></pre>
<pre style="margin: 0px"><span style="color: blue">let</span> sequential() =</pre>
<pre style="margin: 0px">  list</pre>
<pre style="margin: 0px">   |&gt; List.map fac</pre>
<pre style="margin: 0px">   |&gt; List.fold_left add 0I</pre>
<pre style="margin: 0px"></pre>
<pre style="margin: 0px"><span style="color: blue">let</span> (sumSequential,timeSequential) =</pre>
<pre style="margin: 0px">  testRuntime sequential</pre>
<pre style="margin: 0px">printfn <span style="color: maroon">"Time Normal: %.3fs" </span>timeSequential.TotalSeconds</pre>
<pre style="margin: 0px"></pre>
<pre style="margin: 0px"><span style="color: blue">let</span> (sumPLINQ,timePLINQ) =</pre>
<pre style="margin: 0px">  testRuntime PLINQ</pre>
<pre style="margin: 0px">printfn <span style="color: maroon">"Time PLINQ: %.3fs"</span> timePLINQ.TotalSeconds</pre>
<pre style="margin: 0px"></pre>
<pre style="margin: 0px">timePLINQ.TotalSeconds / timeSequential.TotalSeconds</pre>
<pre style="margin: 0px">  |&gt; printfn <span style="color: maroon">"Ratio: %.2f"</span></pre>
<pre style="margin: 0px"></pre>
<pre style="margin: 0px">sumSequential = sumPLINQ</pre>
<pre style="margin: 0px">  |&gt; printfn <span style="color: maroon">"Same Results: %A"</span></pre>
</div>
<p>On my machine I get the following results:</p>
<blockquote><p>Time Normal: 27.955s</p>
<p>Time PLINQ: 15.505s</p>
<p>Ratio: 0.55</p>
<p>Same Results: true</p></blockquote>
<p>This means I get nearly a perfect load balancing on my two processors for this task.</p>
<p>In <a href="http://www.navision-blog.de/2008/10/24/using-plinq-in-fsharp-parallel-map-and-reduce-fold-functions-part-ii/">part II</a> I describe how one can compute a series of functions in parallel.</p>
<p>&copy;2012 <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/2008/10/23/using-plinq-in-fsharp-parallel-map-and-reduce-fold-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

