<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

 <title>Colin Bull</title>
 <link href="http://colinbull.github.io/atom.xml" rel="self"/>
 <link href="http://colinbull.github.io/"/>
 <updated>2018-04-12T21:14:27+00:00</updated>
 <id>http://colinbull.github.io</id>
 <author>
   <name>Colin Bull</name>
   <email></email>
 </author>

 
 <entry>
   <title>Lazy Elmish React</title>
   <link href="http://colinbull.github.io/2018/02/08/Lazy-Elmish-React/"/>
   <updated>2018-02-08T00:00:00+00:00</updated>
   <id>http://colinbull.github.io/2018/02/08/Lazy-Elmish-React</id>
   <content type="html">&lt;p&gt;Recently I have been doing a fair amount with Fable-React-Elmish, and I have had really good results. 
Quick time to production, little or no bugs. Overal I have been very happy with the toolchain. Now admittedly the apps 
I have been producing are small, boring line of business apps. Basically just utilities or forms that essentailly are nothing 
more than data entry. However the latest application I have had to produce was abit more involved. Basically there is a simple form
that has to query a API and then dispaly the data in a table with various levels of grouping. Armed with my recent successful experiences
with the Fable-Elmish-React toolset I was reasonably confident I could have something running in a few days. Which I did, and
I was pleased with my self.&lt;/p&gt;

&lt;p&gt;UNTIL...&lt;/p&gt;

&lt;p&gt;I started testing with more realistically sized datasets. And then I found out it was slow, like, really, really, slow. Over a second to render
a single key press. This was somewhat a surprise as everything you read about React says how blazing fast the Virtual DOM and rendering are.&lt;/p&gt;

&lt;p&gt;In it's first cut I had a view which looked something like the following.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt; 1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 8: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 9: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;10: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;11: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;12: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;13: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;14: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;15: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;16: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;17: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;18: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;19: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;20: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;21: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;22: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;23: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;24: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;25: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;26: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;27: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;28: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;29: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;30: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;31: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;32: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;33: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;34: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;view&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;model&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;dispatch&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
    &lt;span class=&quot;i&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;div&lt;/span&gt; [&lt;span class=&quot;i&quot;&gt;ClassName&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;col&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;md&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;] [
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs4', 17)&quot; onmouseover=&quot;showTip(event, 'fs4', 17)&quot; class=&quot;i&quot;&gt;Data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Length&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;0&lt;/span&gt; 
        &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;yield&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;form&lt;/span&gt; [&lt;span class=&quot;i&quot;&gt;ClassName&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;inline&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;col&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;md&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;; &lt;span class=&quot;i&quot;&gt;Style&lt;/span&gt; [&lt;span class=&quot;i&quot;&gt;PaddingBottom&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;]] [
                        &lt;span class=&quot;i&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;button&lt;/span&gt; [&lt;span class=&quot;i&quot;&gt;ClassName&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;btn&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;btn&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;col&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;md&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;; 
                                   &lt;span class=&quot;i&quot;&gt;Disabled&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;PendingChanged&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Length&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;0&lt;/span&gt;);
                                   &lt;span class=&quot;i&quot;&gt;OnClick&lt;/span&gt; (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;preventDefault&lt;/span&gt;();  &lt;span class=&quot;i&quot;&gt;dispatch&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;SaveChanges&lt;/span&gt;)
                                 ] [&lt;span onmouseout=&quot;hideTip(event, 'fs8', 18)&quot; onmouseover=&quot;showTip(event, 'fs8', 18)&quot; class=&quot;i&quot;&gt;unbox&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Save&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Changes&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;]

                        &lt;span class=&quot;i&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;input&lt;/span&gt; [ &lt;span class=&quot;i&quot;&gt;Id&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;selectedentity&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;; 
                                  &lt;span class=&quot;i&quot;&gt;ClassName&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;control&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;; 
                                  &lt;span class=&quot;i&quot;&gt;Style&lt;/span&gt;[&lt;span class=&quot;i&quot;&gt;MarginLeft&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;]; 
                                  &lt;span class=&quot;i&quot;&gt;Placeholder&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Select&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Entity&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;; 
                                  &lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Entity&lt;/span&gt;]
                ]
       
        &lt;span class=&quot;k&quot;&gt;yield&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;div&lt;/span&gt; [&lt;span class=&quot;i&quot;&gt;ClassName&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;col&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;md&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;responsive&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;] [
                   &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs4', 19)&quot; onmouseover=&quot;showTip(event, 'fs4', 19)&quot; class=&quot;i&quot;&gt;Data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Length&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;0&lt;/span&gt; 
                   &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt;
                      &lt;span class=&quot;k&quot;&gt;yield&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;bootstrapTable&lt;/span&gt; [
                          &lt;span class=&quot;i&quot;&gt;KeyField&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
                          &lt;span onmouseout=&quot;hideTip(event, 'fs4', 20)&quot; onmouseover=&quot;showTip(event, 'fs4', 20)&quot; class=&quot;i&quot;&gt;Data&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs4', 21)&quot; onmouseover=&quot;showTip(event, 'fs4', 21)&quot; class=&quot;i&quot;&gt;Data&lt;/span&gt;
                          &lt;span class=&quot;i&quot;&gt;Columns&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Columns&lt;/span&gt;
                          &lt;span class=&quot;i&quot;&gt;CellEdit&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;CellEditFactory&lt;/span&gt;(
                            [
                              &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;mode&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
                              &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;afterSaveCell&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs9', 22)&quot; onmouseover=&quot;showTip(event, 'fs9', 22)&quot; class=&quot;i&quot;&gt;ignore&lt;/span&gt;
                            ] &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;createObj&lt;/span&gt;))
                      ]
                   &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; 
                     &lt;span class=&quot;k&quot;&gt;yield&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;h1&lt;/span&gt; [&lt;span class=&quot;i&quot;&gt;Style&lt;/span&gt; [&lt;span class=&quot;i&quot;&gt;BackgroundColor&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;eeeeee&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;; &lt;span class=&quot;i&quot;&gt;TextAlign&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;; &lt;span class=&quot;i&quot;&gt;Height&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;]] [&lt;span class=&quot;i&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;str&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;No&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Data&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;]
              ]
    ]&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;However as innocent as this looks it is going to cause react some problems. Why, well the table in this case is going to contain
52 x 31 (1612) elements. That is quiet a lot of DOM elements, and the problem in this instance is that this will get rendered on every single pass. 
So how do we go about solving this. Well..&lt;/p&gt;

&lt;p&gt;TL;DR RTFM - There is a description of this exact issue on the &lt;a href=&quot;https://fable-elmish.github.io/react/#Lazy-views&quot;&gt;Elmish.React github page&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;By default, every time the main update function is called (upon receiving and processing a message), the entire DOM is constructed anew and passed to React for reconciliation. If there are no changes in the model of some component, its view function will under normal circumstances not return a different result. React will then still perform reconciliation and realize that there is no need to update the component's UI. Consequently, when the DOM is sufficiently large or its construction extremely time-consuming, this unnecessary work may have noticeable repercussions in terms of application performance. Thanks to lazy views however, the update process can be optimized by avoiding DOM reconciliation and construction steps, but only if the model remains unchanged.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So lazy views are the answer. Elmish-React provides several &lt;a href=&quot;https://fable-elmish.github.io/react/common.html&quot;&gt;lazy view functions&lt;/a&gt;. The varients without the &lt;code&gt;With&lt;/code&gt; suffix require types with equality constraint. This means that if any property on the model changes then the DOM will be updated. This is often not the behaviour you desire, since it is unlikely you will interact with your UI without changing your model. To this end you have two choices, create a lazyView component and pass the specific property or properties (as a tuple) from the model you are interested in. Or use &lt;code&gt;lazyViewWith&lt;/code&gt; which allows us to specify the predicate that decides when we should update the containing DOM elements. In this example we'll use the latter.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt; 1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 8: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 9: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;10: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;11: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;12: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;13: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;14: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;15: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;16: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;17: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;18: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;19: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;20: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;21: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;22: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;23: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;24: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;25: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;26: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;27: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;28: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;29: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;30: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;31: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;32: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;33: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;34: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;35: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;36: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;37: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;38: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;viewLazy&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;model&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;dispatch&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
    &lt;span class=&quot;i&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;div&lt;/span&gt; [&lt;span class=&quot;i&quot;&gt;ClassName&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;col&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;md&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;] [
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs4', 23)&quot; onmouseover=&quot;showTip(event, 'fs4', 23)&quot; class=&quot;i&quot;&gt;Data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Length&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;0&lt;/span&gt; 
        &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;yield&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;form&lt;/span&gt; [&lt;span class=&quot;i&quot;&gt;ClassName&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;inline&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;col&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;md&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;; &lt;span class=&quot;i&quot;&gt;Style&lt;/span&gt; [&lt;span class=&quot;i&quot;&gt;PaddingBottom&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;]] [
                        &lt;span class=&quot;i&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;button&lt;/span&gt; [&lt;span class=&quot;i&quot;&gt;ClassName&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;btn&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;btn&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;col&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;md&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;; 
                                   &lt;span class=&quot;i&quot;&gt;Disabled&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;PendingChanged&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Length&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;0&lt;/span&gt;);
                                   &lt;span class=&quot;i&quot;&gt;OnClick&lt;/span&gt; (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;preventDefault&lt;/span&gt;();  &lt;span class=&quot;i&quot;&gt;dispatch&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;SaveChanges&lt;/span&gt;)
                                 ] [&lt;span onmouseout=&quot;hideTip(event, 'fs8', 24)&quot; onmouseover=&quot;showTip(event, 'fs8', 24)&quot; class=&quot;i&quot;&gt;unbox&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Save&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Changes&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;]

                        &lt;span class=&quot;i&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;input&lt;/span&gt; [ &lt;span class=&quot;i&quot;&gt;Id&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;selectedentity&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;; 
                                  &lt;span class=&quot;i&quot;&gt;ClassName&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;control&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;; 
                                  &lt;span class=&quot;i&quot;&gt;Style&lt;/span&gt;[&lt;span class=&quot;i&quot;&gt;MarginLeft&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;]; 
                                  &lt;span class=&quot;i&quot;&gt;Placeholder&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Select&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Entity&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;; 
                                  &lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Entity&lt;/span&gt;]
                ]
       
        &lt;span class=&quot;k&quot;&gt;yield&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;lazyViewWith&lt;/span&gt;
                 (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;oldM&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;newM&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;oldM&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Entity&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;newM&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Entity&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;oldM&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs4', 25)&quot; onmouseover=&quot;showTip(event, 'fs4', 25)&quot; class=&quot;i&quot;&gt;Data&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;newM&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs4', 26)&quot; onmouseover=&quot;showTip(event, 'fs4', 26)&quot; class=&quot;i&quot;&gt;Data&lt;/span&gt;) 
                 (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;model&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; 
                     &lt;span class=&quot;i&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;div&lt;/span&gt; [&lt;span class=&quot;i&quot;&gt;ClassName&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;col&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;md&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;responsive&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;] [
                           &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs4', 27)&quot; onmouseover=&quot;showTip(event, 'fs4', 27)&quot; class=&quot;i&quot;&gt;Data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Length&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;0&lt;/span&gt; 
                           &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt;
                              &lt;span class=&quot;k&quot;&gt;yield&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;bootstrapTable&lt;/span&gt; [
                                  &lt;span class=&quot;i&quot;&gt;KeyField&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
                                  &lt;span onmouseout=&quot;hideTip(event, 'fs4', 28)&quot; onmouseover=&quot;showTip(event, 'fs4', 28)&quot; class=&quot;i&quot;&gt;Data&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs4', 29)&quot; onmouseover=&quot;showTip(event, 'fs4', 29)&quot; class=&quot;i&quot;&gt;Data&lt;/span&gt;
                                  &lt;span class=&quot;i&quot;&gt;Columns&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Columns&lt;/span&gt;
                                  &lt;span class=&quot;i&quot;&gt;CellEdit&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;CellEditFactory&lt;/span&gt;(
                                    [
                                      &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;mode&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
                                      &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;afterSaveCell&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs9', 30)&quot; onmouseover=&quot;showTip(event, 'fs9', 30)&quot; class=&quot;i&quot;&gt;ignore&lt;/span&gt;
                                    ] &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;createObj&lt;/span&gt;))
                              ]
                           &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; 
                             &lt;span class=&quot;k&quot;&gt;yield&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;h1&lt;/span&gt; [&lt;span class=&quot;i&quot;&gt;Style&lt;/span&gt; [&lt;span class=&quot;i&quot;&gt;BackgroundColor&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;eeeeee&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;; &lt;span class=&quot;i&quot;&gt;TextAlign&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;; &lt;span class=&quot;i&quot;&gt;Height&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;]] [&lt;span class=&quot;i&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;str&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;No&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Data&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;]
                      ]
                 ) &lt;span class=&quot;i&quot;&gt;model&lt;/span&gt;
    ]&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;Simples. Basically we have just wrapped the &lt;code&gt;div&lt;/code&gt; that contains the table with the &lt;code&gt;lazyViewWith&lt;/code&gt; function, and specified the predicate that helps it decide
when to update.&lt;/p&gt;

&lt;p&gt;With this in place, the responsiveness of the UI returned and I could breath again. I have to admit it took me way too long to figure this out considering 
it is actually written on the Elmish React project home page. However on the brightside I learnt a lot about React performance analysis, mainly from &lt;a href=&quot;https://marmelab.com/blog/2017/02/06/react-is-slow-react-is-fast.html&quot;&gt;this post&lt;/a&gt; I suggest, you read this as I found it quiet useful as well as the links at the bottom.&lt;/p&gt;


&lt;div class=&quot;tip&quot; id=&quot;fs1&quot;&gt;namespace Microsoft.FSharp.Core&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs2&quot;&gt;type obj = System.Object&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.obj&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs3&quot;&gt;Multiple items&lt;br /&gt;val string : value:&amp;#39;T -&amp;gt; string&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.string&lt;br /&gt;&lt;br /&gt;--------------------&lt;br /&gt;type string = System.String&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.string&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs4&quot;&gt;namespace Microsoft.FSharp.Data&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs5&quot;&gt;type &amp;#39;T list = List&amp;lt;&amp;#39;T&amp;gt;&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.list&amp;lt;_&amp;gt;&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs6&quot;&gt;module Unchecked&lt;br /&gt;&lt;br /&gt;from Microsoft.FSharp.Core.Operators&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs7&quot;&gt;val defaultof&amp;lt;&amp;#39;T&amp;gt; : &amp;#39;T&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.Unchecked.defaultof&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs8&quot;&gt;val unbox : value:obj -&amp;gt; &amp;#39;T&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.unbox&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs9&quot;&gt;val ignore : value:&amp;#39;T -&amp;gt; unit&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.ignore&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Html Provider + Canopy.</title>
   <link href="http://colinbull.github.io/2016/11/29/HtmlProvider-Canopy/"/>
   <updated>2016-11-29T00:00:00+00:00</updated>
   <id>http://colinbull.github.io/2016/11/29/HtmlProvider-Canopy</id>
   <content type="html">&lt;p&gt;So recently this tweet came across my timeline.&lt;/p&gt;

&lt;p&gt;&lt;blockquote class=&quot;twitter-tweet&quot; data-lang=&quot;en&quot;&gt;&lt;p lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;Why F# is the best language for screen scraping &lt;a href=&quot;https://t.co/VinRTFApzI&quot;&gt;&lt;a href=&quot;https://t.co/VinRTFApzI&amp;lt;/a&amp;gt;.&quot;&gt;https://t.co/VinRTFApzI&lt;/a&gt;.&lt;/a&gt; Nice article&lt;/p&gt;Don Syme (@dsyme) &lt;a href=&quot;https://twitter.com/dsyme/status/803670647515873280&quot;&gt;November 29, 2016&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src=&quot;//platform.twitter.com/widgets.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;&lt;/p&gt;

&lt;p&gt;and indeed the article is definiately worth a read. However I have recently been using both canopy and the HTML Provider together to extract auction price data from &lt;a href=&quot;http://www.nordpoolspot.com/Market-data1/N2EX/Auction-prices/UK/Hourly/?view=table&quot;&gt;&lt;a href=&quot;http://www.nordpoolspot.com/Market-data1/N2EX/Auction-prices/UK/Hourly/?view=table&quot;&gt;http://www.nordpoolspot.com/Market-data1/N2EX/Auction-prices/UK/Hourly/?view=table&lt;/a&gt;&lt;/a&gt; and thought it might be worth sharing some of the code I have been using. Now the problem with just using the &lt;a href=&quot;http://fsharp.github.io/FSharp.Data/&quot;&gt;HTML Provider&lt;/a&gt; to scrape this page is that you actually need the javascript on the page to execute and the HTML provider doesn't do this. Maybe this is something worth adding??&lt;/p&gt;

&lt;p&gt;However using &lt;a href=&quot;https://lefthandedgoat.github.io/canopy/&quot;&gt;canopy&lt;/a&gt; with &lt;a href=&quot;http://phantomjs.org/&quot;&gt;phantomjs&lt;/a&gt; we can get the javascript to execute and the table generated in the resulting HTML and therefore availble to the HTML provider. So how do we do this. Well first of all we need to find out which elements we need write a function that uses canopy to execute the page,&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt; 1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 8: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 9: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;10: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;11: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;12: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;13: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;14: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;15: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;16: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;17: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;18: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;19: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;getN2EXPage&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;phantomJsDir&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;targetUrl&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;units&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;withSource&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
    &lt;span class=&quot;i&quot;&gt;phantomJSDir&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;phantomJsDir&lt;/span&gt;
    &lt;span class=&quot;i&quot;&gt;start&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;phantomJS&lt;/span&gt;
    &lt;span class=&quot;i&quot;&gt;url&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;targetUrl&lt;/span&gt;
    &lt;span class=&quot;i&quot;&gt;waitForElement&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;datatable&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 5)&quot; onmouseover=&quot;showTip(event, 'fs4', 5)&quot; class=&quot;i&quot;&gt;not&lt;/span&gt;(&lt;span onmouseout=&quot;hideTip(event, 'fs5', 6)&quot; onmouseover=&quot;showTip(event, 'fs5', 6)&quot; class=&quot;i&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsNullOrWhiteSpace&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;units&lt;/span&gt;))
    &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt; 
        &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;currencySelector&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;SelectElement&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;element&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;currency&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;select&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;)
        &lt;span class=&quot;i&quot;&gt;currencySelector&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;SelectByText&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;units&lt;/span&gt;)
        &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;unitDisplay&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;element&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;dashboard&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;unit&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;)
        &lt;span onmouseout=&quot;hideTip(event, 'fs6', 7)&quot; onmouseover=&quot;showTip(event, 'fs6', 7)&quot; class=&quot;i&quot;&gt;printfn&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;unitDisplay&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Text&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 8)&quot; onmouseover=&quot;showTip(event, 'fs4', 8)&quot; class=&quot;i&quot;&gt;not&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;unitDisplay&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Contains&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;units&lt;/span&gt;)) &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
            &lt;span onmouseout=&quot;hideTip(event, 'fs6', 9)&quot; onmouseover=&quot;showTip(event, 'fs6', 9)&quot; class=&quot;i&quot;&gt;printfn&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;unitDisplay&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Text&lt;/span&gt;
            &lt;span class=&quot;i&quot;&gt;sleep&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;0.5&lt;/span&gt;
        &lt;span onmouseout=&quot;hideTip(event, 'fs6', 10)&quot; onmouseover=&quot;showTip(event, 'fs6', 10)&quot; class=&quot;i&quot;&gt;printfn&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;unitDisplay&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Text&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;source&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;withSource&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;browser&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;PageSource&lt;/span&gt;
    &lt;span class=&quot;i&quot;&gt;quit&lt;/span&gt;()
    &lt;span class=&quot;i&quot;&gt;source&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;with this function we can now do a couple of things.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run a phantomjs headless browser.&lt;/li&gt;
&lt;li&gt;Wait for the javascript to run on the page and render the &lt;code&gt;#datatable&lt;/code&gt; element&lt;/li&gt;
&lt;li&gt;If we specify the currency to use then change the currency select element to that currency then wait again for the page to render.&lt;/li&gt;
&lt;li&gt;Finally pass the source of the page to a function for further processing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So with this we can now create a snapshot of the page and dump it to a file.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;8: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;toolPath&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
    &lt;span class=&quot;i&quot;&gt;Path&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;GetFullPath&lt;/span&gt;(&lt;span class=&quot;k&quot;&gt;__SOURCE_DIRECTORY__&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;libs&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Tools&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;phantomjs&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;bin&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;)

&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;writePage&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;path&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;content&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Exists&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;path&lt;/span&gt;) &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Delete&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;path&lt;/span&gt;
    &lt;span class=&quot;i&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;WriteAllText&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;path&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;content&lt;/span&gt;)

&lt;span class=&quot;i&quot;&gt;getN2EXPage&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;toolPath&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;http&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;www&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;nordpoolspot&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;com&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Market&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;data1&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;N2EX&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Auction&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;prices&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;UK&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Hourly&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;view&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;GBP&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;writePage&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;code&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;n2ex_auction_prices&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;Once we have executed the above function we have a template file that we can use in the type provider to generate our type space.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;5: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;N2EX&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;HtmlProvider&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;n2ex_auction_prices&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;getAuctionPriceData&lt;/span&gt;() &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;page&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;getN2EXPage&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;toolPath&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;http&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;www&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;nordpoolspot&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;com&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Market&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;data1&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;N2EX&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Auction&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;prices&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;UK&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Hourly&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;view&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;GBP&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;N2EX&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Parse&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;data&lt;/span&gt;))
    &lt;span class=&quot;i&quot;&gt;page&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Tables&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Datatable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Rows&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;at this point we can use the HTML Provider as we normally would.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;3: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
    &lt;span class=&quot;i&quot;&gt;getAuctionPriceData&lt;/span&gt;() 
    &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs7', 11)&quot; onmouseover=&quot;showTip(event, 'fs7', 11)&quot; class=&quot;i&quot;&gt;Seq&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs8', 12)&quot; onmouseover=&quot;showTip(event, 'fs8', 12)&quot; class=&quot;i&quot;&gt;map&lt;/span&gt; (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;``UK time``&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;``30-11-2016``&lt;/span&gt;)&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;Finally, I think it is worth noting that even though the the headers will change on the page; due to the fact that it is a rolling 9 day window. At runtime this code will carry on working as expected, because the code behind this will still be accessing the 1st and 3rd columns in the table, even though the headers have changed. However at compile time the code will fail :( because the headers and therefore the types have changed. However all is not lost, when this occurs, since the underlying type is erased to a tuple. So we could just do the following&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;6: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;dataAsTuple&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
    &lt;span class=&quot;i&quot;&gt;getAuctionPriceData&lt;/span&gt;() 
    &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs7', 13)&quot; onmouseover=&quot;showTip(event, 'fs7', 13)&quot; class=&quot;i&quot;&gt;Seq&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs8', 14)&quot; onmouseover=&quot;showTip(event, 'fs8', 14)&quot; class=&quot;i&quot;&gt;map&lt;/span&gt; (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; 
        &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;ukTime&lt;/span&gt;, _, &lt;span class=&quot;i&quot;&gt;firstData&lt;/span&gt;,_,_,_,_,_,_,_) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs9', 15)&quot; onmouseover=&quot;showTip(event, 'fs9', 15)&quot; class=&quot;i&quot;&gt;box&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs10', 16)&quot; onmouseover=&quot;showTip(event, 'fs10', 16)&quot; class=&quot;i&quot;&gt;unbox&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs11', 17)&quot; onmouseover=&quot;showTip(event, 'fs11', 17)&quot; class=&quot;i&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs11', 18)&quot; onmouseover=&quot;showTip(event, 'fs11', 18)&quot; class=&quot;i&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs11', 19)&quot; onmouseover=&quot;showTip(event, 'fs11', 19)&quot; class=&quot;i&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs11', 20)&quot; onmouseover=&quot;showTip(event, 'fs11', 20)&quot; class=&quot;i&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs11', 21)&quot; onmouseover=&quot;showTip(event, 'fs11', 21)&quot; class=&quot;i&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs11', 22)&quot; onmouseover=&quot;showTip(event, 'fs11', 22)&quot; class=&quot;i&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs11', 23)&quot; onmouseover=&quot;showTip(event, 'fs11', 23)&quot; class=&quot;i&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs11', 24)&quot; onmouseover=&quot;showTip(event, 'fs11', 24)&quot; class=&quot;i&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs11', 25)&quot; onmouseover=&quot;showTip(event, 'fs11', 25)&quot; class=&quot;i&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs11', 26)&quot; onmouseover=&quot;showTip(event, 'fs11', 26)&quot; class=&quot;i&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;i&quot;&gt;ukTime&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;firstData&lt;/span&gt;
    )&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;A little verbose but, hey it's another option...&lt;/p&gt;


&lt;div class=&quot;tip&quot; id=&quot;fs1&quot;&gt;namespace System&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs2&quot;&gt;namespace System.IO&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs3&quot;&gt;namespace Microsoft.FSharp.Data&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs4&quot;&gt;val not : value:bool -&amp;gt; bool&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.not&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs5&quot;&gt;module String&lt;br /&gt;&lt;br /&gt;from Microsoft.FSharp.Core&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs6&quot;&gt;val printfn : format:Printf.TextWriterFormat&amp;lt;&amp;#39;T&amp;gt; -&amp;gt; &amp;#39;T&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.printfn&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs7&quot;&gt;module Seq&lt;br /&gt;&lt;br /&gt;from Microsoft.FSharp.Collections&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs8&quot;&gt;val map : mapping:(&amp;#39;T -&amp;gt; &amp;#39;U) -&amp;gt; source:seq&amp;lt;&amp;#39;T&amp;gt; -&amp;gt; seq&amp;lt;&amp;#39;U&amp;gt;&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Seq.map&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs9&quot;&gt;val box : value:&amp;#39;T -&amp;gt; obj&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.box&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs10&quot;&gt;val unbox : value:obj -&amp;gt; &amp;#39;T&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.unbox&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs11&quot;&gt;Multiple items&lt;br /&gt;val string : value:&amp;#39;T -&amp;gt; string&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.string&lt;br /&gt;&lt;br /&gt;--------------------&lt;br /&gt;type string = System.String&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.string&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Enterprise Goggles.</title>
   <link href="http://colinbull.github.io/2016/05/16/Enterprise-Optics/"/>
   <updated>2016-05-16T00:00:00+00:00</updated>
   <id>http://colinbull.github.io/2016/05/16/Enterprise-Optics</id>
   <content type="html">&lt;h2&gt;&lt;a name=&quot;A-typical-enterprise-problem&quot; class=&quot;anchor&quot; href=&quot;#A-typical-enterprise-problem&quot;&gt;A typical enterprise problem&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;Based on a gut feel and no real evidence :) apart from my own experience I would say that a large proportion of enterprise applications are essentially just some sort of Extract - Transform - Load for system A to system B.&lt;/p&gt;

&lt;p&gt;For the sake of argument, lets say that the requirement for our application is to read data from a &lt;a href=&quot;/code/data/lenses/source_data.xml&quot;&gt;XML file&lt;/a&gt;, apply some transformation (say convert the sizes to a standard size definition S, M, L, XL) and then write it out to another CSV file.&lt;/p&gt;

&lt;p&gt;So we can start by defining to functions to convert the sizes&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt; 1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 8: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 9: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;10: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;11: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;12: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;13: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;longSizeToShortSize&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; 
        | &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Small&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;S&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
        | &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Medium&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;M&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
        | &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Large&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;L&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
        | &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Extra&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Large&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;XL&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
        | &lt;span class=&quot;i&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;a&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;shortSizeToLongSize&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt;  
        | &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;S&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Small&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
        | &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;M&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Medium&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
        | &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;L&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Large&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
        | &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;XL&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Extra&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Large&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
        | &lt;span class=&quot;i&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;a&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;Now this is a fairly trivial problem, to solve and there are many ways to do it, for example a one solution might be to use a type provider and a simple CSV File representation do something like the following.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt; 1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 8: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 9: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;10: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;11: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;12: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;13: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;14: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;15: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;16: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;17: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;18: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
    &lt;span class=&quot;k&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Catalog&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;XmlProvider&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;lenses&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;source_data&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;xml&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;run&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs10', 61)&quot; onmouseover=&quot;showTip(event, 'fs10', 61)&quot; class=&quot;i&quot;&gt;string&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;  
        &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Catalog&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Load&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;path&lt;/span&gt;)
        &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
            [|
                &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;product&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Products&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
                    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;catalogItem&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;product&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;CatalogItems&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
                    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;size&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;catalogItem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Sizes&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
                        &lt;span class=&quot;k&quot;&gt;yield&lt;/span&gt; [| &lt;span class=&quot;i&quot;&gt;catalogItem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;ItemNumber&lt;/span&gt; 
                                 &lt;span class=&quot;i&quot;&gt;product&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Description&lt;/span&gt; 
                                 &lt;span class=&quot;i&quot;&gt;catalogItem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Gender&lt;/span&gt;
                                 &lt;span class=&quot;i&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Description&lt;/span&gt;
                                 &lt;span class=&quot;i&quot;&gt;longSizeToShortSize&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Description&lt;/span&gt;
                                 &lt;span class=&quot;i&quot;&gt;catalogItem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Price&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs10', 62)&quot; onmouseover=&quot;showTip(event, 'fs10', 62)&quot; class=&quot;i&quot;&gt;string&lt;/span&gt;
                              |]
            |]
        &lt;span class=&quot;i&quot;&gt;Csv&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Create&lt;/span&gt;([|&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;item_no&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;gender&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;short_size&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;price&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;|],&lt;span class=&quot;i&quot;&gt;data&lt;/span&gt;)&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;which gives us&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt; 1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 8: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 9: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;10: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;11: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;12: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;13: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;i&quot;&gt;item_no&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;description&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;gender&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;size&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;short_size&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;price&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;QWZ5671&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Sweater&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Men&amp;#39;s&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Medium&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;M&lt;/span&gt;,&lt;span class=&quot;n&quot;&gt;39.95&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;QWZ5671&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Sweater&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Men&amp;#39;s&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Large&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;L&lt;/span&gt;,&lt;span class=&quot;n&quot;&gt;39.95&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;RRX9856&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Sweater&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Women&amp;#39;s&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Small&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;S&lt;/span&gt;,&lt;span class=&quot;n&quot;&gt;42.50&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;RRX9856&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Sweater&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Women&amp;#39;s&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Medium&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;M&lt;/span&gt;,&lt;span class=&quot;n&quot;&gt;42.50&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;RRX9856&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Sweater&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Women&amp;#39;s&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Large&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;L&lt;/span&gt;,&lt;span class=&quot;n&quot;&gt;42.50&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;RRX9856&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Sweater&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Women&amp;#39;s&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Extra&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Large&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;XL&lt;/span&gt;,&lt;span class=&quot;n&quot;&gt;42.50&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;QWZ8976&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Shirt&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Men&amp;#39;s&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Medium&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;M&lt;/span&gt;,&lt;span class=&quot;n&quot;&gt;39.95&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;QWZ8976&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Shirt&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Men&amp;#39;s&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Large&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;L&lt;/span&gt;,&lt;span class=&quot;n&quot;&gt;39.95&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;RRX345&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Shirt&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Women&amp;#39;s&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Small&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;S&lt;/span&gt;,&lt;span class=&quot;n&quot;&gt;42.50&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;RRX345&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Shirt&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Women&amp;#39;s&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Medium&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;M&lt;/span&gt;,&lt;span class=&quot;n&quot;&gt;42.50&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;RRX345&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Shirt&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Women&amp;#39;s&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Large&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;L&lt;/span&gt;,&lt;span class=&quot;n&quot;&gt;42.50&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;RRX345&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Shirt&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Women&amp;#39;s&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Extra&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Large&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;XL&lt;/span&gt;,&lt;span class=&quot;n&quot;&gt;42.50&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;this implementation is all well and good for a one off. It works and is maintainable, in the sense that the code is consise and easy to follow. However there are a few issues. Since this is the enterprise, everytime a business process changes or a external regulatory change happens it is likely that the data format is going to change. It would therefore be nice to be able to change the format without having to re-write everything, in fact in enterprises I have seen release times beyond 6 weeks, so ideally we would like to push as much to scripts or configuation as we can. Also some type providers don't deal well with data that isn't in the same format (missing nodes / properties) as the example provided at compile time; Additionally because they are typically erased, reflection is out of the question, so putting the property mapping in a configuration file, is made significantly more complicated. Now of-course we can always introduce some higher-order functions to abstract aways these problems, but this would be specific to this solution. It would be nice to try and solve this in a more general way.&lt;/p&gt;

&lt;h2&gt;&lt;a name=&quot;Introducing-Optics&quot; class=&quot;anchor&quot; href=&quot;#Introducing-Optics&quot;&gt;Introducing Optics&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;At &lt;a href=&quot;https://skillsmatter.com/conferences/7145-f-exchange-2016#program&quot;&gt;F# exchange&lt;/a&gt;, I got into a couple of conversations around enterprise development and the patterns that I use when developing line of business applications with F#. Typically the discussion focused on the lack of need for patterns. This is mainly due F#'s strong type system and the fact that higher order functions are a &lt;a href=&quot;https://www.infoq.com/presentations/fp-design-patterns&quot;&gt;pretty powerful abstraction&lt;/a&gt;. However one topic that promoted a certain amount of contention was Lenses or more generally Optics.&lt;/p&gt;

&lt;p&gt;Now I can't say I am surprised by this there are a couple of reasons why,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Performance&lt;/em&gt; - Extra Allocations caused by individually setting properties on records can have a reasonable performace impact when used in time critical code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;No Language Support&lt;/em&gt; - Writing lenses for records can be a large overhead and currently there is no language support. Maybe this will happen in the &lt;a href=&quot;https://fslang.uservoice.com/forums/245727-f-language/suggestions/6906132-implement-first-class-lensing-lenses-in-f&quot;&gt;future&lt;/a&gt; who knows??&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With this considered thou, performance is often not so important in the enterprise, and even maintainability is often sacrificed in the aim of making things flexible. Now there is probably an entire other blog post around why this is the case but thats for another day. So what does an optic solution look like to this problem. Well we can first start by defining some Optics over an XML structure accessed using XPATH and one over CSV.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt; 1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 8: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 9: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;10: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;11: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;12: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;13: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;14: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;15: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;16: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;17: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;18: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;19: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;20: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;21: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;22: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;23: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;24: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;25: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;26: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;27: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;28: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;29: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;xpath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs10', 63)&quot; onmouseover=&quot;showTip(event, 'fs10', 63)&quot; class=&quot;i&quot;&gt;string&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Lens&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;XElement&lt;/span&gt;, _&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
        (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;XPathEvaluate&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;path&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;:?&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;IEnumerable&lt;/span&gt;)&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Cast&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;()&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;FirstOrDefault&lt;/span&gt;()),
        (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;)

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;xml&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;defaultV&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;path&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
        &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;getValue&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;defaultV&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs27', 64)&quot; onmouseover=&quot;showTip(event, 'fs27', 64)&quot; class=&quot;i&quot;&gt;obj&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
          &lt;span class=&quot;k&quot;&gt;match&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;with&lt;/span&gt;
          | &lt;span class=&quot;k&quot;&gt;null&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;defaultV&lt;/span&gt;
          | &lt;span class=&quot;o&quot;&gt;:?&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;XAttribute&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt;
          | &lt;span class=&quot;o&quot;&gt;:?&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;XElement&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;e&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt;
          | _ &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs17', 65)&quot; onmouseover=&quot;showTip(event, 'fs17', 65)&quot; class=&quot;i&quot;&gt;failwithf&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;unable&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;O&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;

        &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;setValue&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs27', 66)&quot; onmouseover=&quot;showTip(event, 'fs27', 66)&quot; class=&quot;i&quot;&gt;obj&lt;/span&gt;) &lt;span class=&quot;i&quot;&gt;v&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
            &lt;span class=&quot;k&quot;&gt;match&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;with&lt;/span&gt;
            | &lt;span class=&quot;o&quot;&gt;:?&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;XAttribute&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;SetValue&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;v&lt;/span&gt;)
            | &lt;span class=&quot;o&quot;&gt;:?&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;XElement&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;e&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;SetValue&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;v&lt;/span&gt;)
            | _ &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs17', 67)&quot; onmouseover=&quot;showTip(event, 'fs17', 67)&quot; class=&quot;i&quot;&gt;failwithf&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;unable&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;O&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;
            &lt;span onmouseout=&quot;hideTip(event, 'fs28', 68)&quot; onmouseover=&quot;showTip(event, 'fs28', 68)&quot; class=&quot;i&quot;&gt;unbox&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;_&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;
        
        &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;l&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Lens&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;_,_&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;getValue&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;defaultV&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;), (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;setValue&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;s&lt;/span&gt;)
        &lt;span class=&quot;i&quot;&gt;xpath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;path&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;l&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;xattr&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;xml&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;XAttribute&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;xelem&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;xml&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;XElement&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; 

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;csv&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;indx&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;col&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs10', 69)&quot; onmouseover=&quot;showTip(event, 'fs10', 69)&quot; class=&quot;i&quot;&gt;string&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Prism&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Csv&lt;/span&gt;, _&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
        (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;GetValue&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;col&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;indx&lt;/span&gt;)),
        (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;SetValue&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;col&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;indx&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;s&lt;/span&gt;); &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;)&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;Here I am using &lt;a href=&quot;https://github.com/xyncro/aether&quot;&gt;Aether&lt;/a&gt; a lens library by Andrew Cherry and a simple (CSV file representation)[&lt;a href=&quot;https://gist.github.com/colinbull/60797d5377be4d841f51e4f0776a24fa&quot;&gt;https://gist.github.com/colinbull/60797d5377be4d841f51e4f0776a24fa&lt;/a&gt;] but you could use anything. If you have never used Optics or just simply want a refresher then I might suggest the guide to Aether which can be found (here)[&lt;a href=&quot;https://xyncro.tech/aether/guides/&quot;&gt;https://xyncro.tech/aether/guides/&lt;/a&gt;]. Also after you have read that guide you may notice that I'm not defining Optics per se, instead I'm defining functions that return optics a subtle but important distinction.&lt;/p&gt;

&lt;p&gt;Now we have our optics (sorry, functions) we can define our mappings. But first we need to add a little extra to our domain functions, so we can use them with Optics. In terms of transformations there are three things we can compose with Optics. Optics, Isomorphisms (a reversible function e.g. &lt;code&gt;string -&amp;gt; char[]&lt;/code&gt; and &lt;code&gt;char[] -&amp;gt; string&lt;/code&gt;) and Epimorphisms (which is a weaker version of the Isomorphism in that the left hand conversion may fail e.g. &lt;code&gt;string -&amp;gt; char[] option&lt;/code&gt; and &lt;code&gt;char[] -&amp;gt; string&lt;/code&gt;). For our little problem we only need to concern ourselves with the former since we have a total function (since we include the unknown mappings). So we can define our isomorphism as follows.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;3: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;shortSize&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Isomorphism&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;_,_&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
        &lt;span class=&quot;i&quot;&gt;shortSizeToLongSize&lt;/span&gt;,
        &lt;span class=&quot;i&quot;&gt;longSizeToShortSize&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;Now we can represent our mappings as a simple list of tuples the first item in the tuple is the optic we shall use to read the data using XPATH, the second item is the optic we shall use to set the data (pop it into our CSV file representation).&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;8: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;9: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;mappings&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;indx&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;  
        [
           &lt;span class=&quot;i&quot;&gt;xelem&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;parent&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;catalog_item&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;item_number&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;, (&lt;span class=&quot;i&quot;&gt;csv&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;indx&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;item_no&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;)
           &lt;span class=&quot;i&quot;&gt;xattr&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;ancestor&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;product&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;, (&lt;span class=&quot;i&quot;&gt;csv&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;indx&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;)
           &lt;span class=&quot;i&quot;&gt;xattr&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;parent&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;catalog_item&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;gender&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;, (&lt;span class=&quot;i&quot;&gt;csv&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;indx&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;gender&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;)
           &lt;span class=&quot;i&quot;&gt;xattr&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;, (&lt;span class=&quot;i&quot;&gt;csv&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;indx&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;)
           &lt;span class=&quot;i&quot;&gt;xattr&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;, (&lt;span class=&quot;i&quot;&gt;csv&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;indx&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;short_size&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;?&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;shortSize&lt;/span&gt;)
           &lt;span class=&quot;i&quot;&gt;xelem&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;parent&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;catalog_item&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;price&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;, (&lt;span class=&quot;i&quot;&gt;csv&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;indx&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;price&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;)       
        ]&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;Now we have our mappings along with our transformations we need to actually be able to run this code. This is where things get a little bit nasty.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt; 1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 8: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 9: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;10: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;inline&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;etl&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;transform&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;load&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;extract&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
        &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;inline&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;getSet&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;get&lt;/span&gt;,&lt;span onmouseout=&quot;hideTip(event, 'fs29', 70)&quot; onmouseover=&quot;showTip(event, 'fs29', 70)&quot; class=&quot;i&quot;&gt;set&lt;/span&gt;) &lt;span class=&quot;i&quot;&gt;load&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;source&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;Optic&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;get&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;get&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;source&lt;/span&gt;)
            &lt;span class=&quot;i&quot;&gt;Optic&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs29', 71)&quot; onmouseover=&quot;showTip(event, 'fs29', 71)&quot; class=&quot;i&quot;&gt;set&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs29', 72)&quot; onmouseover=&quot;showTip(event, 'fs29', 72)&quot; class=&quot;i&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;load&lt;/span&gt;

        &lt;span class=&quot;i&quot;&gt;extract&lt;/span&gt;()
        &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs18', 73)&quot; onmouseover=&quot;showTip(event, 'fs18', 73)&quot; class=&quot;i&quot;&gt;Seq&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs30', 74)&quot; onmouseover=&quot;showTip(event, 'fs30', 74)&quot; class=&quot;i&quot;&gt;indexed&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs18', 75)&quot; onmouseover=&quot;showTip(event, 'fs18', 75)&quot; class=&quot;i&quot;&gt;Seq&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs31', 76)&quot; onmouseover=&quot;showTip(event, 'fs31', 76)&quot; class=&quot;i&quot;&gt;fold&lt;/span&gt; (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;loader&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;rowNumber&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;) &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; 
                        (&lt;span class=&quot;i&quot;&gt;transform&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;rowNumber&lt;/span&gt;)
                        &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs18', 77)&quot; onmouseover=&quot;showTip(event, 'fs18', 77)&quot; class=&quot;i&quot;&gt;Seq&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs31', 78)&quot; onmouseover=&quot;showTip(event, 'fs31', 78)&quot; class=&quot;i&quot;&gt;fold&lt;/span&gt; (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;loader&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;mapping&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;getSet&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;mapping&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;loader&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;) &lt;span class=&quot;i&quot;&gt;loader&lt;/span&gt;) &lt;span class=&quot;i&quot;&gt;load&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;URRGH!! WTF! But as nasty as this function looks, it is actaully quiet simple; and completely general and only needs to be written once. It simply iterates over the incoming data and applies an index to this data, this represents the row number. We then fold over this indexed data, with each fold we fold over each over the mappings, reading from the first optic supplied by the mappings list then sending the value to the second optic, because of the definition lenses of setting the value means it returns to object the value was applied to, which is then returned by the fold.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;5: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;extract&lt;/span&gt;() &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;path&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;__SOURCE_DIRECTORY__&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;lenses&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;source_data&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;xml&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;i&quot;&gt;XDocument&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Load&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;path&lt;/span&gt;)&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;XPathSelectElements&lt;/span&gt;(&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;catalog_item&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;)

    &lt;span class=&quot;i&quot;&gt;etl&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;mappings&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Csv&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Empty&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;extract&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;This returns the same as out original solution which is good,&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt; 1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 8: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 9: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;10: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;11: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;12: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;13: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;i&quot;&gt;item_no&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;description&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;gender&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;size&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;short_size&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;price&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;QWZ5671&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Sweater&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Men&amp;#39;s&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Medium&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;M&lt;/span&gt;,&lt;span class=&quot;n&quot;&gt;39.95&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;QWZ5671&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Sweater&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Men&amp;#39;s&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Large&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;L&lt;/span&gt;,&lt;span class=&quot;n&quot;&gt;39.95&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;RRX9856&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Sweater&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Women&amp;#39;s&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Small&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;S&lt;/span&gt;,&lt;span class=&quot;n&quot;&gt;42.50&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;RRX9856&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Sweater&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Women&amp;#39;s&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Medium&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;M&lt;/span&gt;,&lt;span class=&quot;n&quot;&gt;42.50&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;RRX9856&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Sweater&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Women&amp;#39;s&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Large&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;L&lt;/span&gt;,&lt;span class=&quot;n&quot;&gt;42.50&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;RRX9856&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Sweater&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Women&amp;#39;s&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Extra&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Large&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;XL&lt;/span&gt;,&lt;span class=&quot;n&quot;&gt;42.50&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;QWZ8976&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Shirt&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Men&amp;#39;s&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Medium&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;M&lt;/span&gt;,&lt;span class=&quot;n&quot;&gt;39.95&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;QWZ8976&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Shirt&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Men&amp;#39;s&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Large&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;L&lt;/span&gt;,&lt;span class=&quot;n&quot;&gt;39.95&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;RRX345&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Shirt&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Women&amp;#39;s&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Small&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;S&lt;/span&gt;,&lt;span class=&quot;n&quot;&gt;42.50&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;RRX345&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Shirt&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Women&amp;#39;s&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Medium&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;M&lt;/span&gt;,&lt;span class=&quot;n&quot;&gt;42.50&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;RRX345&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Shirt&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Women&amp;#39;s&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Large&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;L&lt;/span&gt;,&lt;span class=&quot;n&quot;&gt;42.50&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;RRX345&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Shirt&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Women&amp;#39;s&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;Extra&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Large&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;XL&lt;/span&gt;,&lt;span class=&quot;n&quot;&gt;42.50&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;and now the mapping is essentially just data. However it is still compiled, so all we have really bought ourselves is turning the mappings into a list. Or have we? Lets have a closer look.&lt;/p&gt;

&lt;p&gt;When we defined our lenses and transformations we defined things in a very specific way. The reason for this is for composablility, the lens solution allows us to implement pretty much any mapping and transformation we want without ever changing the overall structure of the solution. If I wanted to for example write this to a .NET datatable rather than CSV file then I create a function that provides, getters and setters to an instance of a datatable replace that with the CSV ones. In addition the Optic over the datatable can then be put as a gist, shared assembly or however you use common code and re-used.&lt;/p&gt;

&lt;p&gt;So, what do you think? Are optics worth it? In my opinion apart from the plumbing code &lt;code&gt;etl&lt;/code&gt; function (which is written once) the rest of the code is very simple and could be read by anyone, even maybe the business; which at the end of the day is what all enterprise devs try to acheive as it makes, their lives that little bit easier :).&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Many YAK's have been shorn but none hurt&lt;/em&gt;&lt;/p&gt;


&lt;div class=&quot;tip&quot; id=&quot;fs1&quot;&gt;namespace System&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs2&quot;&gt;namespace System.Linq&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs3&quot;&gt;namespace System.Collections&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs4&quot;&gt;namespace System.Collections.Generic&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs5&quot;&gt;namespace System.Xml&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs6&quot;&gt;namespace Microsoft.FSharp.Linq&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs7&quot;&gt;namespace System.Xml.XPath&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs8&quot;&gt;module Operators&lt;br /&gt;&lt;br /&gt;from Microsoft.FSharp.Core&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs9&quot;&gt;namespace Microsoft.FSharp.Data&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs10&quot;&gt;Multiple items&lt;br /&gt;val string : value:&amp;#39;T -&amp;gt; string&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.string&lt;br /&gt;&lt;br /&gt;--------------------&lt;br /&gt;type string = System.String&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.string&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs11&quot;&gt;type ResizeArray&amp;lt;&amp;#39;T&amp;gt; = System.Collections.Generic.List&amp;lt;&amp;#39;T&amp;gt;&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.ResizeArray&amp;lt;_&amp;gt;&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs12&quot;&gt;union case Option.Some: Value: &amp;#39;T -&amp;gt; Option&amp;lt;&amp;#39;T&amp;gt;&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs13&quot;&gt;module Array&lt;br /&gt;&lt;br /&gt;from Microsoft.FSharp.Collections&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs14&quot;&gt;val map : mapping:(&amp;#39;T -&amp;gt; &amp;#39;U) -&amp;gt; array:&amp;#39;T [] -&amp;gt; &amp;#39;U []&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Array.map&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs15&quot;&gt;union case Option.None: Option&amp;lt;&amp;#39;T&amp;gt;&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs16&quot;&gt;val defaultArg : arg:&amp;#39;T option -&amp;gt; defaultValue:&amp;#39;T -&amp;gt; &amp;#39;T&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.defaultArg&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs17&quot;&gt;val failwithf : format:Printf.StringFormat&amp;lt;&amp;#39;T,&amp;#39;Result&amp;gt; -&amp;gt; &amp;#39;T&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.failwithf&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs18&quot;&gt;module Seq&lt;br /&gt;&lt;br /&gt;from Microsoft.FSharp.Collections&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs19&quot;&gt;val tryItem : index:int -&amp;gt; source:seq&amp;lt;&amp;#39;T&amp;gt; -&amp;gt; &amp;#39;T option&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Seq.tryItem&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs20&quot;&gt;val tryFindIndex : predicate:(&amp;#39;T -&amp;gt; bool) -&amp;gt; source:seq&amp;lt;&amp;#39;T&amp;gt; -&amp;gt; int option&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Seq.tryFindIndex&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs21&quot;&gt;module Option&lt;br /&gt;&lt;br /&gt;from Microsoft.FSharp.Core&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs22&quot;&gt;val bind : binder:(&amp;#39;T -&amp;gt; &amp;#39;U option) -&amp;gt; option:&amp;#39;T option -&amp;gt; &amp;#39;U option&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Option.bind&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs23&quot;&gt;val toArray : source:seq&amp;lt;&amp;#39;T&amp;gt; -&amp;gt; &amp;#39;T []&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Seq.toArray&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs24&quot;&gt;module String&lt;br /&gt;&lt;br /&gt;from Microsoft.FSharp.Core&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs25&quot;&gt;val concat : sep:string -&amp;gt; strings:seq&amp;lt;string&amp;gt; -&amp;gt; string&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.String.concat&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs26&quot;&gt;val ignore : value:&amp;#39;T -&amp;gt; unit&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.ignore&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs27&quot;&gt;type obj = System.Object&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.obj&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs28&quot;&gt;val unbox : value:obj -&amp;gt; &amp;#39;T&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.unbox&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs29&quot;&gt;val set : elements:seq&amp;lt;&amp;#39;T&amp;gt; -&amp;gt; Set&amp;lt;&amp;#39;T&amp;gt; (requires comparison)&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.set&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs30&quot;&gt;val indexed : source:seq&amp;lt;&amp;#39;T&amp;gt; -&amp;gt; seq&amp;lt;int * &amp;#39;T&amp;gt;&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Seq.indexed&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs31&quot;&gt;val fold : folder:(&amp;#39;State -&amp;gt; &amp;#39;T -&amp;gt; &amp;#39;State) -&amp;gt; state:&amp;#39;State -&amp;gt; source:seq&amp;lt;&amp;#39;T&amp;gt; -&amp;gt; &amp;#39;State&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Seq.fold&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Why I like F#.</title>
   <link href="http://colinbull.github.io/2015/03/24/Why-I-Like-FSharp/"/>
   <updated>2015-03-24T00:00:00+00:00</updated>
   <id>http://colinbull.github.io/2015/03/24/Why-I-Like-FSharp</id>
   <content type="html">&lt;p&gt;Recently Dr. James McCaffery, posted &lt;a href=&quot;https://jamesmccaffrey.wordpress.com/2015/03/01/why-i-dont-like-the-f-language/&quot;&gt;Why he doesn't like the F# language&lt;/a&gt;. Quite a few of his points are subjective. People have different preferences and it seems like F# and more generally functional programming takes him outside of this comfort zone. This is fine, and I have absolutly no objections about views like this. I have a similar feeling when I'm in C# or Java. I don't feel safe, or comfortable, again it is just a preference thing.&lt;/p&gt;

&lt;p&gt;However, there are a few points raised in the blog post that I don't really agree with. I'll tackle each one seperately not to loose any context.&lt;/p&gt;

&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;F# has a tiny user base.&lt;/li&gt;
&lt;/ol&gt;

  &lt;p&gt;I did a quick search on the day I wrote this post at a job aggregation site and found 109 job listings that mentioned F#. There were over 34,000 job listings that mentioned C#. And at MSDN Magazine, where I'm the Senior Contributing Editor, our F# articles get very few reads. The tiny user base means there is relatively weak community technical support on sites like Stack Overflow, compared to mainstream languages. Additionally, unlike other languages with relatively few users (such as R), there`s no real motivation for me to adopt F# from a career point of view, because of the very limited job opportunities.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;While I somewhat agree, that F# adoption in industry has been slow. I think alot of this is to do with the fact that in the early days F# wasn't pushed as a general purpose programming language. This was obviously a marketing decision made in Microsoft, for reasons that are unknown to me. This decision caused an elitist view of F# in the early days with the preception that you need a advanced degree in a mathematical subject to use it, categorising it as only being good for Data Science, Finance, Mathematics and Research. Thus these areas were the early adoptors. In fact a quick browse of the &lt;a href=&quot;http://www.fsharp.org/testimonials&quot;&gt;testimonials page&lt;/a&gt; on FSharp.org backs this up. With testimonails coming from one of these areas. There are of course some exceptions most notably the design of Louvre in Abu Dhabi and it's use at GameSys.&lt;/p&gt;

&lt;p&gt;However this metric is only one dimension and just because there are currently only a few jobs in a language doesn't mean you should not learn it. I'm currently learning langauges like Haskell, Coq and Idris. For the latter I doubt there is a single role in this country (although I'm willing to be proved wrong on this). Why do I do this? I hear you ask. Well I believe by learning different langauges and paradigms pushes me slightly out of my comfort zone and makes me a better programmer, in which-ever language I ultimately end up coding a commercial product in.&lt;/p&gt;

&lt;p&gt;With the commercial prospects aside a conslusion is drawn that a small user base =&gt; a weak technical community. I don't know about other languages but I can categorically say that with F# this is simply not true. In fact, as I started writing this blog post, I raised an issue in the &lt;a href=&quot;https://github.com/fsprojects/Paket/issues/719#event-263240044&quot;&gt;Paket&lt;/a&gt; project on github and within an hour, I had a fix presented too me.&lt;/p&gt;

&lt;p&gt;For other sites like Stack Overflow, I can't really comment on the experience as I don't tend to use it much myself. However we can use F# to do some data munging to see how the community it doing. i.e. What is the average time for questions with an accepted answer to have got that answer?&lt;/p&gt;

&lt;p&gt;To acheive this we can download the first 10000 questions with the F# tag, and write the result of each request out to a set of files.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt; 1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 8: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 9: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;10: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;11: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;12: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;13: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;14: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;15: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;16: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;17: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;18: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;19: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;20: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;baseUri&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;https&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;api&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;stackexchange&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;com&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; [&amp;lt;&lt;span onmouseout=&quot;hideTip(event, 'fs18', 27)&quot; onmouseover=&quot;showTip(event, 'fs18', 27)&quot; class=&quot;i&quot;&gt;Literal&lt;/span&gt;&amp;gt;] &lt;span class=&quot;i&quot;&gt;dataPath&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;__SOURCE_DIRECTORY__&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;stackoverflow&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;dataDir&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;path&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;DirectoryInfo&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;dataPath&lt;/span&gt;)
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs19', 28)&quot; onmouseover=&quot;showTip(event, 'fs19', 28)&quot; class=&quot;i&quot;&gt;not&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Exists&lt;/span&gt;)
    &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Create&lt;/span&gt;()
    &lt;span class=&quot;i&quot;&gt;path&lt;/span&gt;
    
&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;getQuestions&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;page&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;outputPath&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;FileInfo&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;Path&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Combine&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;dataDir&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;FullName&lt;/span&gt;, &lt;span onmouseout=&quot;hideTip(event, 'fs20', 29)&quot; onmouseover=&quot;showTip(event, 'fs20', 29)&quot; class=&quot;i&quot;&gt;sprintf&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;questions_&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;questions&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;page&lt;/span&gt;))
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;(&lt;span onmouseout=&quot;hideTip(event, 'fs19', 30)&quot; onmouseover=&quot;showTip(event, 'fs19', 30)&quot; class=&quot;i&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;|&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;outputPath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Exists&lt;/span&gt;)
    &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;results&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;

            &lt;span class=&quot;i&quot;&gt;Http&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;RequestString&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;baseUri&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs20', 31)&quot; onmouseover=&quot;showTip(event, 'fs20', 31)&quot; class=&quot;i&quot;&gt;sprintf&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;page&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;page&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;pagesize&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;order&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;desc&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;sort&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;creation&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;tagged&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;23&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;site&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;stackoverflow&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;)
        &lt;span class=&quot;i&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;WriteAllText&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;outputPath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;FullName&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;results&lt;/span&gt;)

&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;writeQuestions&lt;/span&gt;() &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
    [&lt;span class=&quot;n&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;..&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;100&lt;/span&gt;] &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs21', 32)&quot; onmouseover=&quot;showTip(event, 'fs21', 32)&quot; class=&quot;i&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs22', 33)&quot; onmouseover=&quot;showTip(event, 'fs22', 33)&quot; class=&quot;i&quot;&gt;iter&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;getQuestions&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;Next we can merge all of these questions using the &lt;a href=&quot;http://fsharp.github.io/FSharp.Data/library/JsonProvider.html&quot;&gt;Json type provider&lt;/a&gt; into a single list,&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;8: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; [&amp;lt;&lt;span onmouseout=&quot;hideTip(event, 'fs18', 34)&quot; onmouseover=&quot;showTip(event, 'fs18', 34)&quot; class=&quot;i&quot;&gt;Literal&lt;/span&gt;&amp;gt;] &lt;span class=&quot;i&quot;&gt;questionPath&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;dataPath&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;questions&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Questions&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;JsonProvider&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;questionPath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;questions&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
    [
       &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt;  &lt;span class=&quot;i&quot;&gt;dataDir&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;EnumerateFiles&lt;/span&gt;(&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;questions&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;) &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
           &lt;span class=&quot;k&quot;&gt;yield!&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Questions&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Load&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;FullName&lt;/span&gt;)&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Items&lt;/span&gt;
    ]&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;Next up is getting the accepted answers. Firstly we build a map of the accepted answersId against the questions so we can relate them again later, then we use &lt;code&gt;getAcceptedAnswers&lt;/code&gt; to chunk the requests and write the results out to a file. Once we have the results we again use the Json type provider to merge the results up into a single list.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt; 1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 8: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 9: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;10: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;11: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;12: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;13: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;14: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;15: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;16: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;17: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;18: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;19: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;20: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;21: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;22: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;23: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;24: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;25: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;26: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;27: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;28: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;29: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;30: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;31: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;32: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;33: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;34: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;35: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;36: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;37: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;questionAnswerMap&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
    &lt;span class=&quot;i&quot;&gt;questions&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs13', 35)&quot; onmouseover=&quot;showTip(event, 'fs13', 35)&quot; class=&quot;i&quot;&gt;Seq&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs23', 36)&quot; onmouseover=&quot;showTip(event, 'fs23', 36)&quot; class=&quot;i&quot;&gt;fold&lt;/span&gt; (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;state&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;question&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;match&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;question&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;AcceptedAnswerId&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;with&lt;/span&gt;
        | &lt;span onmouseout=&quot;hideTip(event, 'fs24', 37)&quot; onmouseover=&quot;showTip(event, 'fs24', 37)&quot; class=&quot;i&quot;&gt;Some&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;answerId&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;answerId&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;question&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;state&lt;/span&gt;  
        | &lt;span onmouseout=&quot;hideTip(event, 'fs25', 38)&quot; onmouseover=&quot;showTip(event, 'fs25', 38)&quot; class=&quot;i&quot;&gt;None&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;state&lt;/span&gt;
    ) []  
    &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs26', 39)&quot; onmouseover=&quot;showTip(event, 'fs26', 39)&quot; class=&quot;i&quot;&gt;Map&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs27', 40)&quot; onmouseover=&quot;showTip(event, 'fs27', 40)&quot; class=&quot;i&quot;&gt;ofSeq&lt;/span&gt;
    
&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;getAcceptedAnswers&lt;/span&gt;() &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;answerIds&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
        &lt;span class=&quot;i&quot;&gt;questionAnswerMap&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs26', 41)&quot; onmouseover=&quot;showTip(event, 'fs26', 41)&quot; class=&quot;i&quot;&gt;Map&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs28', 42)&quot; onmouseover=&quot;showTip(event, 'fs28', 42)&quot; class=&quot;i&quot;&gt;toSeq&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs13', 43)&quot; onmouseover=&quot;showTip(event, 'fs13', 43)&quot; class=&quot;i&quot;&gt;Seq&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs29', 44)&quot; onmouseover=&quot;showTip(event, 'fs29', 44)&quot; class=&quot;i&quot;&gt;map&lt;/span&gt; (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;answerId&lt;/span&gt;,_) &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;answerId&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;ToString&lt;/span&gt;())

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;counter&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs7', 45)&quot; onmouseover=&quot;showTip(event, 'fs7', 45)&quot; class=&quot;i&quot;&gt;ref&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;1&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;answers&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;chunkBySize&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;answerIds&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;outputPath&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;FileInfo&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;Path&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Combine&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;dataDir&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;FullName&lt;/span&gt;, &lt;span onmouseout=&quot;hideTip(event, 'fs20', 46)&quot; onmouseover=&quot;showTip(event, 'fs20', 46)&quot; class=&quot;i&quot;&gt;sprintf&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;answers_&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;answers&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;counter&lt;/span&gt;))
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; (&lt;span onmouseout=&quot;hideTip(event, 'fs19', 47)&quot; onmouseover=&quot;showTip(event, 'fs19', 47)&quot; class=&quot;i&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;|&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;outputPath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Exists&lt;/span&gt;)
        &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;answersStr&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs30', 48)&quot; onmouseover=&quot;showTip(event, 'fs30', 48)&quot; class=&quot;i&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Join&lt;/span&gt;(&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;answers&lt;/span&gt;)
            &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;answers&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
                &lt;span class=&quot;i&quot;&gt;Http&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;RequestString&lt;/span&gt;(
                     &lt;span class=&quot;i&quot;&gt;baseUri&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs20', 49)&quot; onmouseover=&quot;showTip(event, 'fs20', 49)&quot; class=&quot;i&quot;&gt;sprintf&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;answers&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;order&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;desc&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;sort&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;creation&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;site&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;stackoverflow&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;answersStr&lt;/span&gt;
                )
            &lt;span onmouseout=&quot;hideTip(event, 'fs31', 50)&quot; onmouseover=&quot;showTip(event, 'fs31', 50)&quot; class=&quot;i&quot;&gt;printfn&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Writing&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;answers&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;outputPath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;FullName&lt;/span&gt;
            &lt;span class=&quot;i&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;WriteAllText&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;outputPath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;FullName&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;answers&lt;/span&gt;)
            &lt;span onmouseout=&quot;hideTip(event, 'fs32', 51)&quot; onmouseover=&quot;showTip(event, 'fs32', 51)&quot; class=&quot;i&quot;&gt;incr&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;counter&lt;/span&gt;)

&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; [&amp;lt;&lt;span onmouseout=&quot;hideTip(event, 'fs18', 52)&quot; onmouseover=&quot;showTip(event, 'fs18', 52)&quot; class=&quot;i&quot;&gt;Literal&lt;/span&gt;&amp;gt;] &lt;span class=&quot;i&quot;&gt;answersPath&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;dataPath&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;answers&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Answers&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;JsonProvider&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;answersPath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;answers&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
    [
       &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt;  &lt;span class=&quot;i&quot;&gt;dataDir&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;EnumerateFiles&lt;/span&gt;(&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;answers&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;) &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
           &lt;span class=&quot;k&quot;&gt;yield!&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Answers&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Load&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;FullName&lt;/span&gt;)&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Items&lt;/span&gt;
    ]&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;Next up we pair the questions with the accepted answers.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;7: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;mergeQuestionAnswers&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
    [
        &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;answer&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;answers&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;match&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;questionAnswerMap&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;TryFind&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;answer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;AnswerId&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;with&lt;/span&gt;
            | &lt;span onmouseout=&quot;hideTip(event, 'fs24', 53)&quot; onmouseover=&quot;showTip(event, 'fs24', 53)&quot; class=&quot;i&quot;&gt;Some&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;question&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;yield&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;question&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;answer&lt;/span&gt;
            | &lt;span onmouseout=&quot;hideTip(event, 'fs25', 54)&quot; onmouseover=&quot;showTip(event, 'fs25', 54)&quot; class=&quot;i&quot;&gt;None&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; ()            
    ]&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;And we are now at a point where we can compute some statistics around the questions.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt; 1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 8: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 9: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;10: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;11: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;12: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;13: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;14: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;15: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;getTimeToClose&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;question&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Questions&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Item&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;answer&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Answers&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Item&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
    (&lt;span class=&quot;i&quot;&gt;unixToDateTime&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;answer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;CreationDate&lt;/span&gt;)&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Subtract&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;unixToDateTime&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;question&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;CreationDate&lt;/span&gt;)&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;TotalHours&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;statsByYear&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
    &lt;span class=&quot;i&quot;&gt;mergeQuestionAnswers&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs13', 55)&quot; onmouseover=&quot;showTip(event, 'fs13', 55)&quot; class=&quot;i&quot;&gt;Seq&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs33', 56)&quot; onmouseover=&quot;showTip(event, 'fs33', 56)&quot; class=&quot;i&quot;&gt;groupBy&lt;/span&gt; (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;q&lt;/span&gt;,&lt;span class=&quot;i&quot;&gt;a&lt;/span&gt;) &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;unixToDateTime&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;q&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;CreationDate&lt;/span&gt;)&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Year&lt;/span&gt;)
    &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs13', 57)&quot; onmouseover=&quot;showTip(event, 'fs13', 57)&quot; class=&quot;i&quot;&gt;Seq&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs29', 58)&quot; onmouseover=&quot;showTip(event, 'fs29', 58)&quot; class=&quot;i&quot;&gt;map&lt;/span&gt; (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;year&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;data&lt;/span&gt;) &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;timeToClose&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
             &lt;span class=&quot;i&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs13', 59)&quot; onmouseover=&quot;showTip(event, 'fs13', 59)&quot; class=&quot;i&quot;&gt;Seq&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs29', 60)&quot; onmouseover=&quot;showTip(event, 'fs29', 60)&quot; class=&quot;i&quot;&gt;map&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;getTimeToClose&lt;/span&gt;
         &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;average&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;timeToClose&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs13', 61)&quot; onmouseover=&quot;showTip(event, 'fs13', 61)&quot; class=&quot;i&quot;&gt;Seq&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs34', 62)&quot; onmouseover=&quot;showTip(event, 'fs34', 62)&quot; class=&quot;i&quot;&gt;average&lt;/span&gt;
         &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;median&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;timeToClose&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;median&lt;/span&gt;
         &lt;span class=&quot;i&quot;&gt;year&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;average&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;median&lt;/span&gt;
    )
    &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs13', 63)&quot; onmouseover=&quot;showTip(event, 'fs13', 63)&quot; class=&quot;i&quot;&gt;Seq&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs35', 64)&quot; onmouseover=&quot;showTip(event, 'fs35', 64)&quot; class=&quot;i&quot;&gt;sortBy&lt;/span&gt; (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;, _, _) &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;)
    &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs13', 65)&quot; onmouseover=&quot;showTip(event, 'fs13', 65)&quot; class=&quot;i&quot;&gt;Seq&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs14', 66)&quot; onmouseover=&quot;showTip(event, 'fs14', 66)&quot; class=&quot;i&quot;&gt;toArray&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;This gives the following results.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;&lt;code&gt;[|(2008, 2345.916019, 1.900555556); (2009, 333.4175912, 0.4058333333);
  (2010, 96.91721817, 0.5219444444); (2011, 48.4008104, 0.5786111111);
  (2012, 165.2300729, 0.66); (2013, 36.97864167, 0.74);
  (2014, 42.91575397, 0.6572222222); (2015, 25.93529412, 0.6344444444)|]
&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;Which we can then plot using&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;4: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
(&lt;span class=&quot;i&quot;&gt;Chart&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Combine&lt;/span&gt; [
    &lt;span class=&quot;i&quot;&gt;Chart&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Line&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;statsByYear&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs13', 67)&quot; onmouseover=&quot;showTip(event, 'fs13', 67)&quot; class=&quot;i&quot;&gt;Seq&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs29', 68)&quot; onmouseover=&quot;showTip(event, 'fs29', 68)&quot; class=&quot;i&quot;&gt;map&lt;/span&gt; (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;a&lt;/span&gt;, _) &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;a&lt;/span&gt;), &lt;span class=&quot;i&quot;&gt;Name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Average&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;)
    &lt;span class=&quot;i&quot;&gt;Chart&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Line&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;statsByYear&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs13', 69)&quot; onmouseover=&quot;showTip(event, 'fs13', 69)&quot; class=&quot;i&quot;&gt;Seq&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs29', 70)&quot; onmouseover=&quot;showTip(event, 'fs29', 70)&quot; class=&quot;i&quot;&gt;map&lt;/span&gt; (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;, _, &lt;span class=&quot;i&quot;&gt;m&lt;/span&gt;) &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;m&lt;/span&gt;), &lt;span class=&quot;i&quot;&gt;Name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Median&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;)
])&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;WithLegend&lt;/span&gt;(&lt;span class=&quot;k&quot;&gt;true&lt;/span&gt;)&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;&lt;img src=&quot;http://www.colinbull.net/public/blog_imgs/images/chart_75befbfe-c9b1-4c94-b08f-2d0b8936d952.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;And actually we see that in 2008 when FSharp first appeared it took a long time for questions to get closed. This is the year F# was introduced and I suspect there was only a handful of people outside of Microsoft Research that actually where able to answer these questions. 
However as time has progressed we see an exponential improvement it the time for questions to get answered, which typically bottoms out with an average of 25 hours and a median of about 30 mins. This is clearly a sign of a responsive community, that is indeed growing. Whats more, 
I still don't think that an average of 25 hours is actually representative. In my experience I rarely use Stack Overflow for F# questions, instead I direct my questions to the &lt;a href=&quot;https://github.com/Microsoft/visualfsharp&quot;&gt;fsharp github repository&lt;/a&gt; previously on codeplex, 
the repository of the project I am using, or finally twitter with the &lt;a href=&quot;https://twitter.com/search?q=%23fsharp&amp;amp;src=typd&quot;&gt;#fsharp&lt;/a&gt; tag, and wait for the plethora of responses to come in from the help and very active community members. And in these domains the response time is typically around ~5 minutes.&lt;/p&gt;

&lt;p&gt;In fact as I write this I'm wondering whether the comment&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;few irritatingly vocal people in the F# community implicitly try to guilt non-believers into F# adoption.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;has been spurred by the willingness to help in the community. Yes there is a certain amount of advertisment that goes on for features specific to F#, but in general it is just sound fundamental programming advice. I'm fairly sure every single one of those people would offer examples in C#, Haskell or VB if asked. Anyway I digress.&lt;/p&gt;

&lt;p&gt;The second comment that stood out for me in the post was,&lt;/p&gt;

&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;F# has no compelling technical advantage.
Some overly zealous F# fans claim that F# can do things that general purpose languages like Perl and C# can't. This all depends on how you define features of languages. But more reasonable F# proponents usually state, correctly, that F# isn't intended to replace languages like C# and that F# doesn't have any unique, magic capabilities. So, there's no technical reason for me to use F#, and the cost of context switching between the primarily procedural C# and the primarily functional F# is a huge price to pay.&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;

&lt;p&gt;I think you only have to look at type providers, which are used to analyse the Stack Overflow questions above are certainly a nice and almost unique feature. That to my knowledge only one other language has &lt;a href=&quot;https://github.com/david-christiansen/idris-type-providers&quot;&gt;Idris&lt;/a&gt;. Sure you can do the analysis I have done above in C# but there will be alot more typing and additionally a lot less safety, since you will ultimately loose the strongly typed data access, that type providers offer. Moreover it is this safety that F# and statically typed functional programming languages in general offers you and makes it worth the context switch.&lt;/p&gt;

&lt;p&gt;Since I adopted F# and functional programming it has completely changed the way I think about coding problems in all of the other languages I use, most notable C#. It has made me a better developer.&lt;/p&gt;


&lt;div class=&quot;tip&quot; id=&quot;fs1&quot;&gt;namespace Microsoft.FSharp.Data&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs2&quot;&gt;namespace System&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs3&quot;&gt;namespace System.IO&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs4&quot;&gt;Multiple items&lt;br /&gt;val seq : sequence:seq&amp;lt;&amp;#39;T&amp;gt; -&amp;gt; seq&amp;lt;&amp;#39;T&amp;gt;&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.seq&lt;br /&gt;&lt;br /&gt;--------------------&lt;br /&gt;type seq&amp;lt;&amp;#39;T&amp;gt; = System.Collections.Generic.IEnumerable&amp;lt;&amp;#39;T&amp;gt;&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.seq&amp;lt;_&amp;gt;&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs5&quot;&gt;module Array&lt;br /&gt;&lt;br /&gt;from Microsoft.FSharp.Collections&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs6&quot;&gt;val zeroCreate : count:int -&amp;gt; &amp;#39;T []&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Array.zeroCreate&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs7&quot;&gt;Multiple items&lt;br /&gt;val ref : value:&amp;#39;T -&amp;gt; &amp;#39;T ref&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.ref&lt;br /&gt;&lt;br /&gt;--------------------&lt;br /&gt;type &amp;#39;T ref = Ref&amp;lt;&amp;#39;T&amp;gt;&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.ref&amp;lt;_&amp;gt;&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs8&quot;&gt;val sub : array:&amp;#39;T [] -&amp;gt; startIndex:int -&amp;gt; count:int -&amp;gt; &amp;#39;T []&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Array.sub&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs9&quot;&gt;Multiple items&lt;br /&gt;val int : value:&amp;#39;T -&amp;gt; int (requires member op_Explicit)&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.int&lt;br /&gt;&lt;br /&gt;--------------------&lt;br /&gt;type int = int32&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.int&lt;br /&gt;&lt;br /&gt;--------------------&lt;br /&gt;type int&amp;lt;&amp;#39;Measure&amp;gt; = int&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.int&amp;lt;_&amp;gt;&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs10&quot;&gt;type DateTimeKind =&lt;br /&gt;&amp;#160;&amp;#160;| Unspecified = 0&lt;br /&gt;&amp;#160;&amp;#160;| Utc = 1&lt;br /&gt;&amp;#160;&amp;#160;| Local = 2&lt;br /&gt;&lt;br /&gt;Full name: System.DateTimeKind&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs11&quot;&gt;field System.DateTimeKind.Utc = 1&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs12&quot;&gt;Multiple items&lt;br /&gt;val float : value:&amp;#39;T -&amp;gt; float (requires member op_Explicit)&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.float&lt;br /&gt;&lt;br /&gt;--------------------&lt;br /&gt;type float = System.Double&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.float&lt;br /&gt;&lt;br /&gt;--------------------&lt;br /&gt;type float&amp;lt;&amp;#39;Measure&amp;gt; = float&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.float&amp;lt;_&amp;gt;&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs13&quot;&gt;module Seq&lt;br /&gt;&lt;br /&gt;from Microsoft.FSharp.Collections&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs14&quot;&gt;val toArray : source:seq&amp;lt;&amp;#39;T&amp;gt; -&amp;gt; &amp;#39;T []&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Seq.toArray&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs15&quot;&gt;val sort : array:&amp;#39;T [] -&amp;gt; &amp;#39;T [] (requires comparison)&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Array.sort&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs16&quot;&gt;val floor : value:&amp;#39;T -&amp;gt; &amp;#39;T (requires member Floor)&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.floor&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs17&quot;&gt;val ceil : value:&amp;#39;T -&amp;gt; &amp;#39;T (requires member Ceiling)&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.ceil&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs18&quot;&gt;Multiple items&lt;br /&gt;type LiteralAttribute =&lt;br /&gt;&amp;#160;&amp;#160;inherit Attribute&lt;br /&gt;&amp;#160;&amp;#160;new : unit -&amp;gt; LiteralAttribute&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.LiteralAttribute&lt;br /&gt;&lt;br /&gt;--------------------&lt;br /&gt;new : unit -&amp;gt; LiteralAttribute&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs19&quot;&gt;val not : value:bool -&amp;gt; bool&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.not&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs20&quot;&gt;val sprintf : format:Printf.StringFormat&amp;lt;&amp;#39;T&amp;gt; -&amp;gt; &amp;#39;T&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.sprintf&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs21&quot;&gt;Multiple items&lt;br /&gt;module List&lt;br /&gt;&lt;br /&gt;from Microsoft.FSharp.Collections&lt;br /&gt;&lt;br /&gt;--------------------&lt;br /&gt;type List&amp;lt;&amp;#39;T&amp;gt; =&lt;br /&gt;&amp;#160;&amp;#160;| ( [] )&lt;br /&gt;&amp;#160;&amp;#160;| ( :: ) of Head: &amp;#39;T * Tail: &amp;#39;T list&lt;br /&gt;&amp;#160;&amp;#160;interface IEnumerable&lt;br /&gt;&amp;#160;&amp;#160;interface IEnumerable&amp;lt;&amp;#39;T&amp;gt;&lt;br /&gt;&amp;#160;&amp;#160;member GetSlice : startIndex:int option * endIndex:int option -&amp;gt; &amp;#39;T list&lt;br /&gt;&amp;#160;&amp;#160;member Head : &amp;#39;T&lt;br /&gt;&amp;#160;&amp;#160;member IsEmpty : bool&lt;br /&gt;&amp;#160;&amp;#160;member Item : index:int -&amp;gt; &amp;#39;T with get&lt;br /&gt;&amp;#160;&amp;#160;member Length : int&lt;br /&gt;&amp;#160;&amp;#160;member Tail : &amp;#39;T list&lt;br /&gt;&amp;#160;&amp;#160;static member Cons : head:&amp;#39;T * tail:&amp;#39;T list -&amp;gt; &amp;#39;T list&lt;br /&gt;&amp;#160;&amp;#160;static member Empty : &amp;#39;T list&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.List&amp;lt;_&amp;gt;&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs22&quot;&gt;val iter : action:(&amp;#39;T -&amp;gt; unit) -&amp;gt; list:&amp;#39;T list -&amp;gt; unit&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.List.iter&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs23&quot;&gt;val fold : folder:(&amp;#39;State -&amp;gt; &amp;#39;T -&amp;gt; &amp;#39;State) -&amp;gt; state:&amp;#39;State -&amp;gt; source:seq&amp;lt;&amp;#39;T&amp;gt; -&amp;gt; &amp;#39;State&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Seq.fold&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs24&quot;&gt;union case Option.Some: Value: &amp;#39;T -&amp;gt; Option&amp;lt;&amp;#39;T&amp;gt;&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs25&quot;&gt;union case Option.None: Option&amp;lt;&amp;#39;T&amp;gt;&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs26&quot;&gt;Multiple items&lt;br /&gt;module Map&lt;br /&gt;&lt;br /&gt;from Microsoft.FSharp.Collections&lt;br /&gt;&lt;br /&gt;--------------------&lt;br /&gt;type Map&amp;lt;&amp;#39;Key,&amp;#39;Value (requires comparison)&amp;gt; =&lt;br /&gt;&amp;#160;&amp;#160;interface IEnumerable&lt;br /&gt;&amp;#160;&amp;#160;interface IComparable&lt;br /&gt;&amp;#160;&amp;#160;interface IEnumerable&amp;lt;KeyValuePair&amp;lt;&amp;#39;Key,&amp;#39;Value&amp;gt;&amp;gt;&lt;br /&gt;&amp;#160;&amp;#160;interface ICollection&amp;lt;KeyValuePair&amp;lt;&amp;#39;Key,&amp;#39;Value&amp;gt;&amp;gt;&lt;br /&gt;&amp;#160;&amp;#160;interface IDictionary&amp;lt;&amp;#39;Key,&amp;#39;Value&amp;gt;&lt;br /&gt;&amp;#160;&amp;#160;new : elements:seq&amp;lt;&amp;#39;Key * &amp;#39;Value&amp;gt; -&amp;gt; Map&amp;lt;&amp;#39;Key,&amp;#39;Value&amp;gt;&lt;br /&gt;&amp;#160;&amp;#160;member Add : key:&amp;#39;Key * value:&amp;#39;Value -&amp;gt; Map&amp;lt;&amp;#39;Key,&amp;#39;Value&amp;gt;&lt;br /&gt;&amp;#160;&amp;#160;member ContainsKey : key:&amp;#39;Key -&amp;gt; bool&lt;br /&gt;&amp;#160;&amp;#160;override Equals : obj -&amp;gt; bool&lt;br /&gt;&amp;#160;&amp;#160;member Remove : key:&amp;#39;Key -&amp;gt; Map&amp;lt;&amp;#39;Key,&amp;#39;Value&amp;gt;&lt;br /&gt;&amp;#160;&amp;#160;...&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Map&amp;lt;_,_&amp;gt;&lt;br /&gt;&lt;br /&gt;--------------------&lt;br /&gt;new : elements:seq&amp;lt;&amp;#39;Key * &amp;#39;Value&amp;gt; -&amp;gt; Map&amp;lt;&amp;#39;Key,&amp;#39;Value&amp;gt;&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs27&quot;&gt;val ofSeq : elements:seq&amp;lt;&amp;#39;Key * &amp;#39;T&amp;gt; -&amp;gt; Map&amp;lt;&amp;#39;Key,&amp;#39;T&amp;gt; (requires comparison)&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Map.ofSeq&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs28&quot;&gt;val toSeq : table:Map&amp;lt;&amp;#39;Key,&amp;#39;T&amp;gt; -&amp;gt; seq&amp;lt;&amp;#39;Key * &amp;#39;T&amp;gt; (requires comparison)&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Map.toSeq&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs29&quot;&gt;val map : mapping:(&amp;#39;T -&amp;gt; &amp;#39;U) -&amp;gt; source:seq&amp;lt;&amp;#39;T&amp;gt; -&amp;gt; seq&amp;lt;&amp;#39;U&amp;gt;&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Seq.map&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs30&quot;&gt;module String&lt;br /&gt;&lt;br /&gt;from Microsoft.FSharp.Core&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs31&quot;&gt;val printfn : format:Printf.TextWriterFormat&amp;lt;&amp;#39;T&amp;gt; -&amp;gt; &amp;#39;T&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.printfn&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs32&quot;&gt;val incr : cell:int ref -&amp;gt; unit&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.incr&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs33&quot;&gt;val groupBy : projection:(&amp;#39;T -&amp;gt; &amp;#39;Key) -&amp;gt; source:seq&amp;lt;&amp;#39;T&amp;gt; -&amp;gt; seq&amp;lt;&amp;#39;Key * seq&amp;lt;&amp;#39;T&amp;gt;&amp;gt; (requires equality)&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Seq.groupBy&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs34&quot;&gt;val average : source:seq&amp;lt;&amp;#39;T&amp;gt; -&amp;gt; &amp;#39;T (requires member ( + ) and member DivideByInt and member get_Zero)&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Seq.average&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs35&quot;&gt;val sortBy : projection:(&amp;#39;T -&amp;gt; &amp;#39;Key) -&amp;gt; source:seq&amp;lt;&amp;#39;T&amp;gt; -&amp;gt; seq&amp;lt;&amp;#39;T&amp;gt; (requires comparison)&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Seq.sortBy&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Introducing Cricket (formerly FSharp.Actor)</title>
   <link href="http://colinbull.github.io/2014/11/06/Introducing-Cricket/"/>
   <updated>2014-11-06T00:00:00+00:00</updated>
   <id>http://colinbull.github.io/2014/11/06/Introducing-Cricket</id>
   <content type="html">&lt;p&gt;Over the last few years, I have been quite taken by the actor model of computing. Although not a silver bullet it does tend to make concurrent programming orders of magnitude easier to reason about. If you have never heard of Actors then an actor as defined by &lt;a href=&quot;http://en.wikipedia.org/wiki/Actor_model&quot;&gt;wikipedia&lt;/a&gt; is as follows&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;The Actor model adopts the philosophy that everything is an actor. This is similar to the everything is an object philosophy used by some object-oriented programming languages, but differs in that object-oriented software is typically executed sequentially, while the Actor model is inherently concurrent.&lt;/p&gt;

  &lt;p&gt;An actor is a computational entity that, in response to a message it receives, can concurrently:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;send a finite number of messages to other actors;&lt;/li&gt;
&lt;li&gt;create a finite number of new actors;&lt;/li&gt;
&lt;li&gt;designate the behavior to be used for the next message it receives.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;I also encourage you to look at &lt;a href=&quot;http://www.erlang.org&quot;&gt;Erlang/Elixir&lt;/a&gt;, &lt;a href=&quot;https://github.com/akkadotnet/akka.net&quot;&gt;Akka&lt;/a&gt;, &lt;a href=&quot;http://research.microsoft.com/en-us/projects/orleans/&quot;&gt;Orleans&lt;/a&gt; and the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ee370357.aspx&quot;&gt;&lt;code&gt;MailboxProcessor&amp;lt;'a&amp;gt;&lt;/code&gt; in FSharp.Core&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;&lt;a name=&quot;Introducing-Cricket&quot; class=&quot;anchor&quot; href=&quot;#Introducing-Cricket&quot;&gt;Introducing Cricket&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/fsprojects/Cricket&quot;&gt;Cricket&lt;/a&gt;, formerly FSharp.Actor, is yet another actor framework. Built entirely in F#, Cricket is a lightweight alternative to Akka et. al. To this end it is not as feature rich as these out of the box, but all of the core requirements like location transpancy, remoting, supervisors, metrics and tracing. Other things like failure detection and clustering are in the pipeline it is just a question of time.&lt;/p&gt;

&lt;p&gt;Some key links for Cricket:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://fsprojects.github.io/Cricket&quot;&gt;Cricket Home Page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://github.com/fsprojects/Cricket&quot;&gt;Cricket Source code&lt;/a&gt; on GitHub&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nuget.org/packages/Cricket&quot;&gt;Cricket NuGet package&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The nuget package, contains a single library &lt;code&gt;Cricket.dll&lt;/code&gt; and a reference to &lt;a href=&quot;https://github.com/nessos/FsPickler&quot;&gt;FsPickler&lt;/a&gt;, which is used for serailization.&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;Creating-a-simple-actor&quot; class=&quot;anchor&quot; href=&quot;#Creating-a-simple-actor&quot;&gt;Creating a simple actor&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;The following example, creates a &lt;code&gt;echo&lt;/code&gt; actor using cricket.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt; 1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 8: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 9: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;10: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;11: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;12: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;13: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;14: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;15: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;16: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;17: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;18: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;19: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;20: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;prep&quot;&gt;#I&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;packages&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
&lt;span class=&quot;prep&quot;&gt;#r&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;FsPickler&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;lib&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;net45&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;FsPickler&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;dll&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
&lt;span class=&quot;prep&quot;&gt;#r&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Cricket&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;lib&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Cricket&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;dll&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;open&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Cricket&lt;/span&gt;


&lt;span class=&quot;i&quot;&gt;ActorHost&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Start&lt;/span&gt;()

&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
    &lt;span class=&quot;i&quot;&gt;actor&lt;/span&gt; {
        &lt;span class=&quot;i&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;i&quot;&gt;body&lt;/span&gt; (
            &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rec&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;loop&lt;/span&gt;() &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;messageHandler&lt;/span&gt; {
                &lt;span class=&quot;k&quot;&gt;let!&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;msg&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Message&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;receive&lt;/span&gt;()
                &lt;span onmouseout=&quot;hideTip(event, 'fs1', 1)&quot; onmouseover=&quot;showTip(event, 'fs1', 1)&quot; class=&quot;i&quot;&gt;printfn&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;msg&lt;/span&gt;
                &lt;span class=&quot;k&quot;&gt;return!&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;loop&lt;/span&gt;()
            }
            &lt;span class=&quot;i&quot;&gt;loop&lt;/span&gt;())
    } &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Actor&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;spawn&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;A couple of things are happening in the code above. Firstly, we start an &lt;code&gt;ActorHost&lt;/code&gt; which sets up an environment within the current process for the actor to live in. Next we define the actor, we give it a name &lt;code&gt;echo&lt;/code&gt; and a body. The body is actually the only thing that is required. If the name is omitted then it is assinged as a &lt;code&gt;Guid&lt;/code&gt;. All the body of an actor consists of is a recursive function, that describes how to handle the messages posted to the actor. In this case we simply print a message to the console. Once we have defined the actor we then spawn it using &lt;code&gt;Actor.spawn&lt;/code&gt;. After an actor has been spawned it is ready to consume messages. We can send messages directly to the actor by using the &lt;code&gt;ActorRef&lt;/code&gt; that is returned by &lt;code&gt;Actor.spawn&lt;/code&gt;.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;i&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;--&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Hello&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Cricket&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;Alternatively we can resolve the actor by name and send the message that way.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;--&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Hello&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Cricket&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;From these basic beginings we can build entire systems using actors. These systems can be spread over multiple machines and as long as the underlying message transport supports it different data-centres. To make our echo actor distributed, we don't have to change the implementation of the actor. All we have to do is enable remoting on the actor host.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;8: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;c&quot;&gt;//Node1 host configuration&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;ActorHost&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Start&lt;/span&gt;()
         &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;SubscribeEvents&lt;/span&gt;(&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;evnt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;ActorEvent&lt;/span&gt;) &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs1', 2)&quot; onmouseover=&quot;showTip(event, 'fs1', 2)&quot; class=&quot;i&quot;&gt;printfn&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;evnt&lt;/span&gt;)
         &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;EnableRemoting&lt;/span&gt;(
                   [&lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;TCPTransport&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;TcpConfig&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Default&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;IPEndPoint&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Create&lt;/span&gt;(&lt;span class=&quot;n&quot;&gt;12002&lt;/span&gt;)))],
                   &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;BinarySerializer&lt;/span&gt;(),
                   &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;TcpActorRegistryTransport&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;TcpConfig&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Default&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;IPEndPoint&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Create&lt;/span&gt;(&lt;span class=&quot;n&quot;&gt;12003&lt;/span&gt;))),
                   &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;UdpActorRegistryDiscovery&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;UdpConfig&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Default&lt;/span&gt;(), &lt;span class=&quot;n&quot;&gt;1000&lt;/span&gt;))&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;All we have done is enchance the ActorHost with a collection of message transports, a serializer, a registry transport and a way for the actors to discover each other. Similar setif we used the same setup on another node.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;8: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;c&quot;&gt;//Node2 host configuration&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;ActorHost&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Start&lt;/span&gt;()
         &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;SubscribeEvents&lt;/span&gt;(&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;evnt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;ActorEvent&lt;/span&gt;) &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs1', 3)&quot; onmouseover=&quot;showTip(event, 'fs1', 3)&quot; class=&quot;i&quot;&gt;printfn&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;A&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;evnt&lt;/span&gt;)
         &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;EnableRemoting&lt;/span&gt;(
                   [&lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;TCPTransport&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;TcpConfig&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Default&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;IPEndPoint&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Create&lt;/span&gt;(&lt;span class=&quot;n&quot;&gt;12004&lt;/span&gt;)))],
                   &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;BinarySerializer&lt;/span&gt;(),
                   &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;TcpActorRegistryTransport&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;TcpConfig&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Default&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;IPEndPoint&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Create&lt;/span&gt;(&lt;span class=&quot;n&quot;&gt;12005&lt;/span&gt;))),
                   &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;UdpActorRegistryDiscovery&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;UdpConfig&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Default&lt;/span&gt;(), &lt;span class=&quot;n&quot;&gt;1000&lt;/span&gt;))&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;then we can on node 2 resolve any actors on node 1, using the example above. Alternatively if I had 10 nodes but wanted to resolve the &lt;code&gt;echo&lt;/code&gt; actor on node 9, I could do something like the following&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;node9&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;--&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Hello&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Cricket&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;This would then resolve the actor on &lt;code&gt;node9&lt;/code&gt;. If we had kept the original query which was simply &lt;code&gt;echo&lt;/code&gt; then this would resolve any actor named &lt;code&gt;echo&lt;/code&gt; all of the nodes participating in the group. For more details on remoting and a link to an example see &lt;a href=&quot;http://fsprojects.github.io/Cricket/remoting.html&quot;&gt;here&lt;/a&gt;&lt;/p&gt;


&lt;div class=&quot;tip&quot; id=&quot;fs1&quot;&gt;val printfn : format:Printf.TextWriterFormat&amp;lt;&amp;#39;T&amp;gt; -&amp;gt; &amp;#39;T&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.printfn&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Blogging with F# on GitHub Pages</title>
   <link href="http://colinbull.github.io/2014/11/04/Blogging-with-FSharp/"/>
   <updated>2014-11-04T00:00:00+00:00</updated>
   <id>http://colinbull.github.io/2014/11/04/Blogging-with-FSharp</id>
   <content type="html">&lt;h2&gt;&lt;a name=&quot;Introduction&quot; class=&quot;anchor&quot; href=&quot;#Introduction&quot;&gt;Introduction&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;Recently I decided I wanted to move my blog from Wordpress, to a far lighter-weight platform. The platform I chose to host my new blog on was &lt;a href=&quot;http://pages.github.com&quot;&gt;Github Pages&lt;/a&gt;. Basically if you have a github account you get a free pages repository where you can host a blog. You simply create a repository with a name that matches the format &lt;code&gt;{username}.github.io&lt;/code&gt; and that's basically it. You can now create a &lt;code&gt;index.htm&lt;/code&gt; page place it into your repository and away you go.&lt;/p&gt;

&lt;p&gt;Unfortunately having a completely static site isn't massively useful for a blog. At the very least, you are going to want a templating engine of some sort. Fortunately Github pages, comes armed with &lt;a href=&quot;https://github.com/jekyll/jekyll&quot;&gt;jekyll&lt;/a&gt; which is a blog-aware static site generator. Jekyll relies quite heavily on having the correct folder structure, this had me chasing my tail for a moment then I found the superb &lt;a href=&quot;https://github.com/poole/poole&quot;&gt;poole&lt;/a&gt; which generates all of the layout a creates a nice looking minimalist blog. Happy Days!&lt;/p&gt;

&lt;p&gt;To add a post you simply create a &lt;code&gt;*.md&lt;/code&gt; or &lt;code&gt;*.html&lt;/code&gt; and save it to the posts directory, push your changes.&lt;/p&gt;

&lt;h2&gt;&lt;a name=&quot;Leveraging-FSharp-Formatting&quot; class=&quot;anchor&quot; href=&quot;#Leveraging-FSharp-Formatting&quot;&gt;Leveraging &lt;a href=&quot;http://tpetricek.github.io/FSharp.Formatting&quot;&gt;FSharp.Formatting&lt;/a&gt;&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;FSharp Formatting is a library that enables a form of literate programming, where you can embed markdown directly into a &lt;code&gt;*.fsx&lt;/code&gt; script. Then by running a simple command line tool or a script you can convert the script into a HTML or Latex document. When your chosen out put is html you get tool-tips when you hover over terms in your code, exactly like you would in an IDE. For example,&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;3: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;add&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;b&lt;/span&gt;

&lt;span onmouseout=&quot;hideTip(event, 'fs1', 1)&quot; onmouseover=&quot;showTip(event, 'fs1', 1)&quot; class=&quot;i&quot;&gt;printfn&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;add&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;5&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;15&lt;/span&gt;)&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;Since Jekyll does not directly support &lt;code&gt;*.fsx&lt;/code&gt; files. We need to extend the structure given to us by poole. The first step I took was to include &lt;a href=&quot;https://github.com/fsprojects/Paket&quot;&gt;Paket&lt;/a&gt; so I can get hold of nuget packages, that I might require for my scripts. This may seem like an odd requirement at first, but because all of my blog posts will be F# script files which are type checked by FSharp.Formatting I effectively have executable / type safe code samples on my blog :). Once paket was installed I ran&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td&gt;&lt;pre lang=&quot;batch&quot;&gt;./.paket/paket add nuget FSharp.Formatting.CommandTool&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;This installed the F# command tool, which is a command line wrapper for the FSharp.Formatting library. Next I created a &lt;code&gt;publish.bat&lt;/code&gt; so I have a single command to update changes to my blog&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td&gt;&lt;pre lang=&quot;batch&quot;&gt;@echo off

call .paket\paket restore
call tools\fsformatting.exe literate --processDirectory --lineNumbers true --inputDirectory  &amp;quot;code&amp;quot; --outputDirectory &amp;quot;_posts&amp;quot;

git add --all .
git commit -a -m %1
git push&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;The script above takes a single parameter which is a commit message, this can be run like so.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td&gt;&lt;pre lang=&quot;batch&quot;&gt;./publish.bat &amp;quot;Added post about F# blogging&amp;quot;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;At this point all that is left to-do is write some content in the &lt;code&gt;code&lt;/code&gt; folder and then run the &lt;code&gt;publish.bat&lt;/code&gt; once you have created your master piece. Well that was nearly the case for me. It turns out that jekyll requires a header at the top of each page which looks something like the following&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td&gt;&lt;pre lang=&quot;jekyll&quot;&gt;---
layout: page
title: your post title
---&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;This presented a little bit of a problem as FSharp.Formatting did not have a way of just emitting raw content. Fortunately for me it does have a concept of commands in the documentation. Basically commands allow you to embed the results of computations or hide certain bits of code you may not want in you documentation (more info on this can be found &lt;a href=&quot;http://tpetricek.github.io/FSharp.Formatting/evaluation.html&quot;&gt;here&lt;/a&gt;). All I have done is extend this mechanism slightly by adding an extra command &lt;code&gt;raw&lt;/code&gt;. Which allows you to prefix a block of markup that you do not want the formatter to touch. So at the top of each post I now have something like the following,&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td&gt;&lt;pre lang=&quot;markdown&quot;&gt;(*** raw ***)
---
layout: page
title: your post title
----&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;As of writing this change is not part of the FSharp.Formatting mainline, but there is a &lt;a href=&quot;https://github.com/tpetricek/FSharp.Formatting/pull/224&quot;&gt;PR&lt;/a&gt;. However if you deceide that you like this approach, or just want to play, I have created a github repository &lt;a href=&quot;https://github.com/colinbull/FsBlog&quot;&gt;FsBlog&lt;/a&gt; that is this exact blog (minus content).&lt;/p&gt;

&lt;p&gt;One more thing is if you are developing in Visual Studio then I highly recommend the &lt;a href=&quot;https://visualstudiogallery.msdn.microsoft.com/2fc5ccff-f424-4721-ac3f-bb9d4ca7de03&quot;&gt;Elucidate Extension&lt;/a&gt;, so you can visualize your literate scripts as you work on them.&lt;/p&gt;

&lt;img width=&quot;800&quot; height=&quot;475&quot; src=&quot;http://www.colinbull.net/public/blog_imgs/elucidate_screenshot.png&quot; /&gt;


&lt;div class=&quot;tip&quot; id=&quot;fs1&quot;&gt;val printfn : format:Printf.TextWriterFormat&amp;lt;&amp;#39;T&amp;gt; -&amp;gt; &amp;#39;T&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.printfn&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Handling constant type unsupported error for type providers</title>
   <link href="http://colinbull.github.io/2014/07/20/Handling-constant-type-unsupported-in-type-providers/"/>
   <updated>2014-07-20T00:00:00+00:00</updated>
   <id>http://colinbull.github.io/2014/07/20/Handling-constant-type-unsupported-in-type-providers</id>
   <content type="html">&lt;p&gt;When writing type providers you are required to define code that will run at run-time with a quotation. This in itself is not a problem, 
however if you try and pass a none native type to the quotation you will receive the following error,&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;i&quot;&gt;Unsupported&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;constant&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;xxxx&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;There is a stack-overflow post &lt;a href=&quot;http://stackoverflow.com/questions/10161437/type-provider-providing-me-with-an-unsuported-constant-type-system-double-er&quot;&gt;here&lt;/a&gt; which has an example and a good explanation of the reasons why. A typical work around is to use each 
field from a record and pass it to a function call in the quotation as an array or as individual parameters. Either way this can end up being quite painful.&lt;/p&gt;

&lt;p&gt;So how can we work around this. Well, what we need to do is build a new instance of the object we are trying to pass to the quotation within the quotation 
itself, and then use the variable that holds this new instance as the parameter in the function call in the Quotation. I have probably not explained that 
the best but the final code looks like this.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;8: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;9: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;recordInstance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; { &lt;span class=&quot;i&quot;&gt;Name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Tester&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;; &lt;span class=&quot;i&quot;&gt;DateTime&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;DateTime&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;UtcNow&lt;/span&gt; }

&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;providedMethod&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
     &lt;span class=&quot;i&quot;&gt;ProvidedMethod&lt;/span&gt;(&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;MethodName&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;,
               [&lt;span class=&quot;c&quot;&gt;(* some parameters *)&lt;/span&gt;],&lt;span onmouseout=&quot;hideTip(event, 'fs13', 23)&quot; onmouseover=&quot;showTip(event, 'fs13', 23)&quot; class=&quot;i&quot;&gt;typeof&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;SomeType&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;, 
               &lt;span class=&quot;i&quot;&gt;InvokeCode&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
                    &lt;span class=&quot;i&quot;&gt;QuotationHelpers&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;quoteRecord&lt;/span&gt; 
                         &lt;span class=&quot;i&quot;&gt;recordInstance&lt;/span&gt; 
                         (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;args&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt;  &amp;lt;@@ ((&lt;span class=&quot;o&quot;&gt;%%&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;[&lt;span class=&quot;n&quot;&gt;0&lt;/span&gt;] &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;SomeType&lt;/span&gt;)&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;SomeMethod&lt;/span&gt;(&lt;span class=&quot;o&quot;&gt;%%&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;var&lt;/span&gt;)) @@&amp;gt;))&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;Where the args are the original arguments passed by provided method invoke code and var is a quotation that represents our record instance to pass to our method. 
The implementation of QuotationHelpers is as follows.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt; 1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 8: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 9: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;10: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;11: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;12: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;13: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;14: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;15: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;16: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;17: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;18: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;19: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;20: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;21: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;22: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;23: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;24: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;25: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;26: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;27: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;28: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;29: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;30: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;31: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;32: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;33: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;34: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;35: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;36: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;37: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;38: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;39: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;40: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;41: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;42: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;43: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;QuotationHelpers&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 

    &lt;span class=&quot;k&quot;&gt;open&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs2', 6)&quot; onmouseover=&quot;showTip(event, 'fs2', 6)&quot; class=&quot;i&quot;&gt;Microsoft&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs3', 7)&quot; onmouseover=&quot;showTip(event, 'fs3', 7)&quot; class=&quot;i&quot;&gt;FSharp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs4', 8)&quot; onmouseover=&quot;showTip(event, 'fs4', 8)&quot; class=&quot;i&quot;&gt;Quotations&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;open&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs2', 9)&quot; onmouseover=&quot;showTip(event, 'fs2', 9)&quot; class=&quot;i&quot;&gt;Microsoft&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs3', 10)&quot; onmouseover=&quot;showTip(event, 'fs3', 10)&quot; class=&quot;i&quot;&gt;FSharp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs6', 11)&quot; onmouseover=&quot;showTip(event, 'fs6', 11)&quot; class=&quot;i&quot;&gt;Reflection&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rec&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;coerceValues&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;fieldTypeLookup&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;fields&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
        &lt;span onmouseout=&quot;hideTip(event, 'fs7', 12)&quot; onmouseover=&quot;showTip(event, 'fs7', 12)&quot; class=&quot;i&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs8', 13)&quot; onmouseover=&quot;showTip(event, 'fs8', 13)&quot; class=&quot;i&quot;&gt;mapi&lt;/span&gt; (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;v&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;expr&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
                    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;v&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;null&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;simpleTypeExpr&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;v&lt;/span&gt;
                    &lt;span class=&quot;k&quot;&gt;elif&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;FSharpType&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsUnion&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;GetType&lt;/span&gt;()) &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;unionExpr&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;v&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs9', 14)&quot; onmouseover=&quot;showTip(event, 'fs9', 14)&quot; class=&quot;i&quot;&gt;snd&lt;/span&gt;
                    &lt;span class=&quot;k&quot;&gt;elif&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;FSharpType&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsRecord&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;GetType&lt;/span&gt;()) &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;recordExpr&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;v&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs9', 15)&quot; onmouseover=&quot;showTip(event, 'fs9', 15)&quot; class=&quot;i&quot;&gt;snd&lt;/span&gt;
                    &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;simpleTypeExpr&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;v&lt;/span&gt;
                &lt;span class=&quot;i&quot;&gt;Expr&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Coerce&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;expr&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;fieldTypeLookup&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;i&lt;/span&gt;)
        ) &lt;span class=&quot;i&quot;&gt;fields&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs10', 16)&quot; onmouseover=&quot;showTip(event, 'fs10', 16)&quot; class=&quot;i&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs11', 17)&quot; onmouseover=&quot;showTip(event, 'fs11', 17)&quot; class=&quot;i&quot;&gt;ofArray&lt;/span&gt;
    
    &lt;span class=&quot;k&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;simpleTypeExpr&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;instance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Expr&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;instance&lt;/span&gt;)

    &lt;span class=&quot;k&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;unionExpr&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;instance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
        &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;caseInfo&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;fields&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;FSharpValue&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;GetUnionFields&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;instance&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;instance&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;GetType&lt;/span&gt;())    
        &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;fieldInfo&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;caseInfo&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;GetFields&lt;/span&gt;()
        &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;fieldTypeLookup&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;indx&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;fieldInfo&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;[&lt;span class=&quot;i&quot;&gt;indx&lt;/span&gt;]&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;PropertyType&lt;/span&gt;
        &lt;span class=&quot;i&quot;&gt;caseInfo&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;DeclaringType&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;Expr&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;NewUnionCase&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;caseInfo&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;coerceValues&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;fieldTypeLookup&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;fields&lt;/span&gt;)

    &lt;span class=&quot;k&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;recordExpr&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;instance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
        &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;tpy&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;instance&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;GetType&lt;/span&gt;()
        &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;fields&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;FSharpValue&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;GetRecordFields&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;instance&lt;/span&gt;)
        &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;fieldInfo&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;FSharpType&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;GetRecordFields&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;tpy&lt;/span&gt;)
        &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;fieldTypeLookup&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;indx&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;fieldInfo&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;[&lt;span class=&quot;i&quot;&gt;indx&lt;/span&gt;]&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;PropertyType&lt;/span&gt;
        &lt;span class=&quot;i&quot;&gt;tpy&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;Expr&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;NewRecord&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;instance&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;GetType&lt;/span&gt;(), &lt;span class=&quot;i&quot;&gt;coerceValues&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;fieldTypeLookup&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;fields&lt;/span&gt;)

    &lt;span class=&quot;k&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;arrayExpr&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;instance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;a&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs12', 18)&quot; onmouseover=&quot;showTip(event, 'fs12', 18)&quot; class=&quot;i&quot;&gt;array&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;typ&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs13', 19)&quot; onmouseover=&quot;showTip(event, 'fs13', 19)&quot; class=&quot;i&quot;&gt;typeof&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;arrayType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;instance&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;GetType&lt;/span&gt;()
        &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;exprs&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;coerceValues&lt;/span&gt; (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; _ &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;typ&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;instance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs7', 20)&quot; onmouseover=&quot;showTip(event, 'fs7', 20)&quot; class=&quot;i&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs14', 21)&quot; onmouseover=&quot;showTip(event, 'fs14', 21)&quot; class=&quot;i&quot;&gt;map&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs15', 22)&quot; onmouseover=&quot;showTip(event, 'fs15', 22)&quot; class=&quot;i&quot;&gt;box&lt;/span&gt;)
        &lt;span class=&quot;i&quot;&gt;arrayType&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;Expr&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;NewArray&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;typ&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;exprs&lt;/span&gt;)

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;createLetExpr&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;varType&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;instance&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;args&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
        &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Var&lt;/span&gt;(&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;instance&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;varType&lt;/span&gt;)  
        &lt;span class=&quot;i&quot;&gt;Expr&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Let&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;var&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;instance&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;args&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;Expr&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Var&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;var&lt;/span&gt;)))

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;quoteUnion&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;instance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;unionExpr&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;instance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;createLetExpr&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;quoteRecord&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;instance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;recordExpr&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;instance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;createLetExpr&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;quoteArray&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;instance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;arrayExpr&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;instance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;createLetExpr&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;And thats it. Hopefully this should remove some pain points in developing type providers.&lt;/p&gt;


&lt;div class=&quot;tip&quot; id=&quot;fs1&quot;&gt;namespace System&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs2&quot;&gt;namespace Microsoft&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs3&quot;&gt;namespace Microsoft.FSharp&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs4&quot;&gt;namespace Microsoft.FSharp.Quotations&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs5&quot;&gt;Multiple items&lt;br /&gt;val string : value:&amp;#39;T -&amp;gt; string&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.string&lt;br /&gt;&lt;br /&gt;--------------------&lt;br /&gt;type string = System.String&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.string&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs6&quot;&gt;namespace Microsoft.FSharp.Reflection&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs7&quot;&gt;module Array&lt;br /&gt;&lt;br /&gt;from Microsoft.FSharp.Collections&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs8&quot;&gt;val mapi : mapping:(int -&amp;gt; &amp;#39;T -&amp;gt; &amp;#39;U) -&amp;gt; array:&amp;#39;T [] -&amp;gt; &amp;#39;U []&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Array.mapi&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs9&quot;&gt;val snd : tuple:(&amp;#39;T1 * &amp;#39;T2) -&amp;gt; &amp;#39;T2&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.snd&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs10&quot;&gt;Multiple items&lt;br /&gt;module List&lt;br /&gt;&lt;br /&gt;from Microsoft.FSharp.Collections&lt;br /&gt;&lt;br /&gt;--------------------&lt;br /&gt;type List&amp;lt;&amp;#39;T&amp;gt; =&lt;br /&gt;&amp;#160;&amp;#160;| ( [] )&lt;br /&gt;&amp;#160;&amp;#160;| ( :: ) of Head: &amp;#39;T * Tail: &amp;#39;T list&lt;br /&gt;&amp;#160;&amp;#160;interface IEnumerable&lt;br /&gt;&amp;#160;&amp;#160;interface IEnumerable&amp;lt;&amp;#39;T&amp;gt;&lt;br /&gt;&amp;#160;&amp;#160;member GetSlice : startIndex:int option * endIndex:int option -&amp;gt; &amp;#39;T list&lt;br /&gt;&amp;#160;&amp;#160;member Head : &amp;#39;T&lt;br /&gt;&amp;#160;&amp;#160;member IsEmpty : bool&lt;br /&gt;&amp;#160;&amp;#160;member Item : index:int -&amp;gt; &amp;#39;T with get&lt;br /&gt;&amp;#160;&amp;#160;member Length : int&lt;br /&gt;&amp;#160;&amp;#160;member Tail : &amp;#39;T list&lt;br /&gt;&amp;#160;&amp;#160;static member Cons : head:&amp;#39;T * tail:&amp;#39;T list -&amp;gt; &amp;#39;T list&lt;br /&gt;&amp;#160;&amp;#160;static member Empty : &amp;#39;T list&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.List&amp;lt;_&amp;gt;&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs11&quot;&gt;val ofArray : array:&amp;#39;T [] -&amp;gt; &amp;#39;T list&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.List.ofArray&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs12&quot;&gt;type &amp;#39;T array = &amp;#39;T []&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.array&amp;lt;_&amp;gt;&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs13&quot;&gt;val typeof&amp;lt;&amp;#39;T&amp;gt; : System.Type&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.typeof&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs14&quot;&gt;val map : mapping:(&amp;#39;T -&amp;gt; &amp;#39;U) -&amp;gt; array:&amp;#39;T [] -&amp;gt; &amp;#39;U []&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Array.map&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs15&quot;&gt;val box : value:&amp;#39;T -&amp;gt; obj&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.box&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Option Operators</title>
   <link href="http://colinbull.github.io/2013/04/29/Option-Operators/"/>
   <updated>2013-04-29T00:00:00+00:00</updated>
   <id>http://colinbull.github.io/2013/04/29/Option-Operators</id>
   <content type="html">&lt;p&gt;We often have to represent the absence of data within a collection of values. In C# the default type to-go to is an Nullable, F# 3.0 introduced the Microsoft.FSharp.Linq.NullableOperators module to help with comparisons and arithmetic over this type.&lt;/p&gt;

&lt;p&gt;The Nullable type can still be somewhat tiresome to use in F# though as it can lead to adding lots of type constraints for example&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;3: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;NullableSeq&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; (&lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs2', 2)&quot; onmouseover=&quot;showTip(event, 'fs2', 2)&quot; class=&quot;i&quot;&gt;unit&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;a&lt;/span&gt;) 
                    &lt;span class=&quot;k&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;struct&lt;/span&gt; 
                    &lt;span class=&quot;k&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;ValueType&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs3', 3)&quot; onmouseover=&quot;showTip(event, 'fs3', 3)&quot; class=&quot;i&quot;&gt;seq&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Nullable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;I think a nicer approach is to replace Nullable with Option, to relax some of these type constraints.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;OptionSeq&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs3', 4)&quot; onmouseover=&quot;showTip(event, 'fs3', 4)&quot; class=&quot;i&quot;&gt;seq&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs4', 5)&quot; onmouseover=&quot;showTip(event, 'fs4', 5)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;however in doing this we have lost the nice operators that are available for the type &lt;code&gt;Nullable&amp;lt;'a&amp;gt;&lt;/code&gt;. But this is fairly easy to recreate as the semantics of 
Nullable and Option are approximately the same. So with a quick copy of the NullableOperators module and some simple find and replace we have the exact same 
set of operators.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt; 1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 8: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 9: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;10: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;11: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;12: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;13: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;14: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;15: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;16: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;17: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;18: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;19: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;20: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;21: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;22: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;23: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;24: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;25: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;26: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;27: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;28: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;29: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;30: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;31: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;32: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;33: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;34: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;35: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;36: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;37: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;38: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;39: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;40: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;41: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;42: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;43: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;44: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;45: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;46: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;47: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;48: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;49: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;50: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;51: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;52: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;53: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;54: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;55: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;56: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;57: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;OptionOperators&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; (&lt;span class=&quot;o&quot;&gt;?&amp;gt;=&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 6)&quot; onmouseover=&quot;showTip(event, 'fs4', 6)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; (&lt;span class=&quot;o&quot;&gt;?&amp;gt;&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 7)&quot; onmouseover=&quot;showTip(event, 'fs4', 7)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; (&lt;span class=&quot;o&quot;&gt;?&amp;lt;=&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 8)&quot; onmouseover=&quot;showTip(event, 'fs4', 8)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; (&lt;span class=&quot;o&quot;&gt;?&amp;lt;&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 9)&quot; onmouseover=&quot;showTip(event, 'fs4', 9)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; (&lt;span class=&quot;o&quot;&gt;?=&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 10)&quot; onmouseover=&quot;showTip(event, 'fs4', 10)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; (&lt;span class=&quot;o&quot;&gt;?&amp;lt;&amp;gt;&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 11)&quot; onmouseover=&quot;showTip(event, 'fs4', 11)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs5', 12)&quot; onmouseover=&quot;showTip(event, 'fs5', 12)&quot; class=&quot;i&quot;&gt;not&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;?=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;)

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; (&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=?&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 13)&quot; onmouseover=&quot;showTip(event, 'fs4', 13)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; (&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;?&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 14)&quot; onmouseover=&quot;showTip(event, 'fs4', 14)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; (&lt;span class=&quot;o&quot;&gt;&amp;lt;=?&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 15)&quot; onmouseover=&quot;showTip(event, 'fs4', 15)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; (&lt;span class=&quot;o&quot;&gt;&amp;lt;!--?&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 16)&quot; onmouseover=&quot;showTip(event, 'fs4', 16)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; (&lt;span class=&quot;o&quot;&gt;=?&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 17)&quot; onmouseover=&quot;showTip(event, 'fs4', 17)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; (&lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;gt;?&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 18)&quot; onmouseover=&quot;showTip(event, 'fs4', 18)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs5', 19)&quot; onmouseover=&quot;showTip(event, 'fs5', 19)&quot; class=&quot;i&quot;&gt;not&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=?&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;)

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; (&lt;span class=&quot;o&quot;&gt;?&amp;gt;=?&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 20)&quot; onmouseover=&quot;showTip(event, 'fs4', 20)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 21)&quot; onmouseover=&quot;showTip(event, 'fs4', 21)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt;)

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; (&lt;span class=&quot;o&quot;&gt;?&amp;gt;?&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 22)&quot; onmouseover=&quot;showTip(event, 'fs4', 22)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 23)&quot; onmouseover=&quot;showTip(event, 'fs4', 23)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt;)

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; (&lt;span class=&quot;o&quot;&gt;?&amp;lt;=?&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 24)&quot; onmouseover=&quot;showTip(event, 'fs4', 24)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 25)&quot; onmouseover=&quot;showTip(event, 'fs4', 25)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt;)

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; (&lt;span class=&quot;o&quot;&gt;?&amp;lt;!--?&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 26)&quot; onmouseover=&quot;showTip(event, 'fs4', 26)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 27)&quot; onmouseover=&quot;showTip(event, 'fs4', 27)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt;)

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; (&lt;span class=&quot;o&quot;&gt;?=?&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 28)&quot; onmouseover=&quot;showTip(event, 'fs4', 28)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 29)&quot; onmouseover=&quot;showTip(event, 'fs4', 29)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; (&lt;span onmouseout=&quot;hideTip(event, 'fs5', 30)&quot; onmouseover=&quot;showTip(event, 'fs5', 30)&quot; class=&quot;i&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs5', 31)&quot; onmouseover=&quot;showTip(event, 'fs5', 31)&quot; class=&quot;i&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt;)

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; (&lt;span class=&quot;o&quot;&gt;?&amp;lt;&amp;gt;?&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 32)&quot; onmouseover=&quot;showTip(event, 'fs4', 32)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 33)&quot; onmouseover=&quot;showTip(event, 'fs4', 33)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs5', 34)&quot; onmouseover=&quot;showTip(event, 'fs5', 34)&quot; class=&quot;i&quot;&gt;not&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;?=?&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;)

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;inline&lt;/span&gt; (&lt;span class=&quot;o&quot;&gt;?+&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 35)&quot; onmouseover=&quot;showTip(event, 'fs4', 35)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;_&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs6', 36)&quot; onmouseover=&quot;showTip(event, 'fs6', 36)&quot; class=&quot;i&quot;&gt;Some&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;) &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs7', 37)&quot; onmouseover=&quot;showTip(event, 'fs7', 37)&quot; class=&quot;i&quot;&gt;None&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;inline&lt;/span&gt; (&lt;span class=&quot;o&quot;&gt;+?&lt;/span&gt;) &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 38)&quot; onmouseover=&quot;showTip(event, 'fs4', 38)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;_&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs6', 39)&quot; onmouseover=&quot;showTip(event, 'fs6', 39)&quot; class=&quot;i&quot;&gt;Some&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt;) &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs7', 40)&quot; onmouseover=&quot;showTip(event, 'fs7', 40)&quot; class=&quot;i&quot;&gt;None&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;inline&lt;/span&gt; (&lt;span class=&quot;o&quot;&gt;?+?&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 41)&quot; onmouseover=&quot;showTip(event, 'fs4', 41)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;_&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 42)&quot; onmouseover=&quot;showTip(event, 'fs4', 42)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;_&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs6', 43)&quot; onmouseover=&quot;showTip(event, 'fs6', 43)&quot; class=&quot;i&quot;&gt;Some&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt;) &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs7', 44)&quot; onmouseover=&quot;showTip(event, 'fs7', 44)&quot; class=&quot;i&quot;&gt;None&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;inline&lt;/span&gt; (&lt;span class=&quot;o&quot;&gt;?-&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 45)&quot; onmouseover=&quot;showTip(event, 'fs4', 45)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;_&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs6', 46)&quot; onmouseover=&quot;showTip(event, 'fs6', 46)&quot; class=&quot;i&quot;&gt;Some&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;) &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs7', 47)&quot; onmouseover=&quot;showTip(event, 'fs7', 47)&quot; class=&quot;i&quot;&gt;None&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;inline&lt;/span&gt; (&lt;span class=&quot;o&quot;&gt;-?&lt;/span&gt;) &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 48)&quot; onmouseover=&quot;showTip(event, 'fs4', 48)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;_&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs6', 49)&quot; onmouseover=&quot;showTip(event, 'fs6', 49)&quot; class=&quot;i&quot;&gt;Some&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt;) &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs7', 50)&quot; onmouseover=&quot;showTip(event, 'fs7', 50)&quot; class=&quot;i&quot;&gt;None&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;inline&lt;/span&gt; (&lt;span class=&quot;o&quot;&gt;?-?&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 51)&quot; onmouseover=&quot;showTip(event, 'fs4', 51)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;_&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 52)&quot; onmouseover=&quot;showTip(event, 'fs4', 52)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;_&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs6', 53)&quot; onmouseover=&quot;showTip(event, 'fs6', 53)&quot; class=&quot;i&quot;&gt;Some&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt;) &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs7', 54)&quot; onmouseover=&quot;showTip(event, 'fs7', 54)&quot; class=&quot;i&quot;&gt;None&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;inline&lt;/span&gt; ( &lt;span class=&quot;o&quot;&gt;?*&lt;/span&gt;  ) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 55)&quot; onmouseover=&quot;showTip(event, 'fs4', 55)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;_&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs6', 56)&quot; onmouseover=&quot;showTip(event, 'fs6', 56)&quot; class=&quot;i&quot;&gt;Some&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;) &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs7', 57)&quot; onmouseover=&quot;showTip(event, 'fs7', 57)&quot; class=&quot;i&quot;&gt;None&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;inline&lt;/span&gt; ( &lt;span class=&quot;o&quot;&gt;*?&lt;/span&gt;  ) &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 58)&quot; onmouseover=&quot;showTip(event, 'fs4', 58)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;_&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs6', 59)&quot; onmouseover=&quot;showTip(event, 'fs6', 59)&quot; class=&quot;i&quot;&gt;Some&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt;) &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs7', 60)&quot; onmouseover=&quot;showTip(event, 'fs7', 60)&quot; class=&quot;i&quot;&gt;None&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;inline&lt;/span&gt; ( &lt;span class=&quot;o&quot;&gt;?*?&lt;/span&gt; ) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 61)&quot; onmouseover=&quot;showTip(event, 'fs4', 61)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;_&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 62)&quot; onmouseover=&quot;showTip(event, 'fs4', 62)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;_&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs6', 63)&quot; onmouseover=&quot;showTip(event, 'fs6', 63)&quot; class=&quot;i&quot;&gt;Some&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt;) &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs7', 64)&quot; onmouseover=&quot;showTip(event, 'fs7', 64)&quot; class=&quot;i&quot;&gt;None&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;inline&lt;/span&gt; ( &lt;span class=&quot;o&quot;&gt;?%&lt;/span&gt;  ) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 65)&quot; onmouseover=&quot;showTip(event, 'fs4', 65)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;_&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs6', 66)&quot; onmouseover=&quot;showTip(event, 'fs6', 66)&quot; class=&quot;i&quot;&gt;Some&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;) &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs7', 67)&quot; onmouseover=&quot;showTip(event, 'fs7', 67)&quot; class=&quot;i&quot;&gt;None&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;inline&lt;/span&gt; ( &lt;span class=&quot;o&quot;&gt;%?&lt;/span&gt;  ) &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 68)&quot; onmouseover=&quot;showTip(event, 'fs4', 68)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;_&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs6', 69)&quot; onmouseover=&quot;showTip(event, 'fs6', 69)&quot; class=&quot;i&quot;&gt;Some&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt;) &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs7', 70)&quot; onmouseover=&quot;showTip(event, 'fs7', 70)&quot; class=&quot;i&quot;&gt;None&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;inline&lt;/span&gt; ( &lt;span class=&quot;o&quot;&gt;?%?&lt;/span&gt; ) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 71)&quot; onmouseover=&quot;showTip(event, 'fs4', 71)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;_&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 72)&quot; onmouseover=&quot;showTip(event, 'fs4', 72)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;_&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs6', 73)&quot; onmouseover=&quot;showTip(event, 'fs6', 73)&quot; class=&quot;i&quot;&gt;Some&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt;) &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs7', 74)&quot; onmouseover=&quot;showTip(event, 'fs7', 74)&quot; class=&quot;i&quot;&gt;None&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;inline&lt;/span&gt; ( &lt;span class=&quot;o&quot;&gt;?/&lt;/span&gt;  ) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 75)&quot; onmouseover=&quot;showTip(event, 'fs4', 75)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;_&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs6', 76)&quot; onmouseover=&quot;showTip(event, 'fs6', 76)&quot; class=&quot;i&quot;&gt;Some&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;) &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs7', 77)&quot; onmouseover=&quot;showTip(event, 'fs7', 77)&quot; class=&quot;i&quot;&gt;None&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;inline&lt;/span&gt; ( &lt;span class=&quot;o&quot;&gt;/?&lt;/span&gt;  ) &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 78)&quot; onmouseover=&quot;showTip(event, 'fs4', 78)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;_&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs6', 79)&quot; onmouseover=&quot;showTip(event, 'fs6', 79)&quot; class=&quot;i&quot;&gt;Some&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt;) &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs7', 80)&quot; onmouseover=&quot;showTip(event, 'fs7', 80)&quot; class=&quot;i&quot;&gt;None&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;inline&lt;/span&gt; ( &lt;span class=&quot;o&quot;&gt;?/?&lt;/span&gt; ) (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 81)&quot; onmouseover=&quot;showTip(event, 'fs4', 81)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;_&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) (&lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs4', 82)&quot; onmouseover=&quot;showTip(event, 'fs4', 82)&quot; class=&quot;i&quot;&gt;Option&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;_&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;IsSome&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs6', 83)&quot; onmouseover=&quot;showTip(event, 'fs6', 83)&quot; class=&quot;i&quot;&gt;Some&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Value&lt;/span&gt;) &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs7', 84)&quot; onmouseover=&quot;showTip(event, 'fs7', 84)&quot; class=&quot;i&quot;&gt;None&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;


&lt;div class=&quot;tip&quot; id=&quot;fs1&quot;&gt;namespace System&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs2&quot;&gt;type unit = Unit&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.unit&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs3&quot;&gt;Multiple items&lt;br /&gt;val seq : sequence:seq&amp;lt;&amp;#39;T&amp;gt; -&amp;gt; seq&amp;lt;&amp;#39;T&amp;gt;&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.seq&lt;br /&gt;&lt;br /&gt;--------------------&lt;br /&gt;type seq&amp;lt;&amp;#39;T&amp;gt; = System.Collections.Generic.IEnumerable&amp;lt;&amp;#39;T&amp;gt;&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.seq&amp;lt;_&amp;gt;&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs4&quot;&gt;module Option&lt;br /&gt;&lt;br /&gt;from Microsoft.FSharp.Core&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs5&quot;&gt;val not : value:bool -&amp;gt; bool&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.not&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs6&quot;&gt;union case Option.Some: Value: &amp;#39;T -&amp;gt; Option&amp;lt;&amp;#39;T&amp;gt;&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs7&quot;&gt;union case Option.None: Option&amp;lt;&amp;#39;T&amp;gt;&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>F# and Raven DB</title>
   <link href="http://colinbull.github.io/2013/04/29/FSharp-and-raven-db/"/>
   <updated>2013-04-29T00:00:00+00:00</updated>
   <id>http://colinbull.github.io/2013/04/29/FSharp-and-raven-db</id>
   <content type="html">&lt;p&gt;Ok so I have blogged about these to before. Previously, F# didn't have brilliant support for Linq. F# Expressions couldn't &lt;code&gt;easily&lt;/code&gt; be 
converted to the Linq expression trees that the RavenDB API required. This caused somewhat of a mis-match between the two which made 
Raven difficult but not impossible to use from F#. My previous blog introduced a library  which is available for Raven clients prior 
to version 2.0, to bridge this gap, and tried to make Raven more natural to use from F#. However as of Raven 2.0 this library has 
been removed. The reasons are explained &lt;a href=&quot;https://groups.google.com/forum/?fromgroups=#!searchin/ravendb/fsharp/ravendb/Zv3bwF4Y07M/qsCDbP9VKKkJ&quot;&gt;here&lt;/a&gt;. I don't 
disagree with the reasons ayende cut the support, I wouldn't want to support something I had little knowledge of either. 
However things have changed.... :)&lt;/p&gt;

&lt;h2&gt;&lt;a name=&quot;The-advent-F-3-and-query-expressions&quot; class=&quot;anchor&quot; href=&quot;#The-advent-F-3-and-query-expressions&quot;&gt;The advent F# 3 and query expressions&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;So we are now in the era of F# 3.0 and things have changed somewhat. F# is now truly in the data era... Information Rich programming is an 
awesome feature of F# manifested in the form of &lt;code&gt;Type Providers&lt;/code&gt; and &lt;code&gt;Query Expressions&lt;/code&gt;. If you haven't read about or don't know what 
type providers are then I encourage you to check them out &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/hh156509.aspx&quot;&gt;here&lt;/a&gt;. Type providers are 
not really applicable for use with RavenDB see it is schemaless so for the rest of thispost we will focus on &lt;code&gt;Query Expressions&lt;/code&gt;. It is this 
feature that means the gap between Linq and F# no longer exists. If you are familiar with&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td&gt;&lt;pre lang=&quot;csharp&quot;&gt;&lt;span class=&quot;k&quot;&gt;var&lt;/span&gt; result &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
    (&lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; x &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; xs &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
     &lt;span class=&quot;k&quot;&gt;where&lt;/span&gt; x.Published &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; someDate
     &lt;span class=&quot;k&quot;&gt;select&lt;/span&gt; x.Name).ToArray()&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;then the query expression syntax shouldn't feel that different,&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;6: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;publishedOn&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;date&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;xs&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
    &lt;span onmouseout=&quot;hideTip(event, 'fs25', 55)&quot; onmouseover=&quot;showTip(event, 'fs25', 55)&quot; class=&quot;i&quot;&gt;query&lt;/span&gt; {
           &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;xs&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
           &lt;span class=&quot;i&quot;&gt;where&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Published&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;date&lt;/span&gt;)
           &lt;span class=&quot;i&quot;&gt;select&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Title&lt;/span&gt;
      } &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs26', 56)&quot; onmouseover=&quot;showTip(event, 'fs26', 56)&quot; class=&quot;i&quot;&gt;Seq&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs27', 57)&quot; onmouseover=&quot;showTip(event, 'fs27', 57)&quot; class=&quot;i&quot;&gt;toArray&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;h2&gt;&lt;a name=&quot;So-What-about-RavenDB&quot; class=&quot;anchor&quot; href=&quot;#So-What-about-RavenDB&quot;&gt;So What about RavenDB?&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;Using RavenDB from C# is well documented and things are not that different when using it from F#. The in's and out's are well known and lets 
face it the API is your safety net. It doesn't let you kill yourself, in fact you have to try very hard to actually do anything really bad in 
RavenDB. This is I think the best feature of RavenDB.&lt;/p&gt;

&lt;p&gt;So, what are the things that we need to be aware of when using RavenDB from F#? First things first, initializing the document store. This can 
be done pretty much the same as in C#&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;store&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;DocumentStore&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;Url&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;http&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;localhost&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;8080&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;and this is all well and good if we just use straight forward POCO objects. But what if we want to use F# record or Union types? We need to make a few simple changes.
Lets first consider F# record types, all we need to do here is declare the &lt;code&gt;Id&lt;/code&gt; property as mutable.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;6: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;BlogPost&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; {
    &lt;span class=&quot;k&quot;&gt;mutable&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Id&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs14', 52)&quot; onmouseover=&quot;showTip(event, 'fs14', 52)&quot; class=&quot;i&quot;&gt;string&lt;/span&gt;
    &lt;span class=&quot;i&quot;&gt;Title&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs14', 53)&quot; onmouseover=&quot;showTip(event, 'fs14', 53)&quot; class=&quot;i&quot;&gt;string&lt;/span&gt;
    &lt;span class=&quot;i&quot;&gt;Body&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs14', 54)&quot; onmouseover=&quot;showTip(event, 'fs14', 54)&quot; class=&quot;i&quot;&gt;string&lt;/span&gt;
    &lt;span class=&quot;i&quot;&gt;Published&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;DateTime&lt;/span&gt;
}&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;Simple eh?, but what about Union types, Maps, F# lists? These are a little more complex as Json.NET doesn't do the correct thing to serialize these out of the box. However Json.NET and the 
internalised Raven counterpart does have an extension point and a UnionTypeConverter or MapTypeConverter as Json.NET implementations can be found &lt;a href=&quot;https://github.com/colinbull/FSharp.Enterprise/blob/develop/src/FSharp.Enterprise/Json.fs&quot;&gt;here&lt;/a&gt;. To use this we need to modify our
document store setup a little to include the converter.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;8: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;customisedStore&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;customiseSerialiser&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Raven&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Imports&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Newtonsoft&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Json&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;JsonSerializer&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
        &lt;span class=&quot;i&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Converters&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Add&lt;/span&gt;(&lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Json&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;MapTypeConverter&lt;/span&gt;())
        &lt;span class=&quot;i&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Converters&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Add&lt;/span&gt;(&lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Json&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;UnionTypeConverter&lt;/span&gt;())

    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;store&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;DocumentStore&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;Url&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;http&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;localhost&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;8080&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;)
    &lt;span class=&quot;i&quot;&gt;store&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Conventions&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;CustomizeJsonSerializer&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt; (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;customiseSerialiser&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;s&lt;/span&gt;))
    &lt;span class=&quot;i&quot;&gt;store&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Initialize&lt;/span&gt;()&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;h2&gt;&lt;a name=&quot;Querying-raven&quot; class=&quot;anchor&quot; href=&quot;#Querying-raven&quot;&gt;Querying raven&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;With the document store setup we can now start querying Raven. As with any Raven query we need to create a session from our document store, 
then we need to create the query.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;7: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;getPostsAsOf&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;asOfDate&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
    &lt;span class=&quot;k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;session&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;customisedStore&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;OpenSession&lt;/span&gt;()
    &lt;span onmouseout=&quot;hideTip(event, 'fs25', 58)&quot; onmouseover=&quot;showTip(event, 'fs25', 58)&quot; class=&quot;i&quot;&gt;query&lt;/span&gt; {
        &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;post&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;session&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Query&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;BlogPost&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;() &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
        &lt;span class=&quot;i&quot;&gt;where&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Published&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;asOfDate&lt;/span&gt;)
        &lt;span class=&quot;i&quot;&gt;select&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;post&lt;/span&gt;
    }&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;The above creates a query that is pending execution. To execute this we can run,&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt;1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;3: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;posts&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 
    &lt;span class=&quot;i&quot;&gt;getPostsAsOf&lt;/span&gt; (&lt;span class=&quot;i&quot;&gt;DateTime&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Now&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;AddDays&lt;/span&gt;(&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;2.&lt;/span&gt;)&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Date&lt;/span&gt;) 
    &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs26', 59)&quot; onmouseover=&quot;showTip(event, 'fs26', 59)&quot; class=&quot;i&quot;&gt;Seq&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs27', 60)&quot; onmouseover=&quot;showTip(event, 'fs27', 60)&quot; class=&quot;i&quot;&gt;toArray&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;this will give us an array of BlogPosts published from 2 days ago. Notice we had to enumerate to an array for the query to actually be executed. This is the same execution semantics
as C#; and it is important to realise that there isn't really any magic going on in the world of F#, it is still just a .NET lanuguage it still compiles to CIL and is fully
interoperable with any other .NET library.&lt;/p&gt;

&lt;h2&gt;&lt;a name=&quot;Indexes&quot; class=&quot;anchor&quot; href=&quot;#Indexes&quot;&gt;Indexes&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;OK so things haven't got much better here in terms of static indexes. Basically you still need to define them in C# and then you can extend the document initialization process by
including the assembly that contains the index definitions. However in Raven 2.0, dynamic indexes and promotion to permanent indexes have been massively improved, which reduces the need to create static indexes.&lt;/p&gt;


&lt;div class=&quot;tip&quot; id=&quot;fs1&quot;&gt;namespace System&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs2&quot;&gt;namespace System.Collections&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs3&quot;&gt;namespace System.Collections.Generic&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs4&quot;&gt;namespace System.Reflection&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs5&quot;&gt;namespace Microsoft&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs6&quot;&gt;namespace Microsoft.FSharp&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs7&quot;&gt;namespace Microsoft.FSharp.Reflection&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs8&quot;&gt;namespace System.Text&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs9&quot;&gt;namespace System.IO&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs10&quot;&gt;val ignore : value:&amp;#39;T -&amp;gt; unit&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.ignore&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs11&quot;&gt;val typeof&amp;lt;&amp;#39;T&amp;gt; : System.Type&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.typeof&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs12&quot;&gt;type IEnumerable =&lt;br /&gt;&amp;#160;&amp;#160;member GetEnumerator : unit -&amp;gt; IEnumerator&lt;br /&gt;&lt;br /&gt;Full name: System.Collections.IEnumerable&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs13&quot;&gt;type obj = System.Object&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.obj&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs14&quot;&gt;Multiple items&lt;br /&gt;val string : value:&amp;#39;T -&amp;gt; string&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.string&lt;br /&gt;&lt;br /&gt;--------------------&lt;br /&gt;type string = System.String&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.string&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs15&quot;&gt;module Array&lt;br /&gt;&lt;br /&gt;from Microsoft.FSharp.Collections&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs16&quot;&gt;val find : predicate:(&amp;#39;T -&amp;gt; bool) -&amp;gt; array:&amp;#39;T [] -&amp;gt; &amp;#39;T&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Array.find&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs17&quot;&gt;val empty&amp;lt;&amp;#39;T&amp;gt; : &amp;#39;T []&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Array.empty&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs18&quot;&gt;val typedefof&amp;lt;&amp;#39;T&amp;gt; : System.Type&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.typedefof&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs19&quot;&gt;Multiple items&lt;br /&gt;module Map&lt;br /&gt;&lt;br /&gt;from Microsoft.FSharp.Collections&lt;br /&gt;&lt;br /&gt;--------------------&lt;br /&gt;type Map&amp;lt;&amp;#39;Key,&amp;#39;Value (requires comparison)&amp;gt; =&lt;br /&gt;&amp;#160;&amp;#160;interface IEnumerable&lt;br /&gt;&amp;#160;&amp;#160;interface IComparable&lt;br /&gt;&amp;#160;&amp;#160;interface IEnumerable&amp;lt;KeyValuePair&amp;lt;&amp;#39;Key,&amp;#39;Value&amp;gt;&amp;gt;&lt;br /&gt;&amp;#160;&amp;#160;interface ICollection&amp;lt;KeyValuePair&amp;lt;&amp;#39;Key,&amp;#39;Value&amp;gt;&amp;gt;&lt;br /&gt;&amp;#160;&amp;#160;interface IDictionary&amp;lt;&amp;#39;Key,&amp;#39;Value&amp;gt;&lt;br /&gt;&amp;#160;&amp;#160;new : elements:seq&amp;lt;&amp;#39;Key * &amp;#39;Value&amp;gt; -&amp;gt; Map&amp;lt;&amp;#39;Key,&amp;#39;Value&amp;gt;&lt;br /&gt;&amp;#160;&amp;#160;member Add : key:&amp;#39;Key * value:&amp;#39;Value -&amp;gt; Map&amp;lt;&amp;#39;Key,&amp;#39;Value&amp;gt;&lt;br /&gt;&amp;#160;&amp;#160;member ContainsKey : key:&amp;#39;Key -&amp;gt; bool&lt;br /&gt;&amp;#160;&amp;#160;override Equals : obj -&amp;gt; bool&lt;br /&gt;&amp;#160;&amp;#160;member Remove : key:&amp;#39;Key -&amp;gt; Map&amp;lt;&amp;#39;Key,&amp;#39;Value&amp;gt;&lt;br /&gt;&amp;#160;&amp;#160;...&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Map&amp;lt;_,_&amp;gt;&lt;br /&gt;&lt;br /&gt;--------------------&lt;br /&gt;new : elements:seq&amp;lt;&amp;#39;Key * &amp;#39;Value&amp;gt; -&amp;gt; Map&amp;lt;&amp;#39;Key,&amp;#39;Value&amp;gt;&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs20&quot;&gt;type Array =&lt;br /&gt;&amp;#160;&amp;#160;member Clone : unit -&amp;gt; obj&lt;br /&gt;&amp;#160;&amp;#160;member CopyTo : array:Array * index:int -&amp;gt; unit + 1 overload&lt;br /&gt;&amp;#160;&amp;#160;member GetEnumerator : unit -&amp;gt; IEnumerator&lt;br /&gt;&amp;#160;&amp;#160;member GetLength : dimension:int -&amp;gt; int&lt;br /&gt;&amp;#160;&amp;#160;member GetLongLength : dimension:int -&amp;gt; int64&lt;br /&gt;&amp;#160;&amp;#160;member GetLowerBound : dimension:int -&amp;gt; int&lt;br /&gt;&amp;#160;&amp;#160;member GetUpperBound : dimension:int -&amp;gt; int&lt;br /&gt;&amp;#160;&amp;#160;member GetValue : params indices:int[] -&amp;gt; obj + 7 overloads&lt;br /&gt;&amp;#160;&amp;#160;member Initialize : unit -&amp;gt; unit&lt;br /&gt;&amp;#160;&amp;#160;member IsFixedSize : bool&lt;br /&gt;&amp;#160;&amp;#160;...&lt;br /&gt;&lt;br /&gt;Full name: System.Array&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs21&quot;&gt;System.Array.CreateInstance(elementType: System.Type, params lengths: int64 []) : System.Array&lt;br /&gt;System.Array.CreateInstance(elementType: System.Type, params lengths: int []) : System.Array&lt;br /&gt;System.Array.CreateInstance(elementType: System.Type, length: int) : System.Array&lt;br /&gt;System.Array.CreateInstance(elementType: System.Type, lengths: int [], lowerBounds: int []) : System.Array&lt;br /&gt;System.Array.CreateInstance(elementType: System.Type, length1: int, length2: int) : System.Array&lt;br /&gt;System.Array.CreateInstance(elementType: System.Type, length1: int, length2: int, length3: int) : System.Array&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs22&quot;&gt;System.Array.Copy(sourceArray: System.Array, destinationArray: System.Array, length: int64) : unit&lt;br /&gt;System.Array.Copy(sourceArray: System.Array, destinationArray: System.Array, length: int) : unit&lt;br /&gt;System.Array.Copy(sourceArray: System.Array, sourceIndex: int64, destinationArray: System.Array, destinationIndex: int64, length: int64) : unit&lt;br /&gt;System.Array.Copy(sourceArray: System.Array, sourceIndex: int, destinationArray: System.Array, destinationIndex: int, length: int) : unit&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs23&quot;&gt;val box : value:&amp;#39;T -&amp;gt; obj&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.box&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs24&quot;&gt;val empty&amp;lt;&amp;#39;Key,&amp;#39;T (requires comparison)&amp;gt; : Map&amp;lt;&amp;#39;Key,&amp;#39;T&amp;gt; (requires comparison)&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Map.empty&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs25&quot;&gt;val query : Linq.QueryBuilder&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.query&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs26&quot;&gt;module Seq&lt;br /&gt;&lt;br /&gt;from Microsoft.FSharp.Collections&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs27&quot;&gt;val toArray : source:seq&amp;lt;&amp;#39;T&amp;gt; -&amp;gt; &amp;#39;T []&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Collections.Seq.toArray&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>F# end to end</title>
   <link href="http://colinbull.github.io/2013/02/23/FSharp-end-to-end/"/>
   <updated>2013-02-23T00:00:00+00:00</updated>
   <id>http://colinbull.github.io/2013/02/23/FSharp-end-to-end</id>
   <content type="html">&lt;h2&gt;&lt;a name=&quot;Introduction&quot; class=&quot;anchor&quot; href=&quot;#Introduction&quot;&gt;Introduction&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;Recently my colleague &lt;a href=&quot;https://twitter.com/simontcousins&quot;&gt;@simontcousins&lt;/a&gt; published an article comparing to similar projects one written 
in C# one written in F#. The conclusion is that for the two projects the F# one is about 4% of the size.
You can read more about this &lt;a href=&quot;http://www.simontylercousins.net/journal/2013/2/22/does-the-language-you-choose-make-a-difference.html&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now normally, a typical project comprises of several languages / technologies.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Application Code -&gt; C#&lt;/li&gt;
&lt;li&gt;Build -&gt; MSBuild/Nant&lt;/li&gt;
&lt;li&gt;Deploy -&gt; Powershell script/Batch script&lt;/li&gt;
&lt;li&gt;UI (Web) -&gt; HTML/Javascript&lt;/li&gt;
&lt;li&gt;Documentation -&amp;amp;gt; Word/HTML&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However the F# project in question here has a profile more like this,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Application Code -&gt; F#&lt;/li&gt;
&lt;li&gt;Build -&gt; F#&lt;/li&gt;
&lt;li&gt;Deploy -&gt; F#&lt;/li&gt;
&lt;li&gt;UI (Web) -&gt; HTML/CSS/Javascript&lt;/li&gt;
&lt;li&gt;Documentation -&gt; F#&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note the stack is 'almost' completely F# (we actually could have made this completely F# see below). Maybe I'm biased but I think that this is a huge benefit for 
maintainability I only need to have my F# brain switched on and I can change any part of the application. Sure I have to learn a few 
libraries, but the playfulness offered by the REPL here makes testing and experimenting easy; this is especially true when it comes writing 
build and deployment scripts, which I normally find quiet difficult to test.&lt;/p&gt;

&lt;h2&gt;&lt;a name=&quot;Full-stack-F&quot; class=&quot;anchor&quot; href=&quot;#Full-stack-F&quot;&gt;Full stack F#&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;So is it possible to use F# for everything Build, Deployment, UI (Web/WPF), Documentation. The answer is simply YES!! 
There is just a few libraries we need to know about to achieve this. Lets look at each area of a typical application and see which 
libraries we can use.&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;Application-Logic&quot; class=&quot;anchor&quot; href=&quot;#Application-Logic&quot;&gt;Application Logic&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Ok this might seem like an obvious one, just write F#, but I thought I'd use this as an opportunity to highlight some libraries that I find useful&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;&quot; title=&quot;http://fsharp.github.com/fsharpx/&quot;&gt;FSharpx&lt;/a&gt; - Contains lots of extensions to the F# core modules, many useful data structures, commonly used monads, validation, &lt;a href=&quot;http://msdn.microsoft.com/en-gb/library/hh156509.aspx&quot; target=&quot;_blank&quot;&gt;type providers&lt;/a&gt;, async extensions etc.&lt;/li&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;&quot; title=&quot;http://tpetricek.github.com/FSharp.Data&quot;&gt;FSharp.Data&lt;/a&gt; - Contains implementation of various type providers such as CSV, XML and JSON and I'm sure as the library matures we will see a lot more implementations to connect to wide variety of data sources.&lt;/li&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;&lt;a name=&quot;Build-and-Deployment&quot; class=&quot;anchor&quot; href=&quot;#Build-and-Deployment&quot;&gt;Build and Deployment&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;To build and deploy application with F# we can use &lt;a href=&quot;http://fsharp.github.com/FAKE&quot;&gt;FAKE&lt;/a&gt;. FAKE allows you to write your build and 
deployment scripts in F#. A simple script might look something like this&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt; 1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 8: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 9: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;10: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;11: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;12: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;13: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;14: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;15: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;16: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;17: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;18: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;19: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;20: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;21: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;22: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;23: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;24: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;25: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;c&quot;&gt;// include Fake libs&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;open&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Fake&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;//Define Targets&lt;/span&gt;

&lt;span class=&quot;i&quot;&gt;Description&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Cleans&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;the&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;last&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;Target&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Clean&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; () &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;i&quot;&gt;trace&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Cleaning&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;stuff&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
)

&lt;span class=&quot;i&quot;&gt;Target&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Build&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; () &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;i&quot;&gt;trace&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Building&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;the&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
)

&lt;span class=&quot;i&quot;&gt;Target&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Deploy&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; () &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;i&quot;&gt;trace&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Deploying&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
)

&lt;span class=&quot;c&quot;&gt;//Define Dependencies&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Clean&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Build&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Deploy&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;//Start Build&lt;/span&gt;
&lt;span class=&quot;i&quot;&gt;RunParameterTargetOrDefault&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;target&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Deploy&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;The really nice thing about this is you have the full .NET framework and the full power of F# available in your scripts. Additionally FAKE 
also has an accompanying website, which allows you to manage your deployment agents, so you can easily deploy, upgrade or rollback 
applications from a central place.&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;UI&quot; class=&quot;anchor&quot; href=&quot;#UI&quot;&gt;UI&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;How you tackle writing a UI in F# obviously depends on your choice of technologies. There are others obviously but the two I'm going to 
consider are WPF and HTML/CSS/Javascript.&lt;/p&gt;

&lt;h4&gt;&lt;a name=&quot;WPF&quot; class=&quot;anchor&quot; href=&quot;#WPF&quot;&gt;WPF&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;If you choose to write your UI using WPF then things are fairly straight forward, Write XAML markup and then use code behind F#. 
However wiring up the code behind can be a pain because of the C# code gen involved, typically you have to load the view yourself 
using a XAML reader, or code the view layout in F# as in these series of examples from &lt;a href=&quot;http://blogs.msdn.com/b/dsyme/archive/2008/01/05/learning-wpf-through-f-and-vice-versa-by-john-liao.aspx?Redirected=true&quot;&gt;John Laio&lt;/a&gt;. 
If however you want to keep XAML markup then FSharpx has a &lt;a href=&quot;https://github.com/fsharp/fsharpx/tree/master/src/FSharpx.TypeProviders.Xaml&quot;&gt;XAML type provider&lt;/a&gt; 
that helps things along here.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt; 1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 8: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 9: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;10: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;11: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;12: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;13: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;14: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;15: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;16: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;open&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs1', 1)&quot; onmouseover=&quot;showTip(event, 'fs1', 1)&quot; class=&quot;i&quot;&gt;System&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;open&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs1', 2)&quot; onmouseover=&quot;showTip(event, 'fs1', 2)&quot; class=&quot;i&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs2', 3)&quot; onmouseover=&quot;showTip(event, 'fs2', 3)&quot; class=&quot;i&quot;&gt;Windows&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;open&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs1', 4)&quot; onmouseover=&quot;showTip(event, 'fs1', 4)&quot; class=&quot;i&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs2', 5)&quot; onmouseover=&quot;showTip(event, 'fs2', 5)&quot; class=&quot;i&quot;&gt;Windows&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Controls&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;open&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;FSharpx&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;MainWindow&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;XAML&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;libs&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;MainWindow&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;xaml&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;loadWindow&lt;/span&gt;() &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;window&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;MainWindow&lt;/span&gt;()
    &lt;span class=&quot;i&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;myButton&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Click&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Add&lt;/span&gt;(&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; _ &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;i&quot;&gt;MessageBox&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Show&lt;/span&gt;(&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Hello&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;world&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;)
        &lt;span class=&quot;o&quot;&gt;|&amp;gt;&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs3', 6)&quot; onmouseover=&quot;showTip(event, 'fs3', 6)&quot; class=&quot;i&quot;&gt;ignore&lt;/span&gt;)
    &lt;span class=&quot;i&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Root&lt;/span&gt;

[&amp;lt;&lt;span class=&quot;i&quot;&gt;STAThread&lt;/span&gt;&amp;gt;]
&lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;main&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;args&lt;/span&gt;) &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; (&lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Application&lt;/span&gt;())&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Run&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;loadWindow&lt;/span&gt;())&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;See &lt;a href=&quot;http://www.navision-blog.de/blog/2012/03/22/wpf-designer-for-f/&quot;&gt;Steffan Forkmann's&lt;/a&gt; post for more information about this. 
Lets also not forget about first class events and the asynchronous programming model in F# that makes writing responsive UI's that much easier.&lt;/p&gt;

&lt;h4&gt;&lt;a name=&quot;HTML-CSS-Javascript&quot; class=&quot;anchor&quot; href=&quot;#HTML-CSS-Javascript&quot;&gt;HTML/CSS/Javascript&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;If you go webby then things get a little more interesting, we have several options available here.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.websharper.com/home&quot;&gt;WebSharper&lt;/a&gt; - This is a very complete web framework, I have not personally played with it yet but I understand it does everything you'd want and more. Well worth checking out.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/ZachBray/FunScript&quot;&gt;FunScript&lt;/a&gt; - A new project, but it exploits the power of type providers to offer strongly typed access to TypeScript files &lt;a href=&quot;http://tomasp.net/blog/&quot;&gt;@thomaspetricek&lt;/a&gt; has a nice talk about it. 
With fun script you still have to write the HTML markup, although providing a Combinator library to emit the markup wouldn't be that difficult. (If some one knows of one I'll add it here), but this isn't application logic anyway. The important stuff is still written in F# and compiled to javascript later on.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;&lt;a name=&quot;Documentation&quot; class=&quot;anchor&quot; href=&quot;#Documentation&quot;&gt;Documentation&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;http://tomasp.net/blog/&quot;&gt;@thomaspetricek&lt;/a&gt; recently released &lt;a href=&quot;https://github.com/tpetricek/FSharp.Formatting&quot;&gt;FSharp.Formatting&lt;/a&gt; we can generate documentation 
from an F# script file, using a mix of markdown and F#, for an example see this &lt;a href=&quot;http://tpetricek.github.com/FSharp.Formatting/&quot;&gt;link&lt;/a&gt;. This can then be integrated into your FAKE build script, 
using a build target something like the following example, Incidentally this is exactly the library that is used to create this blog.&lt;/p&gt;

&lt;table class=&quot;pre&quot;&gt;&lt;tr&gt;&lt;td class=&quot;lines&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;l&quot;&gt; 1: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 2: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 3: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 4: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 5: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 6: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 7: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 8: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt; 9: &lt;/span&gt;
&lt;span class=&quot;l&quot;&gt;10: &lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;
&lt;td class=&quot;snippet&quot;&gt;&lt;pre class=&quot;fssnip&quot;&gt;
&lt;span class=&quot;k&quot;&gt;open&lt;/span&gt; &lt;span onmouseout=&quot;hideTip(event, 'fs1', 7)&quot; onmouseover=&quot;showTip(event, 'fs1', 7)&quot; class=&quot;i&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span onmouseout=&quot;hideTip(event, 'fs4', 8)&quot; onmouseover=&quot;showTip(event, 'fs4', 8)&quot; class=&quot;i&quot;&gt;IO&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;open&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;FSharp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Literate&lt;/span&gt;

&lt;span class=&quot;i&quot;&gt;Target&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Docs&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt; (&lt;span class=&quot;k&quot;&gt;fun&lt;/span&gt; _ &lt;span class=&quot;k&quot;&gt;-&amp;gt;&lt;/span&gt; 
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;template&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Path&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Combine&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;currentDirectory&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;template&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;)
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;sources&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;Path&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;Combine&lt;/span&gt;(&lt;span class=&quot;k&quot;&gt;__SOURCE_DIRECTORY__&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;samples&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;)
    &lt;span class=&quot;k&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;i&quot;&gt;output&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;out_dir&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;
    
    &lt;span class=&quot;i&quot;&gt;Literate&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;i&quot;&gt;ProcessDirectory&lt;/span&gt;(&lt;span class=&quot;i&quot;&gt;sources&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;template&lt;/span&gt;, &lt;span class=&quot;i&quot;&gt;output&lt;/span&gt;)
)&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;h2&gt;&lt;a name=&quot;Conclusion&quot; class=&quot;anchor&quot; href=&quot;#Conclusion&quot;&gt;Conclusion&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;Ok I might of over stated that &lt;strong&gt;everything&lt;/strong&gt; can be written in F#, certainly at the moment there is a lack of libraries for 
emitting XAML and HTML (with the exception of WebSharper of course). But HTML and XAML are really inconsequential when it comes the to 
the correctness of your application they do not contain any logic which needs to be tested they simply control layout. The important thing 
to take from the above is the fact that all of your logic whether it is for build, deployment, UI interaction, example documentation can be 
written in a type safe way using the various libraries and F# feature spoken about above.&lt;/p&gt;


&lt;div class=&quot;tip&quot; id=&quot;fs1&quot;&gt;namespace System&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs2&quot;&gt;namespace System.Windows&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs3&quot;&gt;val ignore : value:&amp;#39;T -&amp;gt; unit&lt;br /&gt;&lt;br /&gt;Full name: Microsoft.FSharp.Core.Operators.ignore&lt;/div&gt;
&lt;div class=&quot;tip&quot; id=&quot;fs4&quot;&gt;namespace System.IO&lt;/div&gt;
</content>
 </entry>
 

</feed>
