<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss version="2.0">
  <channel>
    <title>Planet F#</title>
    <description>Planet F#</description>
    <link>http://babelnova.net/planet</link>
    <docs>http://backend.userland.com/rss</docs>
    <generator>RSS.NET: http://www.rssdotnet.com/</generator>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/planet_fsharp" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
      <title>Fun with Functional - Currying di C#</title>
      <description>&lt;h1 style="MARGIN:10pt 0cm 0pt;"&gt;&lt;font color="#17365d" size="4" face="Calibri"&gt;Apa itu &lt;i style=""&gt;Currying&lt;/i&gt;?&lt;br /&gt;&lt;/font&gt;&lt;/h1&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;i style=""&gt;&lt;br /&gt;Currying&lt;/i&gt; adalah sebuah teknik yang sangat lazim dipakai di bahasa pemrograman fungsional, seperti Haskell, LISP, OCaml, JavaScript, dan tentu saja, F#. Bagi yang belum memahami apa itu &lt;i style=""&gt;currying&lt;/i&gt;, lihatlah contoh program F# di bawah:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;let&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; add x y = x + y&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&amp;nbsp;&lt;/span&gt; &lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;printf &lt;span style="COLOR:maroon;"&gt;"%d"&lt;/span&gt; (add 5 2) &lt;span style="COLOR:green;"&gt;// should print 7&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;i style=""&gt;Code&lt;/i&gt; di atas adalah deklarasi sebuah fungsi &lt;/font&gt;&lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;add&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;. Tipe dari &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;add &lt;/span&gt;&lt;font size="3" face="Calibri"&gt;adalah &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;int -&amp;gt; int -&amp;gt; int&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;. Bagi anda yang terbiasa memakai &lt;/font&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;delegate&lt;/span&gt;&lt;font size="3" face="Calibri"&gt; &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;System.&lt;span style="COLOR:#2b91af;"&gt;Func&lt;/span&gt;&lt;/span&gt;&lt;font size="3" face="Calibri"&gt; maupun &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;System.&lt;span style="COLOR:#2b91af;"&gt;Action&lt;/span&gt;&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;, tipe data &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;add&lt;/span&gt;&lt;font size="3" face="Calibri"&gt; ini apabila ditulis dengan sintaksis C# menggunakan &lt;/font&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;Func&lt;/span&gt;&lt;font size="3" face="Calibri"&gt; adalah &lt;/font&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;Func&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&amp;lt;&lt;span style="COLOR:blue;"&gt;int&lt;/span&gt;, &lt;span style="COLOR:blue;"&gt;int&lt;/span&gt;, &lt;span style="COLOR:blue;"&gt;int&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;. Kedua buah &lt;/font&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;int&lt;/span&gt;&lt;font size="3" face="Calibri"&gt; pertama adalah tipe parameter, dan &lt;/font&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;int&lt;/span&gt;&lt;font size="3" face="Calibri"&gt; yang terakhir adalah &lt;i style=""&gt;function’s return type&lt;/i&gt;.&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;Nah, C# adalah sebuah bahasa yang belum &lt;i style=""&gt;full functional programming&lt;/i&gt; seperti halnya F#, sehingga di F# kita dapat menuliskan bentuk seperti ini:&lt;/font&gt;&lt;/p&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;let&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; addFiveWith = add 5&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&amp;nbsp;&lt;/span&gt; &lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;printf &lt;span style="COLOR:maroon;"&gt;"%d"&lt;/span&gt; (addFiveWith 2)&lt;span style="COLOR:green;"&gt; // should print 7&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;Tipe dari &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;addFiveWith&lt;/span&gt;&lt;font size="3" face="Calibri"&gt; adalah &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;int -&amp;gt; int&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;, yaitu fungsi &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;add &lt;/span&gt;&lt;font size="3" face="Calibri"&gt;yang tadinya memiliki dua buah parameter, menjadi tinggal satu, karena parameter pertama diganti dengan lima. Inilah yang disebut dengan &lt;i style=""&gt;currying&lt;/i&gt;, mendapatkan fungsi baru (&lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;addFiveWith&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;) dengan memberi sebagian parameter pada fungsi awal (&lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;add)&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;.&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;Salah satu cara pandang tentang apa itu &lt;i style=""&gt;currying&lt;/i&gt; adalah dengan memahami notasi dari tipe fungsi &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;add&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;. Ingat, notasi dari tipe &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;add&lt;/span&gt;&lt;font size="3" face="Calibri"&gt; adalah:&lt;/font&gt;&lt;/p&gt;&lt;span style="FONT-SIZE:10pt;"&gt;int -&amp;gt; int -&amp;gt; int&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;/span&gt; &lt;p&gt;&lt;font size="3" face="Calibri"&gt;Secara C#, hal tersebut ditulis sebagai:&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;Func&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&amp;lt;&lt;span style="COLOR:blue;"&gt;int&lt;/span&gt;, &lt;span style="COLOR:blue;"&gt;int&lt;/span&gt;, &lt;span style="COLOR:blue;"&gt;int&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;&amp;nbsp;&lt;/font&gt;&lt;font size="3" face="Calibri"&gt;Anda harus memahami bahwa keduanya walaupun sepintas sama, sebenarnya berbeda.&lt;span style=""&gt;&amp;nbsp; &lt;/span&gt;Pada C#, &lt;/font&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;int&lt;/span&gt;&lt;font size="3" face="Calibri"&gt; yang terakhir selalu &lt;i style=""&gt;return type&lt;/i&gt;, artinya terdapat perbedaan yang jelas mana yang parameter dan mana yang &lt;i style=""&gt;return type&lt;/i&gt;. Nah, tipe &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;add &lt;/span&gt;&lt;font size="3" face="Calibri"&gt;di dalam F# berbeda, tidak ada perbedaan yang jelas yang mana parameter dan mana yang &lt;i style=""&gt;return type&lt;/i&gt;, sehingga anda bebas menginterpretasikan &lt;span style=""&gt;&amp;nbsp;&lt;/span&gt;tipe &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;add &lt;/span&gt;&lt;font size="3" face="Calibri"&gt;sebagai:&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;(int -&amp;gt; int) -&amp;gt; (int) &lt;span style="COLOR:green;"&gt;// fungsi dengan dua buah parameter int dan return type sebuah int&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="FONT-SIZE:10pt;"&gt;(int) -&amp;gt; (int -&amp;gt; int) &lt;span style="COLOR:green;"&gt;// fungsi dengan sebuah parameter int dan return type sebuah fungsi berparameter int dan return type int&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;/span&gt; &lt;font size="3" face="Calibri"&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;br /&gt;&lt;/font&gt;&lt;font size="3" face="Calibri"&gt;Pada saat anda memanggil &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;add 5 2&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;, maka &lt;i style=""&gt;return type&lt;/i&gt; adalah penjumlahan dari keduanya yaitu 7.&lt;br /&gt;Pada saat anda memanggil &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;add 5&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;, maka &lt;i style=""&gt;return type&lt;/i&gt; adalah sebuah fungsi yang berparameter &lt;/font&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;int&lt;/span&gt;&lt;font size="3" face="Calibri"&gt; dan &lt;i style=""&gt;return type&lt;/i&gt; &lt;/font&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;int&lt;/span&gt;&lt;font size="3" face="Calibri"&gt; yang bernilai parameter pertamanya ditambahkan dengan 5. Karena perbedaan inilah, maka &lt;i style=""&gt;lambda expression&lt;/i&gt; C# dan F# itu berbeda, seperti yang akan kita lihat nanti bagaimana cara mengonversinya.&lt;/font&gt;&lt;/p&gt;&lt;span style="FONT-SIZE:11pt;"&gt;&lt;span style=""&gt;Apabila anda heran dari bahasa mana kata &lt;i style=""&gt;currying&lt;/i&gt; berasal, maka &lt;i style=""&gt;currying&lt;/i&gt; itu adalah nama seorang matematikawan Haskell Curry. Ya, bahasa Haskell yang kesohor adalah juga berasal dari namanya. Yang berjasa dalam menemukan currying sebenarnya bukan cuma Haskell Curry, tapi juga seorang bernama Moses Schönfinkel. Beberapa orang ada yang menyarankan untuk mengganti &lt;i style=""&gt;currying&lt;/i&gt; dengan Schönfinkelisation. Tanpa merendahkan Mas Moses, kita harus bersyukur bahwa nama yang terakhir tidak dipakai, mengingat kemungkinan terjadinya kesalahan ketik yang besar. &lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3"&gt;&lt;span style="FONT-SIZE:11pt;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;font color="#17365d"&gt;&lt;font face="Calibri"&gt;&lt;font size="4"&gt;&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#17365d"&gt;&lt;font face="Calibri"&gt;&lt;font size="4"&gt;Salah Satu Contoh, &lt;i style=""&gt;Currying Could be Useful&lt;/i&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;Mari kita kembali ke masa kuliah dan mengambil analisis numerik, menghitung turunan secara numerik. Masih ingat apa itu turunan? Disebut sebagai perubahan sesaat dari sebuah fungsi, jadi kita bisa mendapatkan kemiringan (gradien) fungsi pada titik tertentu, dan bukan pada interval tertentu apabila turunan tidak digunakan. Pertama kali ditemukan oleh Sir Isaac Newton pada saat kuliah di Cambridge untuk memodelkan 3 hukum Newton. Saat itu Pak Ishak (sapaan akrab Newton) ingin merumuskan kecepatan sesaat maupun percepatan sesaat.&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;Definisi asal turunan adalah:&lt;/font&gt;&lt;/p&gt;&lt;span style="FONT-SIZE:11pt;"&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style=""&gt;&amp;nbsp;&lt;img border="0" alt="Definisi diferensial" src="http://geeks.netindonesia.net/blogs/fuehrerx/Fun-tional%20Curry/differential.jpg" width="162" height="50"/&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style=""&gt;Terlihat jelas dari persamaan di atas bahwa kemiringan sesaat dapat ditemukan dengan membuat &lt;/span&gt;&lt;span style=""&gt;Δ&lt;/span&gt;&lt;span style=""&gt;x sekecil mungkin, karena apabila &lt;/span&gt;&lt;span style=""&gt;Δ&lt;/span&gt;&lt;span style=""&gt;x besar, maka persamaan di atas adalah definisi untuk mendapatkan kemiringan rata-rata, dan bukan sesaat. Untuk mengaproksimasi persamaan tersebut secara numerik, biasanya digunakan rumus:&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="FONT-SIZE:11pt;"&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;span style=""&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;img border="0" alt="Definisi diferensial numerik" src="http://geeks.netindonesia.net/blogs/fuehrerx/Fun-tional%20Curry/numeric-differential.jpg" width="148" height="47"/&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=""&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Sip, mari kita tulis dalam bentuk F#:&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=""&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;let&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; derivative f x =&amp;nbsp;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style="COLOR:blue;"&gt;let&lt;/span&gt; dx = sqrt epsilon_float&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;(f(x + dx) - f(x - dx)) / (2.0 * dx)&lt;/span&gt; &lt;p&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3" face="Calibri"&gt;Agar persamaan di atas benar mengaproksimasi turunan, maka &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;dx &lt;/span&gt;&lt;span style=""&gt;&lt;font size="3" face="Calibri"&gt;harus dibuat sekecil mungkin. Berhati-hati dengan bilangan &lt;i style=""&gt;floating point&lt;/i&gt; karena anda tidak dapat begitu saja memberikan sembarang nilai kecil. Beberapa nilai kecil &lt;i style=""&gt;floating point&lt;/i&gt;, apabila anda tambahkan dengan satu, hasilnya adalah satu (yang seharusnya satu koma sekian). Cara untuk mendapatkan bilangan kecil yang mana apabila ditambahkan dengan satu hasilnya bukan satu adalah seperti yang terlihat di atas. Konstanta &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;epsilon_float&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt; didefinisikan di FSharp.PowerPack.dll. Tentu saja, anda bebas untuk mengganti nilai ini dengan 0.00005 atau terserah anda.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; &lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;Sebelum kita analisa tipe dari &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;derivative&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;, mari kita lihat bagaimana cara menggunakannya:&lt;/font&gt;&lt;/p&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;let&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; result = derivative (&lt;span style="COLOR:blue;"&gt;fun&lt;/span&gt; x &lt;span style="COLOR:blue;"&gt;-&amp;gt;&lt;/span&gt; x ** 2.0) 3.0&lt;/span&gt; &lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;printfn &lt;span style="COLOR:maroon;"&gt;"%f"&lt;/span&gt; result &lt;span style="COLOR:green;"&gt;// should print 6.0&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style="COLOR:green;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;Tujuan dari fungsi tersebut adalah untuk menghitung turunan dari fungsi x kuadrat pada saat x bernilai 3. Seperti kita tahu, fungsi x^2 turunannya adalah 2.x, dan pada saat x bernilai 3, maka nilainya adalah 2 . 3 = 6. Parameter pertama pada pemanggilan &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;derivative &lt;/span&gt;&lt;font size="3" face="Calibri"&gt;adalah sintaksis &lt;i style=""&gt;lambda expression&lt;/i&gt; di F#, yang apabila di C# kira-kira &lt;font size="2"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;x =&amp;gt; x ** 2.0&lt;/span&gt;&lt;span style="FONT-SIZE:11pt;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&amp;nbsp;(tidak ada operator &lt;font size="2" face="Courier New"&gt;** &lt;/font&gt;di C#, cuma pengandaian).&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;Tipe dari &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;derivative &lt;/span&gt;&lt;font size="3" face="Calibri"&gt;adalah:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:10pt;"&gt;(float -&amp;gt; float) -&amp;gt; float -&amp;gt; float&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;Sebelum menganalisa lebih jauh, anda harus ingat bahwa &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;float&lt;/span&gt;&lt;font size="3" face="Calibri"&gt; di F# berarti &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;System.&lt;span style="COLOR:#2b91af;"&gt;Double&lt;/span&gt;&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;. Parameter pertama adalah sebuah fungsi dengan sebuah parameter float dan &lt;i style=""&gt;return type&lt;/i&gt; &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;float&lt;/span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;. Pada contoh pemanggilan di atas, parameter ini bernilai &lt;span style=""&gt;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;(&lt;span style="COLOR:blue;"&gt;fun&lt;/span&gt; x &lt;span style="COLOR:blue;"&gt;-&amp;gt;&lt;/span&gt; x ** 2.0)&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;, diikuti oleh parameter kedua adalah &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;float&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;, anda suplai dengan nilai 3.0, yaitu anda ingin menghitung turunan dari x^2 di x = 3. Tentu saja, &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;float&lt;/span&gt;&lt;font size="3" face="Calibri"&gt; yang terakhir adalah &lt;i style=""&gt;return type&lt;/i&gt; dari fungsi &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;derivative&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;, bernilai 6 apabila dua parameter adalah sesuai dengan yang di atas.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="3" face="Calibri"&gt;Salah satu kelebihan F# adalah &lt;i style=""&gt;type inference is ubiquitous&lt;/i&gt;. F# compiler dan interpreter dapat mengenali tipe data di atas tanpa anda menulis secara eksplisit tipe dari f dan x. Lebih ekstrim lagi, apabila anda memanggil &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;printfn &lt;span style="COLOR:maroon;"&gt;"%d"&lt;/span&gt; result&lt;/span&gt;&lt;font size="3" face="Calibri"&gt; (bukan &lt;/font&gt;&lt;span style="COLOR:maroon;FONT-SIZE:10pt;"&gt;"%f"&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; &lt;/span&gt;&lt;font size="3" face="Calibri"&gt;untuk menampilkan &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;float&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;) , anda akan mendapatkan &lt;i style=""&gt;compile-time-error&lt;/i&gt; dan bukan &lt;i style=""&gt;runtime-error&lt;/i&gt;. Artinya compiler dan interpreter F# mengecek sampai ke parameter format &lt;/font&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;string&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;, sesuatu yang biasanya dilakukan pada saat &lt;i style=""&gt;runtime&lt;/i&gt;.&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Nah, masih ingat dengan &lt;i style=""&gt;currying&lt;/i&gt;? Sepintas fungsi &lt;/font&gt;&lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;derivative &lt;/span&gt;&lt;font size="3" face="Calibri"&gt;cuma menghasilkan sebuah nilai &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;float&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;. Dengan menggunakan &lt;i style=""&gt;currying&lt;/i&gt;, anda bisa mendapatkan fungsi turunan seperti di bawah:&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;let&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; f x = x ** 3.0 + 3.0 * x&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;let&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; f' = derivative f &lt;span style="COLOR:green;"&gt;// f' adalah turunan dari x^3 + 3x -&amp;gt; 3x^2 + 3&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;printfn &lt;span style="COLOR:maroon;"&gt;"%f"&lt;/span&gt; (f' 2.0) &lt;span style="COLOR:green;"&gt;// 3.2.2 + 3 = 15&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style="COLOR:green;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;Simple eh? Anda baru saja melihat salah kehebatan dari &lt;i style=""&gt;currying&lt;/i&gt;, kalau pada code di atas pemanggilannya adalah &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;derivative f 2.0&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;, anda akan mendapat sebuah nilai 15.0, namun kalau anda memanggilnya &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;derivative f&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;, anda akan mendapatkan sebuah fungsi turunan dari f. Jadi dengan &lt;i style=""&gt;currying&lt;/i&gt;, anda hanya membuat sebuah fungsi, &lt;i style=""&gt;return type&lt;/i&gt; bisa banyak, tergantung bagaimana parameternya. Biar lebih seru, mari kita membuat sebuah fungsi untuk menampilkan grafik dari fungsi dengan memanfaatkan komponen &lt;/font&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;XYGraph&lt;/span&gt;&lt;font size="3" face="Calibri"&gt; yang dapat anda cari di internet.&lt;/font&gt;&lt;/p&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;let&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; Plot (from:float) (step:float) (final:float) (func:float &lt;span style="COLOR:blue;"&gt;-&amp;gt;&lt;/span&gt; float) =&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR:blue;"&gt;let&lt;/span&gt; form = &lt;span style="COLOR:blue;"&gt;new&lt;/span&gt; Form(Visible = &lt;span style="COLOR:blue;"&gt;true&lt;/span&gt;, TopMost = &lt;span style="COLOR:blue;"&gt;true&lt;/span&gt;)&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;form.KeyPress.AddHandler (&lt;span style="COLOR:blue;"&gt;fun&lt;/span&gt; _ _ &lt;span style="COLOR:blue;"&gt;-&amp;gt;&lt;/span&gt; form.Close())&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR:blue;"&gt;let&lt;/span&gt; graph = &lt;span style="COLOR:blue;"&gt;new&lt;/span&gt; XYGraph(Dock = DockStyle.Fill)&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;graph.XtraTitle &amp;lt;- String.Empty&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;graph.XtraLabelX &amp;lt;- String.Empty&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;graph.XtraLabelY &amp;lt;- String.Empty&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; form.Controls.Add(graph)&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR:blue;"&gt;let&lt;/span&gt; g = graph.AddGraph(String.Empty, Drawing2D.DashStyle.Solid, Color.Red, 1, &lt;span style="COLOR:blue;"&gt;false&lt;/span&gt;)&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR:blue;"&gt;for&lt;/span&gt; x &lt;span style="COLOR:blue;"&gt;in&lt;/span&gt; from .. step .. final &lt;span style="COLOR:blue;"&gt;do&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;graph.AddValue(g, float32 x, float32 (func x))&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;graph.DrawAll()&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;let&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; f x = x ** 3.0 + 3.0 * x&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;let&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; f' = derivative f &lt;span style="COLOR:green;"&gt;// f' adalah turunan dari x^3 + 3x -&amp;gt; 3x^2 + 3&lt;/span&gt;&lt;/span&gt;&lt;span style="COLOR:green;FONT-SIZE:10pt;"&gt;&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;Plot -3.0 0.05 3.0 f&lt;br /&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;Plot -3.0 0.05 3.0 f'&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;&amp;nbsp;&lt;/font&gt; &lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;Berikut adalah tampilan dari program di atas:&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;&lt;img border="0" alt="Tampilan dua fungsi" src="http://geeks.netindonesia.net/blogs/fuehrerx/Fun-tional%20Curry/two-plot.jpg" width="594" height="295"/&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;Gambar kiri adalah fungsi f(x) = &lt;span style=""&gt;&amp;nbsp;&lt;/span&gt;(x^3 + 3x) dan gambar kanan adalah fungsi f’(x) = &lt;span style=""&gt;&amp;nbsp;&lt;/span&gt;(3x^2 + 3).&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;h1 style="MARGIN:10pt 0cm 0pt;"&gt;&lt;font color="#17365d" size="4" face="Calibri"&gt;Enough Talking About F#, I’m a C# Folks!&lt;br /&gt;&lt;/font&gt;&lt;/h1&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;&lt;br /&gt;Ternyata masih tidak ingin beralih ke F# rupanya. Oke, kalau begitu mari kita bahas bagaimana &lt;i style=""&gt;currying&lt;/i&gt; juga bisa dilakukan di C#. Pertama, perhatikan sebuah fungsi sederhana berikut:&lt;/font&gt;&lt;/p&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;public&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; &lt;span style="COLOR:blue;"&gt;static&lt;/span&gt; &lt;span style="COLOR:blue;"&gt;int&lt;/span&gt; Add(&lt;span style="COLOR:blue;"&gt;int&lt;/span&gt; number1, &lt;span style="COLOR:blue;"&gt;int&lt;/span&gt; number2)&lt;br /&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;{&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR:blue;"&gt;return&lt;/span&gt; number1 + number2;&lt;br /&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;}&lt;/span&gt; &lt;p&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3" face="Calibri"&gt;Nah, untuk mendapatkan fungsi &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;AddFiveWith&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt; seperti yang telah kita lakukan di awal, kira-kira code-nya adalah seperti ini:&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=""&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;Func&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&amp;lt;&lt;span style="COLOR:blue;"&gt;int&lt;/span&gt;, &lt;span style="COLOR:blue;"&gt;int&lt;/span&gt;, &lt;span style="COLOR:blue;"&gt;int&lt;/span&gt;&amp;gt; addDelegate = Add;&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;var&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; addFiveWith = addDelegate.Curry(5);&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3" face="Calibri"&gt; &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;Console&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;.WriteLine(addFiveWith(7)); &lt;span style="COLOR:green;"&gt;// akan mencetak 12&lt;/span&gt;&lt;/span&gt; &lt;p&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style="COLOR:green;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;span style=""&gt;&lt;font size="3" face="Calibri"&gt;Sekarang, mari kita analisa bersama, bagaimana kira-kira mengimplementasi fungsi &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;Curry&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;. &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Input dari fungsi ini adalah sebuah fungsi dengan jumlah parameter dua, disusul dengan sebuah parameter yang akan menggantikan parameter pertama dengan sebuah nilai dari user (5 untuk kasus di atas). Tipe data kembalian adalah sebuah fungsi dengan sebuah parameter, dan tipe kembalian dari fungsi ini adalah sama dengan fungsi asal. Untuk lebih jelasnya perhatikan &lt;em&gt;code&lt;/em&gt; di bawah:&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; &lt;p&gt;&lt;span style=""&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;public&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; &lt;span style="COLOR:blue;"&gt;static&lt;/span&gt; TipeFungsiKembalian Curry&amp;lt;TypeList&amp;gt;(&lt;span style="COLOR:blue;"&gt;this&lt;/span&gt; TipeFungsiAsal fungsi, TipeParameter1FungsiAsal param1)&lt;br /&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;{&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR:gray;"&gt;//&lt;/span&gt;&lt;span style="COLOR:green;"&gt; bla bla bla&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;}&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt; &lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;Untuk mendapatkan &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;TypeList&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;, pertama mari kita menganalisa &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;TipeFungsiAsal&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;. &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;TipeFungsiAsal &lt;/span&gt;&lt;font size="3" face="Calibri"&gt;adalah fungsi dengan parameter dua, masing-masing parameter boleh bertipe berbeda, dan &lt;i style=""&gt;return type&lt;/i&gt; dari fungsi ini boleh berbeda dari kedua parameternya. Maka kita dapat menulis &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;TipeFungsiAsal &lt;/span&gt;&lt;font size="3" face="Calibri"&gt;sebagai:&lt;/font&gt;&lt;/p&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;Func&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&amp;lt;T1, T2, TResult&amp;gt;&lt;/span&gt; &lt;p&gt;&lt;font size="3" face="Calibri"&gt;Dengan mudahnya, tipe&lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt; TipeParameter1FungsiAsal &lt;/span&gt;&lt;font size="3" face="Calibri"&gt;adalah &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;T1.&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;Terakhir &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;TipeFungsiKembalian &lt;/span&gt;&lt;font size="3" face="Calibri"&gt;adalah sebuah fungsi dengan sebuah parameter yang mana tipe dari parameter ini adalah sama dengan tipe dari parameter ke dua dari fungsi asal, dan &lt;i style=""&gt;return type&lt;/i&gt; adalah sama dengan &lt;i style=""&gt;return type&lt;/i&gt; dari fungsi asal. Maka, tipenya adalah:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;Func&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&amp;lt;T2, TResult&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;Berarti, &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;TypeList&lt;/span&gt;&lt;font size="3" face="Calibri"&gt; dapat kita tulis sebagai, &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;T1, T2, TResult&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt; sehingga fungsi Curry signaturenya adalah:&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; &lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;&amp;nbsp;&lt;/span&gt; &lt;p&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;public&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; &lt;span style="COLOR:blue;"&gt;static&lt;/span&gt; &lt;span style="COLOR:#2b91af;"&gt;Func&lt;/span&gt;&amp;lt;T2, TResult&amp;gt; Curry&amp;lt;T1, T2, TResult&amp;gt;(&lt;span style="COLOR:blue;"&gt;this&lt;/span&gt; &lt;span style="COLOR:#2b91af;"&gt;Func&lt;/span&gt;&amp;lt;T1, T2, TResult&amp;gt; func, T1 param1)&lt;br /&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;{&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR:gray;"&gt;//&lt;/span&gt;&lt;span style="COLOR:green;"&gt; bla bla bla&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3" face="Calibri"&gt;&lt;font size="2" face="Courier New"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; &lt;p&gt;&lt;span style=""&gt;&lt;font size="3" face="Calibri"&gt;Terakhir, mari kita ganti “bla bla bla” dengan sesuatu yang dimengerti oleh C# compiler. Tipe kembalian adalah &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;Func&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&amp;lt;T2, TResult&amp;gt;&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;, yang diubah ke lambda expression menjadi:&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;p2 =&amp;gt; func(param1, p2);&lt;/span&gt;&lt;/p&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3" face="Calibri"&gt;Harus diingat bahwa tipe kembalian dari func adalah &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;TResult&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3" face="Calibri"&gt;, sehingga &lt;i style=""&gt;lambda expression&lt;/i&gt; di atas bertipe &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;Func&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&amp;lt;T2, TResult&amp;gt;&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3" face="Calibri"&gt;. Dengan &lt;i style=""&gt;type inference&lt;/i&gt;, C# compiler cukup pintar untuk mengetahui bahwa tipe &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;p2 &lt;/span&gt;&lt;span style=""&gt;&lt;font size="3" face="Calibri"&gt;adalah &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;T2&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3" face="Calibri"&gt;. Sekarang, fungsi &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;Curry&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt; dapat kita implementasi dalam versi lengkap:&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; &lt;br /&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;&amp;nbsp;&lt;/span&gt; &lt;p&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;public&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; &lt;span style="COLOR:blue;"&gt;static&lt;/span&gt; &lt;span style="COLOR:#2b91af;"&gt;Func&lt;/span&gt;&amp;lt;T2, TResult&amp;gt; Curry&amp;lt;T1, T2, TResult&amp;gt;(&lt;span style="COLOR:blue;"&gt;this&lt;/span&gt; &lt;span style="COLOR:#2b91af;"&gt;Func&lt;/span&gt;&amp;lt;T1, T2, TResult&amp;gt; func, T1 param1)&lt;br /&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;{&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR:blue;"&gt;return&lt;/span&gt; p2 =&amp;gt; func(param1, p2);&lt;br /&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;font size="2" face="Courier New"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; &lt;p&gt;&lt;span style=""&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Sederhana bukan? Mari kita lihat salah satu contoh penggunaan:&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;public&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; &lt;span style="COLOR:blue;"&gt;static&lt;/span&gt; &lt;span style="COLOR:blue;"&gt;double&lt;/span&gt; Derivative(&lt;span style="COLOR:#2b91af;"&gt;Func&lt;/span&gt;&amp;lt;&lt;span style="COLOR:blue;"&gt;double&lt;/span&gt;, &lt;span style="COLOR:blue;"&gt;double&lt;/span&gt;&amp;gt; f, &lt;span style="COLOR:blue;"&gt;double&lt;/span&gt; x)&lt;br /&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;{&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR:blue;"&gt;double&lt;/span&gt; dx = 2.220446049e-8;&lt;br /&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR:blue;"&gt;return&lt;/span&gt; (f(x + dx) - f(x - dx)) / (2*dx);&lt;br /&gt;}&lt;/span&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;Func&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&amp;lt;&lt;span style="COLOR:#2b91af;"&gt;Func&lt;/span&gt;&amp;lt;&lt;span style="COLOR:blue;"&gt;double&lt;/span&gt;, &lt;span style="COLOR:blue;"&gt;double&lt;/span&gt;&amp;gt;, &lt;span style="COLOR:blue;"&gt;double&lt;/span&gt;, &lt;span style="COLOR:blue;"&gt;double&lt;/span&gt;&amp;gt; diff = Derivative;&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;Func&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&amp;lt;&lt;span style="COLOR:blue;"&gt;double&lt;/span&gt;, &lt;span style="COLOR:blue;"&gt;double&lt;/span&gt;&amp;gt; xSquare = x =&amp;gt; &lt;span style="COLOR:#2b91af;"&gt;Math&lt;/span&gt;.Pow(x, 2);&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;&lt;br /&gt;var&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; twoX = diff.Curry(xSquare); &lt;span style="COLOR:green;"&gt;// mendapatkan turunan dari x kuadrat, yaitu 2 * x&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;Console&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;.WriteLine(twoX(2)); &lt;span style="COLOR:green;"&gt;// 4&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;Console&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;.WriteLine(twoX(3)); &lt;span style="COLOR:green;"&gt;// 6&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;Console&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;.WriteLine(twoX(4)); &lt;span style="COLOR:green;"&gt;// 8&lt;/span&gt;&lt;/span&gt;&lt;span style="COLOR:green;FONT-SIZE:10pt;"&gt;&amp;nbsp;&lt;/span&gt; &lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;Contoh penggunaan lain yang lebih sederhana:&lt;/font&gt;&lt;/p&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;public&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; &lt;span style="COLOR:blue;"&gt;static&lt;/span&gt; &lt;span style="COLOR:blue;"&gt;string&lt;/span&gt; NamaDanUsia(&lt;span style="COLOR:blue;"&gt;string&lt;/span&gt; nama, &lt;span style="COLOR:blue;"&gt;int&lt;/span&gt; usia)&lt;br /&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;{&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR:blue;"&gt;return&lt;/span&gt; &lt;span style="COLOR:blue;"&gt;string&lt;/span&gt;.Format(&lt;span style="COLOR:#a31515;"&gt;"Halo, nama saya {0} berusia {1}"&lt;/span&gt;, nama, usia);&lt;br /&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;Func&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&amp;lt;&lt;span style="COLOR:blue;"&gt;string&lt;/span&gt;, &lt;span style="COLOR:blue;"&gt;int&lt;/span&gt;, &lt;span style="COLOR:blue;"&gt;string&lt;/span&gt;&amp;gt; namaUsiaDelegate = NamaDanUsia;&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;var&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; budiDenganUsia = namaUsiaDelegate.Curry(&lt;span style="COLOR:#a31515;"&gt;"Budi"&lt;/span&gt;);&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;Console&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;.WriteLine(budiDenganUsia(3));&lt;span style=""&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR:green;"&gt;// Halo, nama saya Budi berusia 3&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;Console&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;.WriteLine(budiDenganUsia(10));&lt;span style="COLOR:green;"&gt; // Halo, nama saya Budi berusia 10&lt;/span&gt;&lt;/span&gt; &lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;Console&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;.WriteLine(budiDenganUsia(20));&lt;span style="COLOR:green;"&gt; // Halo, nama saya Budi berusia 20&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;Tentu saja, fungsi &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;Curry&lt;/span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt; yang kita buat hanya berlaku untuk fungsi dengan &lt;i style=""&gt;return type non-&lt;/i&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;void&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; &lt;/span&gt;&lt;font size="3" face="Calibri"&gt;(untuk yang &lt;/font&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;void&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; &lt;/span&gt;&lt;font size="3" face="Calibri"&gt;silakan implementasikan sendiri, dengan memanfaatkan &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;System.&lt;span style="COLOR:#2b91af;"&gt;Action&lt;/span&gt;&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;), dan dengan dua buah parameter. Untuk tiga parameter dan selebihnya, masing-masing dibuat &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;Curry&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;-nya:&lt;/font&gt;&lt;/p&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;public&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; &lt;span style="COLOR:blue;"&gt;static&lt;/span&gt; &lt;span style="COLOR:#2b91af;"&gt;Func&lt;/span&gt;&amp;lt;T2, T3, TResult&amp;gt; Curry&amp;lt;T1, T2, T3, TResult&amp;gt;(&lt;span style="COLOR:blue;"&gt;this&lt;/span&gt; &lt;span style="COLOR:#2b91af;"&gt;Func&lt;/span&gt;&amp;lt;T1, T2, T3, TResult&amp;gt; func, T1 param1)&lt;br /&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;{&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style="COLOR:blue;"&gt;return&lt;/span&gt; (p2, p3) =&amp;gt; func(param1, p2, p3);&lt;br /&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style="COLOR:#2b91af;"&gt;Func&lt;/span&gt;&amp;lt;T2, T3, T4, TResult&amp;gt; Curry&amp;lt;T1, T2, T3, T4, TResult&amp;gt;(&lt;span style="COLOR:blue;"&gt;this&lt;/span&gt; &lt;span style="COLOR:#2b91af;"&gt;Func&lt;/span&gt;&amp;lt;T1, T2, T3, T4, TResult&amp;gt; func, T1 param1)&lt;br /&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;{&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR:blue;"&gt;return&lt;/span&gt; (p2, p3, p4) =&amp;gt; func(param1, p2, p3, p4);&lt;/span&gt; &lt;br /&gt;&lt;span style="FONT-SIZE:10pt;"&gt;}&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;public&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; &lt;span style="COLOR:blue;"&gt;static&lt;/span&gt; &lt;span style="COLOR:blue;"&gt;int&lt;/span&gt; AddNumbers(&lt;span style="COLOR:blue;"&gt;int&lt;/span&gt; n1, &lt;span style="COLOR:blue;"&gt;int&lt;/span&gt; n2, &lt;span style="COLOR:blue;"&gt;int&lt;/span&gt; n3, &lt;span style="COLOR:blue;"&gt;int&lt;/span&gt; n4)&lt;br /&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;{&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR:blue;"&gt;return&lt;/span&gt; n1 + n2 + n3 + n4;&lt;br /&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;Func&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&amp;lt;&lt;span style="COLOR:blue;"&gt;int&lt;/span&gt;, &lt;span style="COLOR:blue;"&gt;int&lt;/span&gt;, &lt;span style="COLOR:blue;"&gt;int&lt;/span&gt;, &lt;span style="COLOR:blue;"&gt;int&lt;/span&gt;, &lt;span style="COLOR:blue;"&gt;int&lt;/span&gt;&amp;gt; addNumbersDelegate = AddNumbers;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;var&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; addFiveWith = addNumbersDelegate.Curry(5);&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;var&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; addFiveAndTwoWith = addNumbersDelegate.Curry(5).Curry(2);&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;var&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; ten = addNumbersDelegate.Curry(1).Curry(2).Curry(3)(4); &lt;span style="COLOR:green;"&gt;// sintaks bodoh tapi bergaya pengganti addNumbersDelegate(1, 2, 3, 4)&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;addFiveWith(3, 2, 1); &lt;span style="COLOR:green;"&gt;// 11&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;addFiveAndTwoWith(1, 2); &lt;span style="COLOR:green;"&gt;// 10&lt;/span&gt;&lt;/span&gt; &lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;Setelah anda paham garis besarnya, silakan buat &lt;i style=""&gt;function overload&lt;/i&gt;-nya agar pemanggilan &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;Curry&lt;/span&gt;&lt;font size="3" face="Calibri"&gt; tidak dilakukan berkali-kali seperti pada contoh di atas, contoh:&lt;/font&gt;&lt;/p&gt;&lt;span style="COLOR:green;FONT-SIZE:10pt;"&gt;// Curry dua parameter sekaligus&lt;br /&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style="COLOR:#2b91af;"&gt;Func&lt;/span&gt;&amp;lt;T2, T3, T4, TResult&amp;gt; Curry&amp;lt;T1, T2, T3, T4, TResult&amp;gt;(&lt;span style="COLOR:blue;"&gt;this&lt;/span&gt; &lt;span style="COLOR:#2b91af;"&gt;Func&lt;/span&gt;&amp;lt;T1, T2, T3, T4, TResult&amp;gt; func, T1 param1, T2 param2)&lt;br /&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;{&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR:blue;"&gt;return&lt;/span&gt; (p2, p3, p4) =&amp;gt; func(param1, param2, p3, p4);&lt;br /&gt;&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;&lt;font size="2" face="Courier New"&gt;}&lt;/font&gt;&lt;/font&gt; &lt;p&gt;&lt;font size="3" face="Calibri"&gt;Kalau anda mengkikuti sampai sejauh ini maka &lt;/font&gt;&lt;font size="3" face="Calibri"&gt;selamat! Anda telah membuat semacam &lt;i style=""&gt;framework&lt;/i&gt; agar C# dapat melakukan &lt;i style=""&gt;currying&lt;/i&gt;!&lt;/font&gt;&lt;/p&gt;
&lt;h1 style="MARGIN:10pt 0cm 0pt;"&gt;&lt;font color="#17365d" size="4" face="Calibri"&gt;&lt;/font&gt;&amp;nbsp;&lt;/h1&gt;
&lt;p style="MARGIN:10pt 0cm 0pt;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;h1 style="MARGIN:10pt 0cm 0pt;"&gt;&lt;font color="#17365d" size="4" face="Calibri"&gt;Konversi dari C# Func ke F# FastFunc:&lt;/font&gt;&lt;/h1&gt;
&lt;p style="MARGIN:10pt 0cm 0pt;"&gt;&lt;font size="3" face="Calibri"&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;let&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;font color="#000000"&gt; Plot (from:float) (step:float) (final:float) (func:float &lt;/font&gt;&lt;span style="COLOR:blue;"&gt;-&amp;gt;&lt;/span&gt;&lt;font color="#000000"&gt; float) =&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;&lt;br /&gt;Satu lagi, misal anda ingin menggunakan fungsi &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;"&gt;Plot &lt;/span&gt;&lt;font size="3" face="Calibri"&gt;di atas dalam program C#, maka kita akan menulis seperti ini:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;Plotter&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;.Plot(0.0, 1.0, 10.0, x =&amp;gt; &lt;span style="COLOR:#2b91af;"&gt;Math&lt;/span&gt;.Pow(x, 2));&lt;/span&gt;&lt;/p&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3" face="Calibri"&gt;Anda akan mendapati &lt;i style=""&gt;compile time error&lt;/i&gt; karena &lt;i style=""&gt;lambda expression&lt;/i&gt; dari C# itu adalah murni &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;Delegate&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3" face="Calibri"&gt;, sedangkan &lt;i style=""&gt;lambda expression&lt;/i&gt; di F# adalah bertipe &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;FastFunc&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3" face="Calibri"&gt;. Untuk melakukan konversi, gunakan fungsi &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;ToFastFunc&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3" face="Calibri"&gt; dari class &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;FuncConvert&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt; sehingga perintah menjadi:&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; &lt;p&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;Plotter&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;.Plot(0.0, 1.0, 10.0, &lt;span style="COLOR:#2b91af;"&gt;FuncConvert&lt;/span&gt;.ToFastFunc(&lt;span style="COLOR:blue;"&gt;new&lt;/span&gt; &lt;span style="COLOR:#2b91af;"&gt;Converter&lt;/span&gt;&amp;lt;&lt;span style="COLOR:blue;"&gt;double&lt;/span&gt;, &lt;span style="COLOR:blue;"&gt;double&lt;/span&gt;&amp;gt;(x =&amp;gt; &lt;span style="COLOR:#2b91af;"&gt;Math&lt;/span&gt;.Pow(x, 2))));&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Atau biar lebih &lt;i style=""&gt;seamless&lt;/i&gt;, anda dapat membuat &lt;i style=""&gt;extension method&lt;/i&gt; seperti ini:&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR:blue;FONT-SIZE:10pt;"&gt;public&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; &lt;span style="COLOR:blue;"&gt;static&lt;/span&gt; &lt;span style="COLOR:#2b91af;"&gt;FastFunc&lt;/span&gt;&amp;lt;T, TResult&amp;gt; ToFastFunc&amp;lt;T, TResult&amp;gt;(&lt;span style="COLOR:blue;"&gt;this&lt;/span&gt; &lt;span style="COLOR:#2b91af;"&gt;Func&lt;/span&gt;&amp;lt;T, TResult&amp;gt; func)&lt;br /&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;{&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR:blue;"&gt;return&lt;/span&gt; &lt;span style="COLOR:#2b91af;"&gt;FuncConvert&lt;/span&gt;.ToFastFunc(&lt;span style="COLOR:blue;"&gt;new&lt;/span&gt; &lt;span style="COLOR:#2b91af;"&gt;Converter&lt;/span&gt;&amp;lt;T, TResult&amp;gt;(func));&lt;br /&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;}&lt;br style=""/&gt;&lt;br style=""/&gt;&lt;/span&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;Func&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;&amp;lt;&lt;span style="COLOR:blue;"&gt;double&lt;/span&gt;,&lt;span style="COLOR:blue;"&gt;double&lt;/span&gt;&amp;gt; f = x =&amp;gt; &lt;span style="COLOR:#2b91af;"&gt;Math&lt;/span&gt;.Pow(x, 2);&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR:#2b91af;FONT-SIZE:10pt;"&gt;Plotter&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;.Plot(0.0, 1.0, 10.0, f.ToFastFunc());&lt;/span&gt; &lt;p&gt;&lt;span style="FONT-SIZE:11pt;"&gt;Pretty simple eh?&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/m71AWeUUDdQgXmE4Sk6ufVBEv5A/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/m71AWeUUDdQgXmE4Sk6ufVBEv5A/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/m71AWeUUDdQgXmE4Sk6ufVBEv5A/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/m71AWeUUDdQgXmE4Sk6ufVBEv5A/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=WnpZXscwxBg:odLPBtnMS4o:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=WnpZXscwxBg:odLPBtnMS4o:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=WnpZXscwxBg:odLPBtnMS4o:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=WnpZXscwxBg:odLPBtnMS4o:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=WnpZXscwxBg:odLPBtnMS4o:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=WnpZXscwxBg:odLPBtnMS4o:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=WnpZXscwxBg:odLPBtnMS4o:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/planet_fsharp/~4/WnpZXscwxBg" height="1" width="1"/&gt;</description>
      <link>http://geeks.netindonesia.net/blogs/fuehrerx/archive/2009/11/29/fun-tional-programming-currying-di-c.aspx</link>
      <pubDate>Sat, 28 Nov 2009 21:48:00 GMT</pubDate>
    </item>
    <item>
      <title>Working on F# with NDepend</title>
      <description>&lt;p&gt;Following up from the &lt;a rel="nofollow" target="_blank" href="http://stevegilham.blogspot.com/2009/11/ndepend-belated-kicking-tyres-review.html"&gt;earlier post here&lt;/a&gt;, looking more in depth at some of the results out of NDepend for my own little code quality project, and in addition to the results noted there&lt;/p&gt;
&lt;p&gt;First out of the gate, for sanity's sake, when working with F#, it would make sense to add &lt;code&gt;!HasAttribute OPTIONAL:System.Runtime.CompilerServices.CompilerGeneratedAttribute&lt;/code&gt; onto every rule. That way, you are not left to contemplate how and why the generated &lt;code&gt;&lt;a rel="nofollow" target="_blank" href="http://stevegilham.blogspot.com/2009/11/f-under-covers-x-curious-case-of-record.html"&gt;CompareTo&lt;/a&gt;&lt;/code&gt; methods on a simple record type &lt;/p&gt;
&lt;pre&gt;type Context = { Line : int; Column : int; EndLine : int; EndColumn : int }&lt;/pre&gt;
&lt;p&gt;can have an IL Cyclomatic complexity of 43.&lt;/p&gt;
&lt;p&gt;A similar blanket exclusion should be applied to types whose names contain the sigil &lt;code&gt;@&lt;/code&gt; marking them as generated function objects. Unfortunately, compiler inserted write-once local variables do not have any such distinctive sigils by which they can be filtered, just unexciting normal names like &lt;code&gt;str&lt;/code&gt;, &lt;code&gt;str2&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;span style="font-style:italic;"&gt;It would be nice if&lt;/span&gt; the &lt;code&gt;HasAttribute&lt;/code&gt; condition also allowed you to filter on properties of the attributes like &lt;code&gt;!HasAttribute OPTIONAL:Microsoft.FSharp.Core.CompilationMappingAttribute WITH (SourceConstructFlags &amp; 31 == 1) OR (SourceConstructFlags &amp; 31 == 2)&lt;/code&gt; -- to filter record or sum types, which are rich in generated structure, where appropriate. For example, though the sum type&lt;/p&gt;
&lt;pre&gt;// After the Haskell type
type internal Either&amp;lt;'a, 'b&amp;gt; = | Left of 'a | Right of 'b&lt;/pre&gt;
&lt;p&gt;may be implemented into the CLR by making &lt;code&gt;Either&amp;lt;'a, 'b&amp;gt;&lt;/code&gt; an abstract type with concrete inner types &lt;code&gt;Either&amp;lt;'a, 'b&amp;gt;+Left&lt;/code&gt; and &lt;code&gt;Either&amp;lt;'a, 'b&amp;gt;+Right&lt;/code&gt;, the headline &lt;code&gt;Either&amp;lt;'a, 'b&amp;gt;&lt;/code&gt; type is not an abstract base class in the usual sense, that user written code will be expected to extend the type.&lt;/p&gt;
&lt;p&gt;Similarly, while it is arguably an oversight of the F# code generation that none of the inner types within a sum type are marked as &lt;code&gt;sealed&lt;/code&gt; -- there is no good case for extending them -- &lt;span style="font-style:italic;"&gt;it would also be nice to&lt;/span&gt; be able to exclude all (implicitly, generated) types that derived from (or are an inner type of) a sum or record type from analysis; as well as all the content of types attributed with &lt;code&gt; [CompilationMapping(SourceConstructFlags.NonpublicRepresentation | ...)]&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Allowing names of the form &lt;code&gt;|ActivePattern|_|&lt;/code&gt; is a trivial extension of the "names should be upper case" rule.&lt;/p&gt;
&lt;p&gt;There is what &lt;span style="font-style:italic;"&gt;looks like a bug&lt;/span&gt; in NDepend's analysis as it manages to make all the types I have derived from &lt;code&gt;Microsoft.FxCop.Sdk.BaseIntrospectionRule&lt;/code&gt; pass the filter&lt;/p&gt;
&lt;pre class="code"&gt;DepthOfInheritance == 1 // Must derive directly from System.Object&lt;/pre&gt;
&lt;p&gt;The containing rule for that test &lt;code&gt;Classes that are candidate to be turned into Structures&lt;/code&gt; could probably also benefit from having &lt;code&gt;AND !IsStatic&lt;/code&gt; added, so as to exempt functional modules.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5569894-8849093049242812868?l=stevegilham.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;p&gt;&lt;a rel="nofollow" target="_blank" href="http://www.pheedo.com/click.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1259438340"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1259438340" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/txafV0MwkpjqMP9Yu4H2QVsiIUI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/txafV0MwkpjqMP9Yu4H2QVsiIUI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/txafV0MwkpjqMP9Yu4H2QVsiIUI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/txafV0MwkpjqMP9Yu4H2QVsiIUI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=EcKNljcmwcg:DnibgkvEhEg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=EcKNljcmwcg:DnibgkvEhEg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=EcKNljcmwcg:DnibgkvEhEg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=EcKNljcmwcg:DnibgkvEhEg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=EcKNljcmwcg:DnibgkvEhEg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=EcKNljcmwcg:DnibgkvEhEg:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=EcKNljcmwcg:DnibgkvEhEg:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/planet_fsharp/~4/EcKNljcmwcg" height="1" width="1"/&gt;</description>
      <link>http://stevegilham.blogspot.com/2009/11/working-on-f-with-ndepend.html</link>
      <author>Steve</author>
      <pubDate>Sat, 28 Nov 2009 03:59:00 GMT</pubDate>
    </item>
    <item>
      <title>F# related job at Future Social Experiences (FUSE) Lab UK</title>
      <description>&lt;p&gt;&lt;font size="3" face="Calibri"&gt;Are you interested in using probabilistic techniques to analyze online data and build new social experiences around it? The FUSE group&amp;nbsp;located at Microsoft Research in Cambridge is&amp;nbsp;hiring. The group use F# a&amp;nbsp;lot and have applied it successfully on many projects.&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 0pt 36pt;" class="MsoNormal"&gt;&lt;a rel="nofollow" target="_blank" href="https://careers.microsoft.com/JobDetails.aspx?jid=9575"&gt;https://careers.microsoft.com/JobDetails.aspx?jid=9575&lt;/a&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 0pt 36pt;" class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 0pt 36pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;&lt;em&gt;The Future Social Experiences (FUSE) Lab UK team is a newly founded group co-located with Microsoft Research Cambridge. It will focus on new social experiences in Microsoft’s Online Services through computational intelligence technologies and through exploitation, combination and analysis of available data sources within and outside of Microsoft. In addition, the team’s charter is to bridge between Microsoft Research Cambridge, FUSE Labs, and Microsoft’s Online Services teams, including teams in Search, Ads &amp;amp; Portal in the Online Services Division (“Information Seekers”), teams in Office &amp;amp; SharePoint in Microsoft Business Division (“Information Workers”) and teams in Xbox Live and Window Mobile in the Entertainment and Devices Division (“Gamers and Mobile Workers”). &lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 0pt 36pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;&lt;em&gt;&amp;nbsp;&lt;/em&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p style="MARGIN:0cm 0cm 0pt 36pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;&lt;em&gt;We are looking for mathematically astute, online-savvy applied researchers and developers. Necessary skills for this position include:&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 0pt 72pt;" class="MsoListParagraph"&gt;&lt;em&gt;&lt;span style="FONT-FAMILY:Wingdings;"&gt;&lt;span style=""&gt;&lt;font size="3"&gt;Ø&lt;/font&gt;&lt;span style="FONT:7pt 'Times New Roman';"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;Fit within an applied and basic research lab&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 0pt 72pt;" class="MsoListParagraph"&gt;&lt;em&gt;&lt;span style="FONT-FAMILY:Wingdings;"&gt;&lt;span style=""&gt;&lt;font size="3"&gt;Ø&lt;/font&gt;&lt;span style="FONT:7pt 'Times New Roman';"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;Development experience in various programming languages, including C++, C#, Python, SQL, F# and JavaScript&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 0pt 72pt;" class="MsoListParagraph"&gt;&lt;em&gt;&lt;span style="FONT-FAMILY:Wingdings;"&gt;&lt;span style=""&gt;&lt;font size="3"&gt;Ø&lt;/font&gt;&lt;span style="FONT:7pt 'Times New Roman';"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;Familiarity with Windows design tools and frameworks&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 0pt 72pt;" class="MsoListParagraph"&gt;&lt;em&gt;&lt;span style="FONT-FAMILY:Wingdings;"&gt;&lt;span style=""&gt;&lt;font size="3"&gt;Ø&lt;/font&gt;&lt;span style="FONT:7pt 'Times New Roman';"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;Development knowledge and experience of cloud applications and web services&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 0pt 72pt;" class="MsoListParagraph"&gt;&lt;em&gt;&lt;span style="FONT-FAMILY:Wingdings;"&gt;&lt;span style=""&gt;&lt;font size="3"&gt;Ø&lt;/font&gt;&lt;span style="FONT:7pt 'Times New Roman';"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;Ability to build &lt;/font&gt;&lt;/em&gt;&lt;a rel="nofollow" target="_blank" href="http://en.wikipedia.org/wiki/Software_prototyping#Throwaway_prototyping"&gt;&lt;font color="#0000ff" size="3" face="Calibri"&gt;&lt;em&gt;throw-away/rapid prototypes&lt;/em&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 0pt 36pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;&lt;em&gt;The successful candidate will be working in a small, dynamic and fun&amp;nbsp;team reporting directly to the director of FUSE Labs UK. &lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 0pt 36pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;&lt;em&gt;&amp;nbsp;&lt;/em&gt;&lt;/font&gt;&lt;/p&gt; 
&lt;p style="MARGIN:0cm 0cm 0pt 36pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;If you are interested or require further information, please contact &lt;b&gt;Ruth Lenton&lt;/b&gt; at &lt;/font&gt;&lt;a rel="nofollow" target="_blank" href="mailto:cambhr@microsoft.com"&gt;&lt;b&gt;&lt;font color="#0000ff" size="3" face="Calibri"&gt;cambhr@microsoft.com&lt;/font&gt;&lt;/b&gt;&lt;/a&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;.&lt;b&gt; &lt;/b&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9929535" width="1" height="1"&gt;&lt;p&gt;&lt;a rel="nofollow" target="_blank" href="http://www.pheedo.com/click.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1259365440"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1259365440" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/9skZzuNKiwErtcjU_lIpJ-8DueI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9skZzuNKiwErtcjU_lIpJ-8DueI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/9skZzuNKiwErtcjU_lIpJ-8DueI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9skZzuNKiwErtcjU_lIpJ-8DueI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=WGiUNWxjMZc:iFMjrHyPd7Q:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=WGiUNWxjMZc:iFMjrHyPd7Q:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=WGiUNWxjMZc:iFMjrHyPd7Q:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=WGiUNWxjMZc:iFMjrHyPd7Q:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=WGiUNWxjMZc:iFMjrHyPd7Q:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=WGiUNWxjMZc:iFMjrHyPd7Q:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=WGiUNWxjMZc:iFMjrHyPd7Q:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/planet_fsharp/~4/WGiUNWxjMZc" height="1" width="1"/&gt;</description>
      <link>http://blogs.msdn.com/dsyme/archive/2009/11/27/f-related-job-at-future-social-experiences-fuse-lab-uk.aspx</link>
      <author>dsyme</author>
      <pubDate>Fri, 27 Nov 2009 07:44:00 GMT</pubDate>
    </item>
    <item>
      <title>Custom Stack</title>
      <description>This post describes the F# implementation of the custom stack from Chris Okasaki&amp;#8217;s &amp;#8220;Purely functional data structures&amp;#8221;. namespace PurelyFunctionalDataStructures module CustomStack = type t&amp;#60;'a&amp;#62; = &amp;#124; Nil &amp;#124; Cons of ('a * t&amp;#60;'a&amp;#62;) let empty = Nil let isEmpty = function Nil -&amp;#62; true &amp;#124; _ -&amp;#62; false [...] &lt;div id="related-posts"&gt; &lt;h3&gt;And also &amp;hellip;&lt;/h3&gt; &lt;ul&gt; &lt;li&gt;&lt;a rel="nofollow" target="_blank" href="http://lepensemoi.free.fr/index.php/2009/11/24/purely-functional-data-structures-in-f-introduction"&gt;Purely functional data structures in F# &amp;#8211; introduction&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a rel="nofollow" target="_blank" href="http://lepensemoi.free.fr/index.php/2009/10/15/trie-and-anagrams-with-f"&gt;Tries and Anagrams with F#&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a rel="nofollow" target="_blank" href="http://lepensemoi.free.fr/index.php/2009/10/27/an-immutable-queue-library-in-f"&gt;An immutable queue library in F#&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;
&lt;/div&gt;&lt;p&gt;&lt;a rel="nofollow" target="_blank" href="http://www.pheedo.com/click.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1259276411"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1259276411" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/lH8cFZSn6htoVAcP7cU5FIn_Tvo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lH8cFZSn6htoVAcP7cU5FIn_Tvo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/lH8cFZSn6htoVAcP7cU5FIn_Tvo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lH8cFZSn6htoVAcP7cU5FIn_Tvo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=-K-Opnf_z_s:gXgiczqbToc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=-K-Opnf_z_s:gXgiczqbToc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=-K-Opnf_z_s:gXgiczqbToc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=-K-Opnf_z_s:gXgiczqbToc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=-K-Opnf_z_s:gXgiczqbToc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=-K-Opnf_z_s:gXgiczqbToc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=-K-Opnf_z_s:gXgiczqbToc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/planet_fsharp/~4/-K-Opnf_z_s" height="1" width="1"/&gt;</description>
      <link>http://lepensemoi.free.fr/index.php/2009/11/27/custom-stack</link>
      <pubDate>Thu, 26 Nov 2009 07:00:11 GMT</pubDate>
    </item>
    <item>
      <title>F# under the covers XI -- Literal expressions that aren't; attributes that don't</title>
      <description>&lt;p&gt;Consider the following simple C# property&lt;/p&gt;
&lt;pre&gt;public static FileShare get_Options()
{ return (FileShare.Delete | FileShare.Write);
}&lt;/pre&gt;
&lt;p&gt;This compiles in debug mode to &lt;/p&gt;
&lt;pre&gt;.method public hidebysig specialname static valuetype [mscorlib]System.IO.FileShare get_Options() cil managed
{ .maxstack 1 .locals init ( [0] valuetype [mscorlib]System.IO.FileShare CS$1$0000) L_0000: nop L_0001: ldc.i4.6 L_0002: stloc.0 L_0003: br.s L_0005 L_0005: ldloc.0 L_0006: ret }&lt;/pre&gt;
&lt;p&gt;which assigns the literal result -- 6 -- of the expression to the temporary that is then returned. The analogous F# method&lt;/p&gt;
&lt;pre&gt; static member Options with get() = System.IO.FileShare.Delete ||| System.IO.FileShare.Write&lt;/pre&gt;
&lt;p&gt;or equivalently&lt;/p&gt;
&lt;pre&gt; static member Options = System.IO.FileShare.Write ||| System.IO.FileShare.Delete&lt;/pre&gt;
&lt;p&gt;compiles to IL which preserves the expression to execute only at run time:&lt;/p&gt;
&lt;pre&gt;.method public specialname static valuetype [mscorlib]System.IO.FileShare get_Options() cil managed
{ .maxstack 4 L_0000: nop L_0001: ldc.i4.2 L_0002: ldc.i4.4 L_0003: or L_0004: ret }&lt;/pre&gt;
&lt;p&gt;which makes static analysis of the code in the more usually analysed state a rather more complicated business.&lt;/p&gt;
&lt;p&gt;Another complicating factor is that while this syntax &lt;/p&gt;
&lt;pre&gt; [&amp;lt;CoverageExemption( Points = 1, Justification = "Code generated is not a Literal")&amp;gt;] static member Options = System.IO.FileShare.Write ||| System.IO.FileShare.Delete&lt;/pre&gt;
&lt;p&gt;builds, it attaches the attribute (with &lt;code&gt;Method&lt;/code&gt; and &lt;code&gt;Constructor&lt;/code&gt; usage only) to the property as a whole; and not the generated &lt;code&gt;get_Options&lt;/code&gt; method, as in&lt;/p&gt;
&lt;pre&gt;[CoverageExemption(Points=1, Justification="Code generated is not a Literal")]
public static FileShare Options
{ get { return (FileShare.Write | FileShare.Delete); }
}&lt;/pre&gt;
&lt;p&gt;What I'd like to express, and what I've not found a way to express, is&lt;/p&gt;
&lt;pre&gt;public static FileShare Options
{ [CoverageExemption(Points=1, Justification="Code generated is not a Literal")] get { return (FileShare.Write | FileShare.Delete); }
}&lt;/pre&gt;
&lt;p&gt;and &lt;a rel="nofollow" target="_blank" href="http://msdn.microsoft.com/en-us/library/dd483467%28VS.100%29.aspx"&gt;MSDN remains opaque on the subject&lt;/a&gt; as well.&lt;/p&gt;
&lt;p&gt;This is something I could code around, but I can't yet see a clean way of doing to allow separate attributes on the getters and the setters.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Later&lt;/b&gt;: The &lt;span style="font-style:italic;"&gt;intended&lt;/span&gt; syntax for this option is, much as you might expect, this:&lt;/p&gt;
&lt;pre&gt; static member Options with [&amp;lt;CoverageExemption( Points = 1, Justification = "Code generated is not a Literal")&amp;gt;] get() = System.IO.FileShare.Write ||| System.IO.FileShare.Delete&lt;/pre&gt;
&lt;p&gt;with the necessary insets as shown (to avoid error &lt;code&gt;FS0010: Incomplete structured construct at or before this point in pattern&lt;/code&gt;), however on filing a bug report I got confirmation that it is a known issue with the Beta 2 release (aka October 2009 CTP), that this still decorates the property and not just the getter.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5569894-3786544091288004082?l=stevegilham.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;p&gt;&lt;a rel="nofollow" target="_blank" href="http://www.pheedo.com/click.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1259260680"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1259260680" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/tgG-qDfA_M0hifUVB07ORh2xXHg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tgG-qDfA_M0hifUVB07ORh2xXHg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/tgG-qDfA_M0hifUVB07ORh2xXHg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tgG-qDfA_M0hifUVB07ORh2xXHg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=gNoBmnEYD2E:zbBhFlopXZA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=gNoBmnEYD2E:zbBhFlopXZA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=gNoBmnEYD2E:zbBhFlopXZA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=gNoBmnEYD2E:zbBhFlopXZA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=gNoBmnEYD2E:zbBhFlopXZA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=gNoBmnEYD2E:zbBhFlopXZA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=gNoBmnEYD2E:zbBhFlopXZA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/planet_fsharp/~4/gNoBmnEYD2E" height="1" width="1"/&gt;</description>
      <link>http://stevegilham.blogspot.com/2009/11/f-under-covers-xi-literal-expressions.html</link>
      <author>Steve</author>
      <pubDate>Thu, 26 Nov 2009 02:38:00 GMT</pubDate>
    </item>
    <item>
      <title>Using Erlang-style message passing from F# to coordinate asynchronous tasks in AutoCAD</title>
      <description>&lt;p&gt;&lt;a rel="nofollow" target="_blank" href="http://www.pheedo.com/click.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1259258498"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1259258498" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/LripCNWbyK94enR5pbaPDilcq5A/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LripCNWbyK94enR5pbaPDilcq5A/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/LripCNWbyK94enR5pbaPDilcq5A/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LripCNWbyK94enR5pbaPDilcq5A/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=EjsUgtIEif0:f804WmKRaoU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=EjsUgtIEif0:f804WmKRaoU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=EjsUgtIEif0:f804WmKRaoU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=EjsUgtIEif0:f804WmKRaoU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=EjsUgtIEif0:f804WmKRaoU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=EjsUgtIEif0:f804WmKRaoU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=EjsUgtIEif0:f804WmKRaoU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/planet_fsharp/~4/EjsUgtIEif0" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/typepad/walmsleyk/through_the_interface/~3/kcoSJTFZOlk/using-erlang-style-message-passing-from-f-to-coordinate-asynchronous-tasks-in-autocad.html</link>
      <author>Kean Walmsley</author>
      <pubDate>Thu, 26 Nov 2009 02:01:38 GMT</pubDate>
    </item>
    <item>
      <title>Simple spelling corrector in F#</title>
      <description>This post is based on Peter Norvig&amp;#8217;s How to write a spelling corrector, which is written in Python. His spell-checker ranks word-substitution candidates by their frequency in the language as determined by parsing some sources. He then gives different ways
which could help make his algorithm more effective, such as taking the context into account (using n-grams).
The [...] &lt;div id="related-posts"&gt; &lt;h3&gt;And also &amp;hellip;&lt;/h3&gt; &lt;ul&gt; &lt;li&gt;&lt;a rel="nofollow" target="_blank" href="http://lepensemoi.free.fr/index.php/2008/04/22/redimensionneur-dimages"&gt;Batch image resizer&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a rel="nofollow" target="_blank" href="http://lepensemoi.free.fr/index.php/2009/10/25/a-bit-array-or-bitset-library-in-f"&gt;A bit array (or bitset) library in F#&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a rel="nofollow" target="_blank" href="http://lepensemoi.free.fr/index.php/2009/11/15/technical-analysis-indicators-in-f-part-iii"&gt;Technical analysis indicators in F# – Part III&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;
&lt;/div&gt;&lt;p&gt;&lt;a rel="nofollow" target="_blank" href="http://www.pheedo.com/click.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1259249681"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1259249681" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/d4lGLQcKpUqRFC9LOftAlK9JWWc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/d4lGLQcKpUqRFC9LOftAlK9JWWc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/d4lGLQcKpUqRFC9LOftAlK9JWWc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/d4lGLQcKpUqRFC9LOftAlK9JWWc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=iGkp0IKeLic:h3SDvpHQ4MM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=iGkp0IKeLic:h3SDvpHQ4MM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=iGkp0IKeLic:h3SDvpHQ4MM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=iGkp0IKeLic:h3SDvpHQ4MM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=iGkp0IKeLic:h3SDvpHQ4MM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=iGkp0IKeLic:h3SDvpHQ4MM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=iGkp0IKeLic:h3SDvpHQ4MM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/planet_fsharp/~4/iGkp0IKeLic" height="1" width="1"/&gt;</description>
      <link>http://lepensemoi.free.fr/index.php/2009/11/26/simple-spelling-corrector-in-f</link>
      <pubDate>Wed, 25 Nov 2009 23:34:41 GMT</pubDate>
    </item>
    <item>
      <title>Generating an IObservable from an IEvent in F#</title>
      <description>&lt;p&gt;Yesterday I showed how we can &lt;a rel="nofollow" target="_blank" href="http://www.navision-blog.de/2009/11/23/mapping-the-reactive-framework-rx-operators-for-f/"&gt;map some of the Rx operators to an API which looks more like the F# base classes&lt;/a&gt;. Today I wanted to use these mapped operators in a WPF-application written in F#. &lt;/p&gt;
&lt;p&gt;F# gives us a nice way to use events as first class citizen (via IEvent) but these events implement their own version of IObservable&amp;lt;T&amp;gt; (in FSharp.Core.dll), which is unfortunately incompatible with the Rx version and therefore with the mapped API.&lt;/p&gt;
&lt;p&gt;The solution I found is to wrap the F# IEvent with a Rx IObservable&amp;lt;T&amp;gt;:&lt;/p&gt;
&lt;div style="font-family:courier new;background:white;color:black;font-size:10pt;"&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:green;"&gt;/// Generates an observable from an IEvent&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;let&lt;/span&gt; fromEvent (event:IEvent&amp;lt;_,_&amp;gt;) =&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;#160; Observable.Context &lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;- SynchronizationContexts.CurrentDispatcher&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;#160; Observable.Create&amp;lt;_&amp;gt;(&lt;span style="color:blue;"&gt;fun&lt;/span&gt; x &lt;span style="color:blue;"&gt;-&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160; event.Subscribe(&lt;span style="color:blue;"&gt;fun&lt;/span&gt; args &lt;span style="color:blue;"&gt;-&amp;gt;&lt;/span&gt; x.OnNext(args))&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; |&amp;gt; ignore&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;new&lt;/span&gt; System.Action(&lt;span style="color:blue;"&gt;fun&lt;/span&gt; () &lt;span style="color:blue;"&gt;-&amp;gt;&lt;/span&gt; ()))&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Now we are able to use the WPF events as observables:&lt;/p&gt;
&lt;div style="font-family:courier new;background:white;color:black;font-size:10pt;"&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:green;"&gt;// Register ListBox Commands&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;listBox1.KeyDown&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;#160; |&amp;gt; Observable.fromEvent&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;#160; |&amp;gt; Observable.filter (&lt;span style="color:blue;"&gt;fun&lt;/span&gt; args &lt;span style="color:blue;"&gt;-&amp;gt;&lt;/span&gt; args.Key = Key.Delete)&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;#160; |&amp;gt; Observable.subscribe deleteElement&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;I am interested if someone has a different and maybe better solution to this problem.&lt;/p&gt;
&lt;p&gt;&amp;copy;2009 &lt;a rel="nofollow" target="_blank" href="http://www.navision-blog.de"&gt;Rash thoughts about .NET, C#, F# and Dynamics NAV.&lt;/a&gt;. All Rights Reserved.&lt;/p&gt;.&lt;p&gt;&lt;a rel="nofollow" target="_blank" href="http://www.pheedo.com/click.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1259062769"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1259062769" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MxesT8Dh6LdioOgT1mg1Mvn1iZY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MxesT8Dh6LdioOgT1mg1Mvn1iZY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/MxesT8Dh6LdioOgT1mg1Mvn1iZY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MxesT8Dh6LdioOgT1mg1Mvn1iZY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=ITEHcohaFGk:B1RP_pyfhoc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=ITEHcohaFGk:B1RP_pyfhoc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=ITEHcohaFGk:B1RP_pyfhoc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=ITEHcohaFGk:B1RP_pyfhoc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=ITEHcohaFGk:B1RP_pyfhoc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=ITEHcohaFGk:B1RP_pyfhoc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=ITEHcohaFGk:B1RP_pyfhoc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/planet_fsharp/~4/ITEHcohaFGk" height="1" width="1"/&gt;</description>
      <link>http://www.navision-blog.de/2009/11/24/generating-an-iobservablet-from-an-ievent-in-f/</link>
      <pubDate>Mon, 23 Nov 2009 19:39:29 GMT</pubDate>
    </item>
    <item>
      <title>Purely functional data structures in F# – introduction</title>
      <description>This is the first of a series of posts relating to Chris Okasaki&amp;#8217;s &amp;#8220;Purely functional data structures&amp;#8221; (see his thesis, and his book).
Note : the code given in his aforementionned book assumes much more laziness than will be used in the coming examples, mainly for simplification purposes.
In the following piece of code, we shall only [...] &lt;div id="related-posts"&gt; &lt;h3&gt;And also &amp;hellip;&lt;/h3&gt; &lt;ul&gt; &lt;li&gt;&lt;a rel="nofollow" target="_blank" href="http://lepensemoi.free.fr/index.php/2009/11/27/custom-stack"&gt;Custom Stack&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a rel="nofollow" target="_blank" href="http://lepensemoi.free.fr/index.php/2009/10/15/trie-and-anagrams-with-f"&gt;Tries and Anagrams with F#&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a rel="nofollow" target="_blank" href="http://lepensemoi.free.fr/index.php/2009/10/27/an-immutable-queue-library-in-f"&gt;An immutable queue library in F#&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;
&lt;/div&gt;&lt;p&gt;&lt;a rel="nofollow" target="_blank" href="http://www.pheedo.com/click.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1259035313"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1259035313" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2l1B1n03E_bxAQ63mfzsuz-7Scw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2l1B1n03E_bxAQ63mfzsuz-7Scw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/2l1B1n03E_bxAQ63mfzsuz-7Scw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2l1B1n03E_bxAQ63mfzsuz-7Scw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=b_FgUNqkp6M:_7iM3VQbmmA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=b_FgUNqkp6M:_7iM3VQbmmA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=b_FgUNqkp6M:_7iM3VQbmmA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=b_FgUNqkp6M:_7iM3VQbmmA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=b_FgUNqkp6M:_7iM3VQbmmA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=b_FgUNqkp6M:_7iM3VQbmmA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=b_FgUNqkp6M:_7iM3VQbmmA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/planet_fsharp/~4/b_FgUNqkp6M" height="1" width="1"/&gt;</description>
      <link>http://lepensemoi.free.fr/index.php/2009/11/24/purely-functional-data-structures-in-f-introduction</link>
      <pubDate>Mon, 23 Nov 2009 12:01:53 GMT</pubDate>
    </item>
    <item>
      <title>Source Code for Programming F#</title>
      <description>&lt;p&gt;I've gotten a few requests recently for the source code of the examples in &lt;a rel="nofollow" title="Programming F#" target="_blank" href="http://www.amazon.com/Programming-Animal-Guide-Chris-Smith/dp/0596153643"&gt;Programming F#&lt;/a&gt;. I've attached them as a series of &lt;a rel="nofollow" title="F# Script" target="_blank" href="http://blogs.msdn.com/chrsmith/archive/2008/09/12/scripting-in-f.aspx"&gt;F# Script&lt;/a&gt;&amp;nbsp;files. In the ZIP file you'll find a few gems such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A 'state' computation expression&lt;/li&gt;
&lt;li&gt;Examples of F# Asynchronous Workflows and the Parallel Extensions to .NET&lt;/li&gt;
&lt;li&gt;References for writing OO code in F#, including advanced stuff like Delegates and Events&lt;/li&gt;
&lt;li&gt;Code for F# interop such as P/Invoke signatures&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;And as always, any code released on this blog it comes with the standard disclaimer:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;All code samples are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. So in other words, if the attached source files cause you any grief whatsoever you can’t blame me, O'Reilly Media,&amp;nbsp;or Microsoft.&lt;/p&gt;&lt;/blockquote&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9927678" width="1" height="1"&gt;&lt;p&gt;&lt;a rel="nofollow" target="_blank" href="http://www.pheedo.com/click.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1259028540"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1259028540" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/aCWaqARPUj7JhiHN4Q7tqWBv4FI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aCWaqARPUj7JhiHN4Q7tqWBv4FI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/aCWaqARPUj7JhiHN4Q7tqWBv4FI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aCWaqARPUj7JhiHN4Q7tqWBv4FI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=4LFpghc7AHw:QAT_neOUlkk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=4LFpghc7AHw:QAT_neOUlkk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=4LFpghc7AHw:QAT_neOUlkk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=4LFpghc7AHw:QAT_neOUlkk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=4LFpghc7AHw:QAT_neOUlkk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=4LFpghc7AHw:QAT_neOUlkk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=4LFpghc7AHw:QAT_neOUlkk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/planet_fsharp/~4/4LFpghc7AHw" height="1" width="1"/&gt;</description>
      <link>http://blogs.msdn.com/chrsmith/archive/2009/11/23/source-code-for-programming-f.aspx</link>
      <pubDate>Mon, 23 Nov 2009 10:09:00 GMT</pubDate>
    </item>
    <item>
      <title>My PDC session is online - “Future directions for C# and Visual Basic”</title>
      <description>&lt;p&gt;In case you are training to play the part of a first generation Italian immigrant in a Broadway show or if you want to understand why I never short msft stock: &lt;a rel="nofollow" title="http://microsoftpdc.com/Sessions/FT11" target="_blank" href="http://microsoftpdc.com/Sessions/FT11"&gt;http://microsoftpdc.com/Sessions/FT11&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9927546" width="1" height="1"&gt;&lt;p&gt;&lt;a rel="nofollow" target="_blank" href="http://www.pheedo.com/click.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1259011064"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1259011064" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ldWbvRvRKWVzuY1L69X2JCWMHT4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ldWbvRvRKWVzuY1L69X2JCWMHT4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ldWbvRvRKWVzuY1L69X2JCWMHT4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ldWbvRvRKWVzuY1L69X2JCWMHT4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=4YsHgXaFGtM:VfR7LUBeZs8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=4YsHgXaFGtM:VfR7LUBeZs8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=4YsHgXaFGtM:VfR7LUBeZs8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=4YsHgXaFGtM:VfR7LUBeZs8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=4YsHgXaFGtM:VfR7LUBeZs8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=4YsHgXaFGtM:VfR7LUBeZs8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=4YsHgXaFGtM:VfR7LUBeZs8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/planet_fsharp/~4/4YsHgXaFGtM" height="1" width="1"/&gt;</description>
      <link>http://blogs.msdn.com/lucabol/archive/2009/11/23/my-pdc-session-is-online-future-directions-for-c-and-visual-basic.aspx</link>
      <pubDate>Mon, 23 Nov 2009 05:17:44 GMT</pubDate>
    </item>
    <item>
      <title>Book Review: Debug It! (Paul Butcher, Pragmatic Bookshelf)</title>
      <description>&lt;p&gt;
Paul asked me to review this, his first book, and my comment to him was that he had
a pretty high bar to match; being of the same "series" as &lt;em&gt;Release It!&lt;/em&gt;,
Mike Nygard's take on building software ready for production (and, in my repeatedly
stated opinion, the most important-to-read book of the decade), &lt;em&gt;Debug It!&lt;/em&gt; had
some pretty impressive shoes to fill. Paul's comment was pretty predictable: "Thanks
for keeping the pressure to a minimum."
&lt;/p&gt;
&lt;p&gt;
My copy arrived in the mail while I was at the NFJS show in Denver this past weekend,
and with a certain amount of dread and excitement, I opened the envelope and sat down
to read for a few minutes. I managed to get halfway through it before deciding I had
to post a review before I get too caught up in my next trip and forget.
&lt;/p&gt;
&lt;h4&gt;&lt;em&gt;Short version&lt;/em&gt;
&lt;/h4&gt;
&lt;p&gt;
&lt;em&gt;Debug It!&lt;/em&gt; is a great resource for anyone looking to learn the science of
good debugging. It is entirely language- and platform-agnostic, preferring to focus
entirely on the &lt;em&gt;process&lt;/em&gt; and &lt;em&gt;mindset&lt;/em&gt; of debugging, rather than on
edge cases or command-line switches in a tool or language. Overall, the writing is
clear and straightforward without being preachy or judgmental, and is liberally annotated
with real-life case stories from both the authors' and the Pragmatic Programmers'
own history, which keeps the tone lighter and yet still proving the point of the text.
Highly recommended for the junior developers on the team; senior developers will likely
find some good tidbits in here as well. &lt;/p&gt;
&lt;h4&gt;&lt;em&gt;Long version&lt;/em&gt;
&lt;/h4&gt;
&lt;p&gt;
&lt;em&gt;Debug It!&lt;/em&gt; is an excellently-written and to-the-point description of the process
of not only identifying and fixing defects in software, but also of the attitudes
required to keep software from failing. Rather than simply tossing off old maxims
or warming them over with new terminology ("You should always verify the parameters
to your procedure calls" replaced with "You should always verify the parameters
entering a method and ensure the fields follow the invariants established in the specification"),
Paul ensures that when making a point, his prose is clear, the rationale carefully
explained, and the consequences of not following this advice are clearly spelled out.
His advice is pragmatic, and takes into account that developers can't always follow
the absolute rules we'd like to—he talks about some of his experiences with "bug
priorities" and how users pretty quickly figured out to always set the bug's
priority at the highest level in order to get developer attention, for example, and
some ways to try and address that all-too-human failing of bug-tracking systems.
&lt;/p&gt;
&lt;p&gt;
It needs to be said, right from the beginning, that &lt;em&gt;Debug It!&lt;/em&gt; will not teach
you how to use the debugging features of your favorite IDE, however. This is because
Paul (deliberately, it seems) takes a platform- and language-agnostic approach to
the book—there are no examples of how to set breakpoints in gdb, or how to attach
the Visual Studio IDE to a running Windows service, for example. This will likely
weed out those readers who are looking for "Google-able" answers to their
common debugging problems, and that's a shame, because those are probably the very
readers that need to read this book. Having said that, however, I like this agnostic
approach, because these ideas and thought processes, the ones that are entirely independent
of the language or platform, are exactly the kinds of things that senior developers
carry over with them from one platform to the next. Still, the junior developer who
picks this book up is going to still need a reference manual or the user manual for
their IDE or toolchain, and will need to practice some with both books in hand if
they want to maximize the effectiveness of what's in here.
&lt;/p&gt;
&lt;p&gt;
One of the things I like most about this book is that it is liberally adorned with
real-life discussions of various scenarios the author team has experienced; the reason
I say "author team" here is because although the stories (for the most part)
remain unattributed, there are obvious references to "Dave" and "Andy",
which I assume pretty obviously refer to Dave Thomas and Andy Hunt, the Pragmatic
Programmers and the owners of Pragmatic Bookshelf. Some of the stories are humorous,
and some of them probably would be humorous if they didn't strike so close to my own
bitterly-remembered experiences. All of them do a good job of reinforcing the point,
however, thus rendering the prose more effective in communicating the idea without
getting to be too preachy or bombastic.
&lt;/p&gt;
&lt;p&gt;
The book obviously intends to target a junior developer audience, because most senior
developers have already intuitively (or experientially) figured out many of the processes
described in here. But, quite frankly, I think it would be a shame for senior developers
to pass on this one; though the temptation will be to simply toss it aside and say,
"I already do all this stuff", senior developers should resist that urge
and read it through cover to cover. If nothing else, it'll help reinforce certain
ideas, bring some of the intuitive process more to light and allow us to analyze what
we do right and what we do wrong, and perhaps most importantly, give us a common backdrop
against which we can mentor junior developers in the science of debugging.
&lt;/p&gt;
&lt;p&gt;
One of the chapters I like in particular, "Chapter 7: Pragmatic Zero Tolerance",
is particularly good reading for those shops that currently suffer from a deficit
of management support for writing good software. In it, Paul talks specifically about
some of the triage process about bugs ("When to fix bugs"), the mental approach
developers should have to fixing bugs ("The debugging mind-set") and how
to get started on creating good software out of bad ("How to dig yourself out
of a quality hole"). These are techniques that a senior developer can bring to
the team and implement at a grass-roots level, in many cases without management even
being aware of what's going on. (It's a sad state of affairs that we sometimes have
to work behind management's back to write good-quality code, but I know that some
developers out there are in exactly that situation, and simply saying, "Quit
and find a new job", although pithy and good for a laugh on a panel, doesn't
really offer much in the way of help. Paul doesn't take that route here, and that
alone makes this book worth reading.)
&lt;/p&gt;
&lt;p&gt;
Another of the chapters that resonates well with me is the first one in Part III ("Debug
Fu"), Chapter 8, entitled "Special Cases", in which he tackles a number
of "advanced" debugging topics, such as "Patching Existing Releases"
and "Hesenbugs" (Concurrency-related bugs). I won't spoil the punchline
for you, but suffice it to say that I wish I'd had that chapter on hand to give out
to teammates on a few projects I've worked on in the past.
&lt;/p&gt;
&lt;p&gt;
Overall, this book is going to be a huge win, and I think it's a worthy successor
to the &lt;em&gt;Release It!&lt;/em&gt; reputation. Development managers and team leads should
get a copy for the junior developers on their team as a Christmas gift, but only after
the senior developers have read through it as well. (Senior devs, don't despair—at
190 pages, you can rip through this in a single night, and I can almost guarantee
that you'll learn a few ideas you can put into practice the next morning to boot.)
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blogs.tedneward.com/aggbug.ashx?id=d3b4c5aa-2964-492c-9af3-523cb403b444"/&gt;
&lt;br /&gt;
&lt;hr /&gt;
Enterprise consulting, mentoring or instruction. Java, C++, .NET or XML services.
1-day or multi-day workshops available. &lt;a rel="nofollow" target="_blank" href="mailto:ted@tedneward.com"&gt;Contact
me for details&lt;/a&gt;.&lt;p&gt;&lt;a rel="nofollow" target="_blank" href="http://www.pheedo.com/click.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1258961081"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1258961081" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/dGvh8EbWp-sXzAwioK1YkMQtGfE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dGvh8EbWp-sXzAwioK1YkMQtGfE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/dGvh8EbWp-sXzAwioK1YkMQtGfE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dGvh8EbWp-sXzAwioK1YkMQtGfE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=JJ4v-NXMZBk:uX52KeBXIaY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=JJ4v-NXMZBk:uX52KeBXIaY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=JJ4v-NXMZBk:uX52KeBXIaY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=JJ4v-NXMZBk:uX52KeBXIaY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=JJ4v-NXMZBk:uX52KeBXIaY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=JJ4v-NXMZBk:uX52KeBXIaY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=JJ4v-NXMZBk:uX52KeBXIaY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/planet_fsharp/~4/JJ4v-NXMZBk" height="1" width="1"/&gt;</description>
      <link>http://blogs.tedneward.com/2009/11/23/Book+Review+Debug+It+Paul+Butcher+Pragmatic+Bookshelf.aspx</link>
      <pubDate>Sun, 22 Nov 2009 15:24:41 GMT</pubDate>
    </item>
    <item>
      <title>F# Discoveries This Week 11/22/2009</title>
      <description>&lt;p&gt;Over this past week at PDC I was lucky enough to see some fantastic sessions and spend time with members of the F# and greater Visual Studio language teams.&amp;#160; Naturally, these experiences have left me both floored and swimming in new ideas.&amp;#160; This edition of Discoveries This Week includes both the very best of what I saw at PDC 2009 and the most outstanding things I’ve glimpsed going on in the F# community.&amp;#160; Please do enjoy.&lt;/p&gt; &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;h3&gt;Reflection on the PDC Keynotes&lt;/h3&gt; &lt;p&gt;For the most information in the shortest amount of time I suggest watching the &lt;a rel="nofollow" target="_blank" href="http://microsoftpdc.com/Sessions/KEY01"&gt;day one&lt;/a&gt; and &lt;a rel="nofollow" target="_blank" href="http://microsoftpdc.com/Sessions/KEY02"&gt;day two&lt;/a&gt; PDC keynotes.&amp;#160; They are both jam packed with exciting announcements and demos.&amp;#160; While at PDC I wrote about my experience watching these &lt;a rel="nofollow" target="_blank" href="http://www.atalasoft.com/cs/blogs/rickm/archive/2009/11/17/surprises-in-the-pdc09-keynote-open-source-open-platforms-and-the-democratization-of-data.aspx"&gt;here&lt;/a&gt; (day one) and &lt;a rel="nofollow" target="_blank" href="http://www.atalasoft.com/cs/blogs/rickm/archive/2009/11/18/pdc09-keynote-day-2-silverlight-4-0-and-free-laptops.aspx"&gt;here&lt;/a&gt; (day two).&lt;/p&gt; &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;h3&gt;&lt;a rel="nofollow" target="_blank" href="http://microsoftpdc.com/Sessions/FT52"&gt;Microsoft Perspectives on the Future of Programming&lt;/a&gt;&lt;/h3&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;Come hear from several of the Microsoft senior technical leaders about the future of programming, programming languages, and tools.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;If you watch just one PDC session let this be it.&amp;#160; &lt;/p&gt; &lt;p&gt;With Butler Lampson, Erik Meijer, Don Box, Jeffrey Snover, Herb Sutter, and Burton Smith, Microsoft’s best gathered to debate the future of programming in a twitter driven panel at PDC.&amp;#160; I was happy to be able to contribute with a question on type systems which erupted into quite a disagreement.&amp;#160; I will be writing about this session at length, and reflecting on my &lt;a rel="nofollow" target="_blank" href="http://www.atalasoft.com/cs/blogs/rickm/archive/2008/10/15/anders-hejlsberg-on-the-future-of-programming-languages.aspx"&gt;past thoughts about this topic&lt;/a&gt;, in the near future.&amp;#160; &lt;/p&gt; &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;h3&gt;Luke Hoban’s &lt;a rel="nofollow" target="_blank" href="http://microsoftpdc.com/Sessions/FT20"&gt;F# for Parallel and Asynchronous Programming&lt;/a&gt;&lt;/h3&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;F#, a functional and object-oriented language for Microsoft .NET, adds many tools to make parallel and asynchronous programming both fun and easy. Come hear the core concepts of the F# language, and see how ideas like immutability, functional design, async workflows, agents, and more can be used to meet the challenges of today’s real-world applications.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;By combining small, easily understood, ideas Luke constructs F#’s big picture in the most engaging way I’ve seen to date.&amp;#160; This is now my go to talk for people who are interested in, but new to, the F# programming language.&lt;/p&gt; &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;h3&gt;Jomo Fisher’s &lt;a rel="nofollow" target="_blank" href="http://blogs.msdn.com/jomo_fisher/archive/2009/11/17/f-scripting-net-4-0-and-mixed-mode-assemblies.aspx"&gt;F# Scripting, .NET 4.0 and Mixed-mode assemblies&lt;/a&gt;&lt;/h3&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;One of the recent problems we’ve seen is that, because of the support for side-by-side runtimes, .NET 4.0 has changed the way that it binds to older mixed-mode assemblies. These assemblies are, for example, those that are compiled from C++&amp;#92;CLI. Currently available DirectX assemblies are mixed mode.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;This clever approach to switching the F# REPL to 2.0 binding mode is particularly handy to know.&lt;/p&gt; &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;h3&gt;Matthew Moloney’s &lt;a rel="nofollow" target="_blank" href="http://www.mattssoftwareblog.com/?p=212"&gt;Collaborative Development Using F# Interactive&lt;/a&gt;&lt;/h3&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;This is a proof of concept of an interactive collaborative development environment I built using&amp;#160; F# Interactive. The aim here is to explore different ideas for further development, not so much as to present an alternative to Visual Studio.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;I couldn’t pass this very cool idea up.&amp;#160; I can’t help but think about extending this to full feldged explorative programming community websites.&lt;/p&gt; &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;h3&gt;Bart Czernicki’s &lt;a rel="nofollow" target="_blank" href="http://silverlighthack.com/post/2009/11/04/Silverlight-3-and-FSharp-Support-in-Visual-Studio-2010.aspx"&gt;Silverlight 3 and F# Support in Visual Studio 2010&lt;/a&gt;&lt;/h3&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;The goal of this blog post is to make you aware of F# support in Silverlight in Visual Studio 2010.&amp;#160; In addition, this blog post shows an example why F# is going to be very important for Silverlight architects and developers.&amp;#160; Note:&amp;#160; This is NOT an intro to F#.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;A great post.&amp;#160; I am always interested in seeing concrete examples of F# adding value to existing technologies and platforms.&amp;#160; I have a sneaking suspicion that there are very few places where it won’t.&lt;/p&gt;
&lt;div class="shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a rel="nofollow" target="_blank" href="mailto:?body=Thought you might like this: http://www.atalasoft.com/cs/blogs/rickm/archive/2009/11/22/discoveries-this-week-11-22-2009.aspx&amp;amp;;subject=F%23+Discoveries+This+Week+11%2f22%2f2009" title="Post http://www.atalasoft.com/cs/blogs/rickm/archive/2009/11/22/discoveries-this-week-11-22-2009.aspx"&gt;email it!&lt;/a&gt; | &lt;a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http://www.atalasoft.com/cs/blogs/rickm/archive/2009/11/22/discoveries-this-week-11-22-2009.aspx&amp;amp;;title=F%23+Discoveries+This+Week+11%2f22%2f2009" title="Post http://www.atalasoft.com/cs/blogs/rickm/archive/2009/11/22/discoveries-this-week-11-22-2009.aspx"&gt;bookmark it!&lt;/a&gt; | &lt;a rel="nofollow" target="_blank" href="http://www.digg.com/submit?url=http://www.atalasoft.com/cs/blogs/rickm/archive/2009/11/22/discoveries-this-week-11-22-2009.aspx&amp;amp;;phase=2" title="Post http://www.atalasoft.com/cs/blogs/rickm/archive/2009/11/22/discoveries-this-week-11-22-2009.aspx"&gt;digg it!&lt;/a&gt; | &lt;a rel="nofollow" target="_blank" href="http://reddit.com/submit?url=http://www.atalasoft.com/cs/blogs/rickm/archive/2009/11/22/discoveries-this-week-11-22-2009.aspx&amp;amp;title=F%23+Discoveries+This+Week+11%2f22%2f2009" title="Post http://www.atalasoft.com/cs/blogs/rickm/archive/2009/11/22/discoveries-this-week-11-22-2009.aspx"&gt;reddit!&lt;/a&gt; | &lt;a rel="nofollow" target="_blank" href="http://www.dotnetkicks.com/submit/?url=http://www.atalasoft.com/cs/blogs/rickm/archive/2009/11/22/discoveries-this-week-11-22-2009.aspx&amp;amp;;title=F%23+Discoveries+This+Week+11%2f22%2f2009" title="Post http://www.atalasoft.com/cs/blogs/rickm/archive/2009/11/22/discoveries-this-week-11-22-2009.aspx"&gt;kick it!&lt;/a&gt; | &lt;a rel="nofollow" target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.atalasoft.com/cs/blogs/rickm/archive/2009/11/22/discoveries-this-week-11-22-2009.aspx&amp;amp;;title=F%23+Discoveries+This+Week+11%2f22%2f2009&amp;amp;;top=1" title="Post http://www.atalasoft.com/cs/blogs/rickm/archive/2009/11/22/discoveries-this-week-11-22-2009.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.atalasoft.com/cs/aggbug.aspx?PostID=19754" width="1" height="1"&gt;&lt;p&gt;&lt;a rel="nofollow" target="_blank" href="http://www.pheedo.com/click.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1258933792"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1258933792" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/7u6-vkgSHHSXiUZHveAGcLD9bjg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7u6-vkgSHHSXiUZHveAGcLD9bjg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/7u6-vkgSHHSXiUZHveAGcLD9bjg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7u6-vkgSHHSXiUZHveAGcLD9bjg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=yFbH2ZE6I10:_xHglVD8IFM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=yFbH2ZE6I10:_xHglVD8IFM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=yFbH2ZE6I10:_xHglVD8IFM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=yFbH2ZE6I10:_xHglVD8IFM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=yFbH2ZE6I10:_xHglVD8IFM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=yFbH2ZE6I10:_xHglVD8IFM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=yFbH2ZE6I10:_xHglVD8IFM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/planet_fsharp/~4/yFbH2ZE6I10" height="1" width="1"/&gt;</description>
      <link>http://www.atalasoft.com/cs/blogs/rickm/archive/2009/11/22/discoveries-this-week-11-22-2009.aspx</link>
      <pubDate>Sun, 22 Nov 2009 07:49:52 GMT</pubDate>
    </item>
    <item>
      <title>F# -- a few notes and something to play with</title>
      <description>&lt;h4&gt;&lt;code&gt;Seq.take&amp;lt;'T&amp;gt;&lt;/code&gt;&lt;/h4&gt;
&lt;p&gt;While F# documentation is &lt;a rel="nofollow" target="_blank" href="http://msdn.microsoft.com/en-us/library/ee353567%28VS.100%29.aspx"&gt;there on MSDN&lt;/a&gt;, it is a little sketchy. For example, take &lt;code&gt;&lt;a rel="nofollow" target="_blank" href="http://msdn.microsoft.com/en-us/library/ee340299%28VS.100%29.aspx"&gt;Seq.take&amp;lt;'T&amp;gt;&lt;/a&gt;&lt;/code&gt;: &lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Return the first N elements of the sequence.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Contrast, for example, Scala's &lt;code&gt;&lt;a rel="nofollow" target="_blank" href="http://www.scala-lang.org/docu/files/api/scala/Seq.html#take%28Int%29"&gt;Seq[A].take&lt;/a&gt;&lt;/code&gt; &lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Returns a sequence consisting only over the first n elements of this sequence, or else the whole sequence, if it has less than n elements. (non-strict)&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;So, what happens when you &lt;code&gt;take&lt;/code&gt; too much in F#?&lt;/p&gt;
&lt;p&gt;Answer: an exception is thrown indicating too few elements in the collection.&lt;/p&gt; &lt;p&gt;It's not just Scala -- &lt;a rel="nofollow" target="_blank" href="http://www.haskell.org/ghc/docs/6.10.2/html/libraries/base/Data-List.html#v%3Atake"&gt;Haskell&lt;/a&gt;, &lt;a rel="nofollow" target="_blank" href="http://www.erlang.org/doc/man/lists.html"&gt;Erlang lists:sublist&lt;/a&gt; and -- most tellingly -- &lt;a rel="nofollow" target="_blank" href="http://batteries.forge.ocamlcore.org/doc.preview:batteries-beta1/html/api/Seq.html"&gt;OCaml&lt;/a&gt; all define an "up to N" behaviour for a &lt;code&gt;take&lt;/code&gt; style operation. (So I've submitted this one as a bug report).&lt;/p&gt; &lt;p&gt;&lt;span style="font-weight:bold;"&gt;Later&lt;/span&gt;: Actually what I was looking for is &lt;a rel="nofollow" target="_blank" href="http://msdn.microsoft.com/en-us/library/ee370325%28VS.100%29.aspx"&gt;Seq.truncate&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;And that was one of today's little gotchas&amp;#8230;&lt;/p&gt; &lt;h4&gt;Generated names for &lt;code&gt;fun&lt;/code&gt;s&lt;/h4&gt; &lt;p&gt;In the February CTP release the class representing a &lt;code&gt;fun&lt;/code&gt; in method &lt;code&gt;MyMethod&lt;/code&gt; of class &lt;code&gt;My.FullyQualified.ClassName&lt;/code&gt; at line ### was named &lt;code&gt;My.FullyQualified.ClassName+MyMethod@###&lt;/code&gt; with clashes resolved by adding an incrementing count suffix like &lt;code&gt;-#&lt;/code&gt;.&lt;/p&gt; &lt;p&gt;In the October CTP, the name is now &lt;code&gt;&amp;lt;StartupCode$My-FullyQualified&amp;gt;.$ClassName+MyMethod@###&lt;/code&gt; plus possible suffix as before.&lt;/p&gt; &lt;h4&gt;A release&lt;/h4&gt;
&lt;p&gt;I &lt;a rel="nofollow" target="_blank" href="http://stevegilham.blogspot.com/2009/11/f-under-covers-ix-case-of-missing.html"&gt;mentioned yesterday&lt;/a&gt; about getting close to calling &lt;a rel="nofollow" target="_blank" href="http://tinesware.blogspot.com/2009/09/little-help-for-net-emphasis-f.html"&gt;a little toolset I've been working&lt;/a&gt; on to something I could call 1.0 state -- which basically means it seems to do what I want it to do in test for the intended feature set, I have no outstanding bugs, and all the low-hanging refactoring and more has been done (though it's not complete and really never can be, and it could probably do with more comments).&lt;/p&gt; &lt;p&gt;So, it works with nCover format coverage files and FxCop to provide coverage analysis and reporting -- separating out code that isn't covered in test as to why that might be the case, like for its own solution, a mix of C# and F# projects: &lt;/p&gt; &lt;div style="width:80%;margin:0 auto;border:1px solid silver;"&gt;&lt;h3&gt;Legend&lt;/h3&gt; &lt;table width="30%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td width="50%"&gt;Uncovered code&lt;/td&gt;&lt;td width="50%" style="background:red;"&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td width="50%"&gt;User exempted&lt;/td&gt;&lt;td width="50%" style="background:orange;"&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td width="50%"&gt;Generated code&lt;/td&gt;&lt;td width="50%" style="background:yellow;"&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td width="50%"&gt;Statically analyzed&lt;/td&gt;&lt;td width="50%" style="background:silver;"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td width="50%"&gt;Covered code&lt;/td&gt;&lt;td width="50%" style="background:#90ee90;"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;hr&gt; &lt;h2&gt;Modules summary&lt;/h2&gt; &lt;table width="90%"&gt; &lt;tr&gt;&lt;td width="30%"&gt;&lt;div&gt;CSharpTests&lt;/div&gt;&lt;/td&gt; &lt;td width="70%"&gt;&lt;table width="100%" style="font-size:9px;font-weight:bold;padding-top:1px;padding-bottom:1px;padding-left:3px;padding-right:3px;"&gt; &lt;tr&gt;&lt;td style="background:#90ee90;" width="100%"&gt;100%&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td width="30%"&gt;&lt;div&gt;Tinesware.Infrastructure&lt;/div&gt;&lt;/td&gt; &lt;td width="70%"&gt;&lt;table width="100%" style="font-size:9px;font-weight:bold;padding-top:1px;padding-bottom:1px;padding-left:3px;padding-right:3px;"&gt; &lt;tr&gt;&lt;td style="background:orange;" width="10.53%"&gt;10.53%&lt;/td&gt; &lt;td style="background:silver;" width="10.53%"&gt;10.53%&lt;/td&gt; &lt;td style="background:#90ee90;" width="78.95%"&gt;78.95%&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td width="30%"&gt;&lt;div&gt;Tinesware.InfrastructureTests&lt;/div&gt;&lt;/td&gt; &lt;td width="70%"&gt;&lt;table width="100%" style="font-size:9px;font-weight:bold;padding-top:1px;padding-bottom:1px;padding-left:3px;padding-right:3px;"&gt; &lt;tr&gt;&lt;td style="background:orange;" width="3.57%"&gt;3.57%&lt;/td&gt; &lt;td style="background:yellow;" width="7.14%"&gt;7.14%&lt;/td&gt; &lt;td style="background:silver;" width="25%"&gt;25%&lt;/td&gt; &lt;td style="background:#90ee90;" width="64.29%"&gt;64.29%&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td width="30%"&gt;&lt;div&gt;Tinesware.Rules&lt;/div&gt;&lt;/td&gt; &lt;td width="70%"&gt;&lt;table width="100%" style="font-size:9px;font-weight:bold;padding-top:1px;padding-bottom:1px;padding-left:3px;padding-right:3px;"&gt; &lt;tr&gt;&lt;td style="background:orange;" width="9.31%"&gt;9.31%&lt;/td&gt; &lt;td style="background:yellow;" width="2.09%"&gt;2.09%&lt;/td&gt; &lt;td style="background:silver;" width="0.48%"&gt;0.48%&lt;/td&gt; &lt;td style="background:#90ee90;" width="88.12%"&gt;88.12%&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td width="30%"&gt;&lt;div&gt;Tinesware.TestData&lt;/div&gt;&lt;/td&gt; &lt;td width="70%"&gt;&lt;table width="100%" style="font-size:9px;font-weight:bold;padding-top:1px;padding-bottom:1px;padding-left:3px;padding-right:3px;"&gt; &lt;tr&gt;&lt;td style="background:red;" width="3.23%"&gt;3.23%&lt;/td&gt; &lt;td style="background:orange;" width="24.19%"&gt;24.19%&lt;/td&gt; &lt;td style="background:yellow;" width="12.9%"&gt;12.9%&lt;/td&gt; &lt;td style="background:silver;" width="62.9%"&gt;62.9%&lt;/td&gt; &lt;td style="background:#90ee90;" width="3.23%"&gt;3.23%&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt; &lt;p&gt;Use it like this&lt;/p&gt;
&lt;pre&gt;rem Generate coverage.xml
ncover.console.exe nunit-console.exe [unit test assembly] /noshadow //reg //a rem run FxCop over the files in the same directory
FxCopCmd.exe /f:[file to analyse] [/f:[file to analyse] ... ] /rule:&amp;#92;path&amp;#92;to&amp;#92;Tinesware.Rules.dll "/rule:&amp;#92;path&amp;#92;to&amp;#92;Microsoft FxCop 1.36&amp;#92;Rules" ...&lt;/pre&gt; &lt;p&gt;Then view the generated &lt;code&gt;AnalyzedCoverage.xml&lt;/code&gt; file in a browser using the supplied &lt;code&gt;coverage.xsl&lt;/code&gt; file (copied to the same folder).&lt;/p&gt;
&lt;p&gt;More discussion of the road ahead &lt;a rel="nofollow" target="_blank" href="http://tinesware.blogspot.com/2009/11/infrastructure-helper-10.html"&gt;on my other blog&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Source and binaries are in &lt;a rel="nofollow" target="_blank" href="http://www.mediafire.com/mr_tines"&gt;my Works In Progress folder here&lt;/a&gt;. Bug reports and enhancement requests welcome -- turnround may not be speedy as I'll probably pick up something else from my stack to work on next, but will be added to the queue.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5569894-5445555097424455559?l=stevegilham.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;p&gt;&lt;a rel="nofollow" target="_blank" href="http://www.pheedo.com/click.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1258929720"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1258929720" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/-xtehoieVkzmqiPq3Y5Ar6reZ34/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-xtehoieVkzmqiPq3Y5Ar6reZ34/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/-xtehoieVkzmqiPq3Y5Ar6reZ34/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-xtehoieVkzmqiPq3Y5Ar6reZ34/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=DYvoc1hRuOw:R5gZEhPJUEw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=DYvoc1hRuOw:R5gZEhPJUEw:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=DYvoc1hRuOw:R5gZEhPJUEw:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=DYvoc1hRuOw:R5gZEhPJUEw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=DYvoc1hRuOw:R5gZEhPJUEw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=DYvoc1hRuOw:R5gZEhPJUEw:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=DYvoc1hRuOw:R5gZEhPJUEw:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/planet_fsharp/~4/DYvoc1hRuOw" height="1" width="1"/&gt;</description>
      <link>http://stevegilham.blogspot.com/2009/11/f-few-notes-and-something-to-play-with.html</link>
      <author>Steve</author>
      <pubDate>Sun, 22 Nov 2009 06:42:00 GMT</pubDate>
    </item>
    <item>
      <title>F# under the covers X -- the curious case of record types</title>
      <description>&lt;p&gt;They're coming thick and fast now...&lt;/p&gt;
&lt;p&gt;Define a record type such as &lt;/p&gt;
&lt;pre&gt;type Context = { Line : int; Column : int; EndLine : int; EndColumn : int }&lt;/pre&gt;
&lt;p&gt;The class that results looks like&lt;/p&gt;
&lt;pre&gt;[Serializable, CompilationMapping(SourceConstructFlags.RecordType)]
public sealed class Context : IStructuralEquatable, IComparable, IStructuralComparable
{ // Fields [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal int Column@; [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal int EndColumn@; [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal int EndLine@; [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal int Line@; // Methods public Context(int line, int column, int endLine, int endColumn); [CompilerGenerated] public sealed override int CompareTo(object obj); [CompilerGenerated] public int CompareTo(Context obj); [CompilerGenerated] public sealed override int CompareTo(object obj, IComparer comp); [CompilerGenerated] public sealed override bool Equals(object obj); [CompilerGenerated] public bool Equals(Context obj); [CompilerGenerated] public sealed override bool Equals(object obj, IEqualityComparer comp); [CompilerGenerated] public sealed override int GetHashCode(); [CompilerGenerated] public sealed override int GetHashCode(IEqualityComparer comp); // Properties [CompilationMapping(SourceConstructFlags.Field, 1)] public int Column { get; } [CompilationMapping(SourceConstructFlags.Field, 3)] public int EndColumn { get; } [CompilationMapping(SourceConstructFlags.Field, 2)] public int EndLine { get; } [CompilationMapping(SourceConstructFlags.Field, 0)] public int Line { get; }
}&lt;/pre&gt;
&lt;p&gt;where the source context for each method is the same -- the range containing just the type name.&lt;/p&gt;
&lt;p&gt;Now, you wouldn't expect anything to be seriously unusual about this class in terms of its implementation, but there is.&lt;/p&gt;
&lt;p&gt;FxCop reminds you about the &lt;code&gt;IComparable&lt;/code&gt; should-haves that can't be enforced through interface constraints:&lt;/p&gt;
&lt;pre&gt;[Location not stored in Pdb] : warning : CA1036 : Microsoft.Design : 'Context' should define operator '!=' since it implements IComparable.
[Location not stored in Pdb] : warning : CA1036 : Microsoft.Design : 'Context' should define operator '&amp;lt;' since it implements IComparable.
[Location not stored in Pdb] : warning : CA1036 : Microsoft.Design : 'Context' should define operator '==' since it implements IComparable.
[Location not stored in Pdb] : warning : CA1036 : Microsoft.Design : 'Context' should define operator '&amp;gt;' since it implements IComparable.&lt;/pre&gt;
&lt;p&gt;but which aren't there; and Reflector's decompilation to C# is stymied by the highlighted &lt;code&gt;CompareTo&lt;/code&gt; overloads -- the simple one is implemented as&lt;/p&gt;
&lt;pre&gt;[CompilerGenerated]
public sealed override int CompareTo(object obj)
{ return this.CompareTo((Context) obj);
}&lt;/pre&gt;
&lt;p&gt;which fortunately doesn't give much scope for things to go wrong.&lt;/p&gt;
&lt;p&gt;In this and the previous case, the offending instruction that Reflector balks at is a simple branch such as indicated in this example&lt;/p&gt;
&lt;pre&gt; L_0045: ldc.i4.m1 L_0046: nop L_0047: br.s L_0050 L_0049: ldloc.s num2 L_004b: ldloc.s num3 L_004d: cgt L_004f: nop L_0050: stloc.2 &lt;/pre&gt;
&lt;p&gt;It's quite clear at every turn that F# is coming at the problem of code generation from a very different direction to the well explored parts of the phase space of valid IL that C# and VB.net dabble in. And clear, too, that this will present a significant challenge to all writers of tools to work with the language -- it takes us well out of our old comfort zone.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5569894-46512285002348527?l=stevegilham.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;p&gt;&lt;a rel="nofollow" target="_blank" href="http://www.pheedo.com/click.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1258840800"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1258840800" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/_m4QcQnFfEVzNiGdZSu_aXPsP0U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_m4QcQnFfEVzNiGdZSu_aXPsP0U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/_m4QcQnFfEVzNiGdZSu_aXPsP0U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_m4QcQnFfEVzNiGdZSu_aXPsP0U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=NbkwGoX6MK4:l-4l_aG2HPY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=NbkwGoX6MK4:l-4l_aG2HPY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=NbkwGoX6MK4:l-4l_aG2HPY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=NbkwGoX6MK4:l-4l_aG2HPY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=NbkwGoX6MK4:l-4l_aG2HPY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=NbkwGoX6MK4:l-4l_aG2HPY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=NbkwGoX6MK4:l-4l_aG2HPY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/planet_fsharp/~4/NbkwGoX6MK4" height="1" width="1"/&gt;</description>
      <link>http://stevegilham.blogspot.com/2009/11/f-under-covers-x-curious-case-of-record.html</link>
      <author>Steve</author>
      <pubDate>Sat, 21 Nov 2009 06:00:00 GMT</pubDate>
    </item>
    <item>
      <title>F# under the covers IX -- the case of the missing coverage</title>
      <description>&lt;p&gt;As I'm driving my little &lt;a rel="nofollow" target="_blank" href="http://tinesware.blogspot.com/2009/09/little-help-for-net-emphasis-f.html"&gt;set of FxCop rules and associated helpers&lt;/a&gt; to a state I feel comfortable with calling a 1.0 release, I'm looking in more detail at how the code coverage in the automated system/integration test is going, trying to drive that towards 100%. And as usual, the F# code generation is throwing up some interesting results.&lt;/p&gt;
&lt;p&gt;Take this method (lightly refactored from last time):&lt;/p&gt;
&lt;pre&gt; member private self.CheckStatic (fn:Method) (xml:Option&amp;lt;XElement&amp;gt;) = if match fn with | SimpleGetter -&amp;gt; Resolved | SimpleSetter -&amp;gt; Resolved | SimpleConstructor -&amp;gt; Resolved | Stub -&amp;gt; Resolved | CSharpVoidStub -&amp;gt; Resolved | CSharpThrowsStub -&amp;gt; Resolved | CSharpConstStub -&amp;gt; Resolved | _ -&amp;gt; Open = Resolved then MarkXml xml StaticAnalysisExempt Int32.MaxValue "Static" match CoverageExemptionRule.GetAttribute ("Tinesware.Infrastructure", "CoverageExemptionAttribute") fn fn.DeclaringType.DeclaringModule with | None -&amp;gt; () | _ -&amp;gt; self.Problems.Add(new Problem(self.GetNamedResolution("attributeStatic", fn.FullName), fn)) Resolved else Open&lt;/pre&gt;
&lt;p&gt;Although my tests give a match for every case in the pattern -- and nCover shows a visit for every line from 168 to 176, and the expression body of each branch of the &lt;code&gt;if&lt;/code&gt;/&lt;code&gt;else&lt;/code&gt;, it also claims that a code point that spans from from line 168 col 5 to line 177 col 24 (everything from &lt;code&gt;if&lt;/code&gt; to &lt;code&gt;then&lt;/code&gt; inclusive) is not visited.&lt;/p&gt;
&lt;p&gt;Unfortunately, the IL generated for this method is not back-compilable to C# in Reflector (yes, another problem report submitted), so I can't use that to analyse what is going on in this particular case : I shall have to inject some diagnostic code into the rule itself to see what FxCop thinks is going on as a statement which spans those lines.&lt;/p&gt;
&lt;p&gt;But this isn't the only mysterious bit of uncoverage I've found in F# code -- in the previous state of the method (&lt;a rel="nofollow" target="_blank" href="http://stevegilham.blogspot.com/2009/11/ndepend-belated-kicking-tyres-review.html"&gt;as showcased here&lt;/a&gt;), it was the identifier &lt;code&gt;result&lt;/code&gt; in &lt;code&gt;let result = match&amp;#8230;&lt;/code&gt; that got the uncoverage, despite the named value being used as the final expression in the method.&lt;/p&gt;
&lt;p&gt;In most cases, it is possible to refactor away such temporaries, and clear the spurious uncoverages that they give rise to; but, as this example shows, it is not always possible.&lt;/p&gt;
&lt;h4&gt;Later&lt;/h4&gt;
&lt;p&gt;By recursively dumping &lt;code&gt;Statement&lt;/code&gt;s in FxCop for this method (which inserted 2 lines in a routine above this one, thus displacing the line numbers), I get a lot of multiple hits on statements (same type, same source context range), but the only ones with the appropriate source context are &lt;/p&gt;
&lt;pre class="code"&gt;Block -&amp;gt; from 170 : 5 to 179 : 24
&lt;span style="font-style:italic;"&gt;Nop -&amp;gt; from 170 : 5 to 179 : 24
Nop -&amp;gt; from 170 : 5 to 179 : 24&lt;/span&gt;
AssignmentStatement -&amp;gt; from 170 : 9 to 170 : 22
AssignmentStatement -&amp;gt; from 170 : 9 to 170 : 22
Branch -&amp;gt; from 170 : 9 to 170 : 22
Block -&amp;gt; from 170 : 9 to 170 : 22
Branch -&amp;gt; from 170 : 9 to 170 : 22
Block -&amp;gt; from 170 : 9 to 170 : 22
Branch -&amp;gt; from 170 : 9 to 170 : 22
Block -&amp;gt; from 171 : 27 to 171 : 35
ExpressionStatement -&amp;gt; from 171 : 27 to 171 : 35
&lt;span style="font-style:italic;"&gt;Nop -&amp;gt; from 171 : 27 to 171 : 35&lt;/span&gt;
&amp;#8230;&lt;/pre&gt;
&lt;p&gt;So it seems that first &lt;code&gt;Nop&lt;/code&gt; pair, with no other statement occupying the the same range, may be what it being detected as uncovered (unlike the second &lt;code&gt;Nop&lt;/code&gt;, which overlaps the immediately preceding &lt;code&gt;ExpressionStatement&lt;/code&gt; exactly).&lt;/p&gt;
&lt;p&gt;The equivalent IL looks like&lt;/p&gt;
&lt;pre&gt;.method assembly instance class Tinesware.Rules.Assist.Inconclusive CheckStatic(class [Microsoft.Cci]Microsoft.FxCop.Sdk.Method fn, class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1&amp;lt;class [System.Xml.Linq]System.Xml.Linq.XElement&amp;gt; xml) cil managed
{ .custom instance void [Tinesware.Infrastructure]Tinesware.Infrastructure.CoverageExemptionAttribute::.ctor() = { Points=int32(0x10) Justification=string('Operationally tested') } .custom instance void [mscorlib]System.Diagnostics.CodeAnalysis.SuppressMessageAttribute::.ctor(string, string) = { string('Microsoft.Usage') string('CA1801:ReviewUnusedParameters') MessageId=string('xml') Justification=string('Required signature') } .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = { new int32[int32(2)] { int32(1), int32(1) } } .maxstack 9 .locals init ( [0] class Tinesware.Rules.Assist.Inconclusive inconclusive, [1] class [Microsoft.Cci]Microsoft.FxCop.Sdk.Method 'method', [2] class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1&amp;lt;class [FSharp.Core]Microsoft.FSharp.Core.Unit&amp;gt; option, [3] class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1&amp;lt;class [FSharp.Core]Microsoft.FSharp.Core.Unit&amp;gt; option2, [4] class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1&amp;lt;class [FSharp.Core]Microsoft.FSharp.Core.Unit&amp;gt; option3, [5] class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1&amp;lt;class [FSharp.Core]Microsoft.FSharp.Core.Unit&amp;gt; option4, [6] class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1&amp;lt;class [FSharp.Core]Microsoft.FSharp.Core.Unit&amp;gt; option5, [7] class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1&amp;lt;class [FSharp.Core]Microsoft.FSharp.Core.Unit&amp;gt; option6, [8] class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1&amp;lt;class [FSharp.Core]Microsoft.FSharp.Core.Unit&amp;gt; option7, [9] class Tinesware.Rules.Assist.Inconclusive inconclusive2, [10] class [FSharp.Core]System.Tuple`2&amp;lt;string, string&amp;gt; tuple, [11] class [Microsoft.Cci]Microsoft.FxCop.Sdk.Method method2, [12] class [Microsoft.Cci]Microsoft.FxCop.Sdk.ModuleNode node) L_0000: nop L_0001: nop L_0002: ldarg.1 L_0003: stloc.1 L_0004: ldloc.1 L_0005: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1&amp;lt;class [FSharp.Core]Microsoft.FSharp.Core.Unit&amp;gt; Tinesware.Rules.Patterns::|SimpleGetter|_|(class [Microsoft.Cci]Microsoft.FxCop.Sdk.Method) L_000a: stloc.2 L_000b: ldloc.2 L_000c: brfalse.s L_0010 L_000e: br.s L_0012 L_0010: br.s L_001d L_0012: call class Tinesware.Rules.Assist.Inconclusive Tinesware.Rules.Assist.Inconclusive::get_Resolved() L_0017: nop &lt;/pre&gt;
&lt;p&gt;which does indeed have a pair of &lt;code&gt;Nop&lt;/code&gt; opcodes at the start.&lt;/p&gt;
&lt;p&gt;So, that looks like another heuristic to add - removing unvisited code point records that correspond to nothing but a &lt;code&gt;Nop&lt;/code&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5569894-444350479773576622?l=stevegilham.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;p&gt;&lt;a rel="nofollow" target="_blank" href="http://www.pheedo.com/click.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1258816800"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1258816800" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/OcxUWmUhGQXTHpm28Vcbocxoobw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OcxUWmUhGQXTHpm28Vcbocxoobw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/OcxUWmUhGQXTHpm28Vcbocxoobw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OcxUWmUhGQXTHpm28Vcbocxoobw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=aF1Nxw61S2U:XIRXBpo0yW8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=aF1Nxw61S2U:XIRXBpo0yW8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=aF1Nxw61S2U:XIRXBpo0yW8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=aF1Nxw61S2U:XIRXBpo0yW8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=aF1Nxw61S2U:XIRXBpo0yW8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=aF1Nxw61S2U:XIRXBpo0yW8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=aF1Nxw61S2U:XIRXBpo0yW8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/planet_fsharp/~4/aF1Nxw61S2U" height="1" width="1"/&gt;</description>
      <link>http://stevegilham.blogspot.com/2009/11/f-under-covers-ix-case-of-missing.html</link>
      <author>Steve</author>
      <pubDate>Fri, 20 Nov 2009 23:20:00 GMT</pubDate>
    </item>
    <item>
      <title>Left-Truncatable Primes</title>
      <description>&lt;p&gt;Yesterday a colleague asked me how a function to calculate the nth &lt;a rel="nofollow" target="_blank" href="http://en.wikipedia.org/wiki/Truncatable_prime"&gt;left-truncatable prime&lt;/a&gt; might look in F# for comparison against a C++ implementation, so lets start with the definition from Wikipedia:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;In &lt;a rel="nofollow" target="_blank" href="http://en.wikipedia.org/wiki/Number_theory"&gt;number theory&lt;/a&gt;, a &lt;strong&gt;left-truncatable prime&lt;/strong&gt; is a &lt;a rel="nofollow" target="_blank" href="http://en.wikipedia.org/wiki/Prime_number"&gt;prime number&lt;/a&gt; which, in a given &lt;a rel="nofollow" target="_blank" href="http://en.wikipedia.org/wiki/Radix"&gt;base&lt;/a&gt;, contains no 0, and if the leading ("left") digit is successively removed, then all resulting numbers are prime. For example 9137, since 9137, 137, 37 and 7 are all prime. &lt;a rel="nofollow" target="_blank" href="http://en.wikipedia.org/wiki/Decimal"&gt;Decimal&lt;/a&gt; representation is often assumed and always used in this article.&lt;/p&gt; &lt;/blockquote&gt; &lt;p&gt;The following is the F# implementation, using recursion, coded up on the train home last night (the function takes about 5ms to calculate the 1000th left-truncatable prime, &lt;span style="text-decoration:line-through;"&gt;just 2ms off&lt;/span&gt; very close to the optimized C++ time):&lt;/p&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt; &lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;let &lt;/span&gt;IsPrime n = &lt;span style="color:blue;"&gt;if &lt;/span&gt;n = 1 &lt;span style="color:blue;"&gt;then false else let &lt;/span&gt;max = n |&amp;gt; float |&amp;gt; sqrt |&amp;gt; int &lt;span style="color:blue;"&gt;let rec &lt;/span&gt;Test = &lt;span style="color:blue;"&gt;function &lt;/span&gt;| x &lt;span style="color:blue;"&gt;when &lt;/span&gt;x &amp;gt; max &lt;span style="color:blue;"&gt;-&amp;gt; true &lt;/span&gt;| x &lt;span style="color:blue;"&gt;-&amp;gt; if &lt;/span&gt;(n % x) = 0 &lt;span style="color:blue;"&gt;then false else &lt;/span&gt;Test (x+1) Test 2 &lt;span style="color:blue;"&gt;let &lt;/span&gt;NthLeftTruncatedPrime index = &lt;span style="color:blue;"&gt;let rec &lt;/span&gt;Find digit factor primes primes' count acc = &lt;span style="color:blue;"&gt;match &lt;/span&gt;digit, primes' &lt;span style="color:blue;"&gt;with &lt;/span&gt;| 10, _ &lt;span style="color:blue;"&gt;-&amp;gt; let &lt;/span&gt;primes = List.rev acc Find 1 (10*factor) primes primes count [] | _, [] &lt;span style="color:blue;"&gt;-&amp;gt; &lt;/span&gt;Find (digit+1) factor primes primes count acc | _, prime::tail &lt;span style="color:blue;"&gt;-&amp;gt; let &lt;/span&gt;k = (digit * factor) + prime &lt;span style="color:blue;"&gt;let &lt;/span&gt;count, acc = &lt;span style="color:blue;"&gt;if &lt;/span&gt;IsPrime k &lt;span style="color:blue;"&gt;then &lt;/span&gt;count+1, k::acc &lt;span style="color:blue;"&gt;else &lt;/span&gt;count, acc &lt;span style="color:blue;"&gt;if &lt;/span&gt;count = index &lt;span style="color:blue;"&gt;then &lt;/span&gt;k &lt;span style="color:blue;"&gt;else &lt;/span&gt;Find digit factor primes tail count acc &lt;span style="color:blue;"&gt;let &lt;/span&gt;primes = [2;3;5;7] &lt;span style="color:blue;"&gt;if &lt;/span&gt;index &amp;lt;= 4 &lt;span style="color:blue;"&gt;then &lt;/span&gt;List.nth primes (index-1) &lt;span style="color:blue;"&gt;else &lt;/span&gt;Find 1 10 primes primes 4 []&lt;/pre&gt; &lt;a rel="nofollow" target="_blank" href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/div&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt;&amp;#160;&lt;/div&gt; &lt;p&gt;Initially the comparison was intended to be simply on readability, where the F# code was unsurprisingly found to be shorter, and the imperative style (lots of for loops) of the C++ code more familiar to some.&lt;/p&gt; &lt;p&gt;Just out of curiosity I ran a quick performance check to see whether performance was in the same order of magnitude, fully expecting the C++ to faster. In fact initially the C++ was half the speed of the F# code (i.e. the C++ took twice as long). After a little head scratching, I tried a few teaks on the C++, for example giving the STL vector an initial capacity which increased performance by about 20%. Then I spotted that the C++ was using Int64 underneath and the F# Int32. Making the C++ use Int32 brought comparable performance to the F# code give or take a millisecond. At no point did I bother trying to optimize the F# code (except for running the function once before doing the timing to ensure the code had been just-in-time (JIT) compiled).&lt;/p&gt; &lt;p&gt;At the time of first posting this entry it was thought that the C++ was a couple of milliseconds faster. Actually later in the day it was found that there was an error in the calculation of the C++ result and in fact there was no discernable difference between the performance of the C++ and F# code. There are further algorithmic optimizations that could be applied to both implementations but I will leave that as an exercise for the reader.&lt;/p&gt; &lt;p&gt;This is quite interesting, it really does show that you can *NOT* assume that writing code in unmanaged C++ will intrinsically make it faster than code written in managed languages like C# and F#.&lt;/p&gt;&lt;p&gt;&lt;a rel="nofollow" target="_blank" href="http://www.pheedo.com/click.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1258705020"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=60c11b8469e54dfba87cebc201b448d0&amp;u=planetfsharp1258705020" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/0cUMxHWIkNfZuujhaEeYxryv8dY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0cUMxHWIkNfZuujhaEeYxryv8dY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/0cUMxHWIkNfZuujhaEeYxryv8dY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0cUMxHWIkNfZuujhaEeYxryv8dY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=839AO591cYY:An_dcL4tu4Q:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=839AO591cYY:An_dcL4tu4Q:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=839AO591cYY:An_dcL4tu4Q:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=839AO591cYY:An_dcL4tu4Q:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=839AO591cYY:An_dcL4tu4Q:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/planet_fsharp?a=839AO591cYY:An_dcL4tu4Q:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/planet_fsharp?i=839AO591cYY:An_dcL4tu4Q:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/planet_fsharp/~4/839AO591cYY" height="1" width="1"/&gt;</description>
      <link>http://www.trelford.com/blog/post/Left-Truncatable-Primes.aspx</link>
      <category>F#</category>
      <author>phil</author>
      <pubDate>Thu, 19 Nov 2009 16:17:00 GMT</pubDate>
    </item>
  </channel>
</rss>
