<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>F# for Fun and Profit</title>
    <link>https://fsharpforfunandprofit.com/</link>
    <description>Recent content on F# for Fun and Profit</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Sun, 28 Dec 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://fsharpforfunandprofit.com/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Weaving design, part 2</title>
      <link>https://fsharpforfunandprofit.com/posts/designing-weaving-software-2/</link>
      <pubDate>Sun, 28 Dec 2025 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/designing-weaving-software-2/</guid>
      <description>This is the second post in a series on designing software for weavers. These posts contain random thoughts and musings based on design challenges that I come across as I build a real-world project. In the first post I give the context for this project and presented the code for a initial domain-driven design. In this post and the next one, we&amp;rsquo;ll move to the next stage, converting between a text representation and the domain model.</description>
    </item>
    
    <item>
      <title>Designing weaving software</title>
      <link>https://fsharpforfunandprofit.com/posts/designing-weaving-software/</link>
      <pubDate>Fri, 19 Dec 2025 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/designing-weaving-software/</guid>
      <description>This post is part of the 2025 F# Advent Calendar. Check out all the other great posts there! And special thanks to Sergey Tihon for organizing this.
 Recently, I have taken up a new hobby, hand weaving. As a meditative, physical activity with tangible results, it&amp;rsquo;s a great antidote to doom-scrolling and spending too much time in front of a screen. The first time I tried it, something about the weaving process really appealed to me and I got a little bit obsessed with learning more.</description>
    </item>
    
    <item>
      <title>The EDFH is defeated once again</title>
      <link>https://fsharpforfunandprofit.com/posts/return-of-the-edfh-3/</link>
      <pubDate>Tue, 16 Feb 2021 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/return-of-the-edfh-3/</guid>
      <description>In the first post in this series, we came up with some properties that could be used to test a run-length encoding implementation:
 The output must contain all the characters from the input, in the same order Two adjacent characters in the output cannot be the same The sum of the run lengths in the output must equal the total length of the input If the input is reversed, the output must also be reversed  In the previous post, we tested various RLE implementations created by the Enterprise Developer From Hell and were happy that they all failed.</description>
    </item>
    
    <item>
      <title>Generating interesting inputs for property-based testing</title>
      <link>https://fsharpforfunandprofit.com/posts/return-of-the-edfh-2/</link>
      <pubDate>Mon, 15 Feb 2021 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/return-of-the-edfh-2/</guid>
      <description>In the previous post we attempted to define some properties for a run-length encoding (RLE) implementation, but got stuck because the random values being generated by FsCheck were not very useful.
In this post we&amp;rsquo;ll look at a couple of ways of generating &amp;ldquo;interesting&amp;rdquo; inputs, and how to observe them so that we can be sure that they are indeed interesting.
Observing the generated data     The first thing we should do is add some kind of monitoring to see how many of the inputs are interesting.</description>
    </item>
    
    <item>
      <title>The &#39;The Return of the EDFH&#39; series</title>
      <link>https://fsharpforfunandprofit.com/series/return-of-the-edfh/</link>
      <pubDate>Sun, 14 Feb 2021 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/series/return-of-the-edfh/</guid>
      <description>This series of posts is a follow-up to my previous series on property-based testing and the Enterprise Developer From Hell. It revisits the fundamentals of property-based testing and how to use the EDFH to help design useful and effective tests.</description>
    </item>
    
    <item>
      <title>The Return of the Enterprise Developer From Hell</title>
      <link>https://fsharpforfunandprofit.com/posts/return-of-the-edfh/</link>
      <pubDate>Sun, 14 Feb 2021 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/return-of-the-edfh/</guid>
      <description>In a previous series of posts, I introduced you to the burned-out and lazy programmer known as the Enterprise Developer From Hell, or the EDFH for short. As we saw, the EDFH loves to practice malicious compliance.
Recently, the EDFH&amp;rsquo;s influence was apparent with this viral answer to an interview problem.
Write a function that converts the input to the output.
 Input: &amp;ldquo;aaaabbbcca&amp;rdquo; Output: [(&amp;lsquo;a&amp;rsquo;,4), (&amp;lsquo;b&amp;rsquo;,3), (&amp;lsquo;c&amp;rsquo;,2), (&amp;lsquo;a&amp;rsquo;,1)]  Of course the EDFH answer is simple:</description>
    </item>
    
    <item>
      <title>Terms and Conditions</title>
      <link>https://fsharpforfunandprofit.com/about/terms/</link>
      <pubDate>Fri, 01 Jan 2021 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/about/terms/</guid>
      <description>These terms and conditions form your agreement with this site (hereafter, the SITE) and ScottW (hereafter, ME).
By reading this site, you agree to the following:
  You acknowledge that this SITE is written by one person, ME, over many years as I was learning, and that many of the posts may be out-of-date, incomplete, or just plain wrong. You also acknowledge that the ME of today is not happy with many of the old posts but has been too lazy to update them.</description>
    </item>
    
    <item>
      <title>Revisiting the six approaches</title>
      <link>https://fsharpforfunandprofit.com/posts/dependencies-5/</link>
      <pubDate>Thu, 24 Dec 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/dependencies-5/</guid>
      <description>In this series, we looked at six different approaches to dependency injection.
 In the first post, we looked at &amp;ldquo;dependency retention&amp;rdquo; (inlining the dependencies) and &amp;ldquo;dependency rejection&amp;rdquo;, or keeping I/O at the edges of your implementation. In the second post, we looked at injecting dependencies using standard function parameters. In the third post, we looked at dependency handling using classic OO-style dependency injection and the FP equivalent: the Reader monad.</description>
    </item>
    
    <item>
      <title>Dependency Interpretation</title>
      <link>https://fsharpforfunandprofit.com/posts/dependencies-4/</link>
      <pubDate>Wed, 23 Dec 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/dependencies-4/</guid>
      <description>In this series, we are looking at six different approaches to dependency injection.
 In the first post, we looked at &amp;ldquo;dependency retention&amp;rdquo; (inlining the dependencies) and &amp;ldquo;dependency rejection&amp;rdquo; (keeping I/O at the edges of your implementation). In the second post, we looked at injecting dependencies using standard function parameters. In the third post, we looked at dependency handling using classic OO-style dependency injection and the FP equivalent: the Reader monad.</description>
    </item>
    
    <item>
      <title>Dependency injection using the Reader monad</title>
      <link>https://fsharpforfunandprofit.com/posts/dependencies-3/</link>
      <pubDate>Tue, 22 Dec 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/dependencies-3/</guid>
      <description>In this series, we are looking at six different approaches to dependency injection.
 In the first post, we looked at &amp;ldquo;dependency retention&amp;rdquo; (inlining the dependencies) and &amp;ldquo;dependency rejection&amp;rdquo; (keeping I/O at the edges of your implementation). In the second post, we looked at injecting dependencies as standard function parameters. In this post, we&amp;rsquo;ll look at dependency handling using classic OO-style dependency injection and the FP equivalent: the Reader monad   Revisiting the logging problem     In the previous post, I briefly discussed the logging problem.</description>
    </item>
    
    <item>
      <title>Dependency injection using parameters</title>
      <link>https://fsharpforfunandprofit.com/posts/dependencies-2/</link>
      <pubDate>Mon, 21 Dec 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/dependencies-2/</guid>
      <description>In this series, we are looking at six different approaches to dependency injection.
 In the first post, we looked at &amp;ldquo;dependency retention&amp;rdquo; (inlining the dependencies) and &amp;ldquo;dependency rejection&amp;rdquo; (keeping I/O at the edges of your implementation). In this post, we&amp;rsquo;ll look at &amp;ldquo;dependency parameterization&amp;rdquo; as a way of managing dependencies.   Dependency parameterization     Given that you have made the effort to separate pure from impure code, you may still need to manage other dependencies.</description>
    </item>
    
    <item>
      <title>Six approaches to dependency injection</title>
      <link>https://fsharpforfunandprofit.com/posts/dependencies/</link>
      <pubDate>Sun, 20 Dec 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/dependencies/</guid>
      <description>This post is part of the 2020 F# Advent Calendar. Check out all the other great posts there! And special thanks to Sergey Tihon for organizing this.
 In this series of posts, we&amp;rsquo;ll look at six different approaches to doing &amp;ldquo;dependency injection&amp;rdquo;.
This post was inspired by Mark Seemann&amp;rsquo;s similar series of posts, and covers the same ideas in a slightly different way. There are other good posts on this topic by Bartosz Sypytkowski and Carsten König.</description>
    </item>
    
    <item>
      <title>Low-risk ways to use F# at work</title>
      <link>https://fsharpforfunandprofit.com/series/low-risk-ways-to-use-fsharp-at-work/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/series/low-risk-ways-to-use-fsharp-at-work/</guid>
      <description>So you&amp;rsquo;re all excited about functional programming, and you&amp;rsquo;ve been learning F# in your spare time, and you&amp;rsquo;re annoying your co-workers by ranting about how great it is, and you&amp;rsquo;re itching to use it for serious stuff at work&amp;hellip;
But then you hit a brick wall.
Your workplace has a &amp;ldquo;C# only&amp;rdquo; policy and won&amp;rsquo;t let you use F#.
If you work in a typical enterprise environment, getting a new language approved will be a long drawn out process, involving persuading your teammates, the QA guys, the ops guys, your boss, your boss&amp;rsquo;s boss, and the mysterious bloke down the hall who you&amp;rsquo;ve never talked to.</description>
    </item>
    
    <item>
      <title>Recursive types and folds</title>
      <link>https://fsharpforfunandprofit.com/series/recursive-types-and-folds/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/series/recursive-types-and-folds/</guid>
      <description>In this series, we&amp;rsquo;ll look at recursive types and how to use them, and on the way, we&amp;rsquo;ll look at catamorphisms, tail recursion, the difference between left and right folds, and more.</description>
    </item>
    
    <item>
      <title>The &#39;Annotated walkthroughs&#39; series</title>
      <link>https://fsharpforfunandprofit.com/series/annotated-walkthroughs/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/series/annotated-walkthroughs/</guid>
      <description>One comment I hear often is a complaint about the gap between theory and practice in F# and functional programming in general. In other words, you know the theory, but how do you actually design and implement an application using FP principles?
So I thought it might be useful to show you how I personally would go about designing and implementing some little applications from beginning to end.
These will be sort of annotated live coding sessions.</description>
    </item>
    
    <item>
      <title>The &#39;Computation Expressions&#39; series</title>
      <link>https://fsharpforfunandprofit.com/series/computation-expressions/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/series/computation-expressions/</guid>
      <description>In this series, you&amp;rsquo;ll learn what computation expressions are, some common patterns, and how to make your own. In the process, we&amp;rsquo;ll also look at continuations, the bind function, wrapper types, and more.</description>
    </item>
    
    <item>
      <title>The &#39;dependency cycle&#39; series</title>
      <link>https://fsharpforfunandprofit.com/series/dependency-cycles/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/series/dependency-cycles/</guid>
      <description>One of the most common complaints about F# is that it requires code to be in dependency order. That is, you cannot use forward references to code that hasn&amp;rsquo;t been seen by the compiler yet.
In this series, I discuss dependency cycles, why they are bad, and how to get rid of them.</description>
    </item>
    
    <item>
      <title>The &#39;designing with types&#39; series</title>
      <link>https://fsharpforfunandprofit.com/series/designing-with-types/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/series/designing-with-types/</guid>
      <description>In this series, we&amp;rsquo;ll look at some of the ways we can use types as part of the design process. In particular, the thoughtful use of types can make a design more transparent and improve correctness at the same time.
This series will be focused on the &amp;ldquo;micro level&amp;rdquo; of design. That is, working at the lowest level of individual types and functions. Higher level design approaches, and the associated decisions about using functional or object-oriented style, will be discussed in another series.</description>
    </item>
    
    <item>
      <title>The &#39;expressions and syntax&#39; series</title>
      <link>https://fsharpforfunandprofit.com/series/expressions-and-syntax/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/series/expressions-and-syntax/</guid>
      <description>In this series of posts we&amp;rsquo;ll look at how functions and values are combined into expressions, and the different kinds of expressions that are available in F#.</description>
    </item>
    
    <item>
      <title>The &#39;functional approach to authorization&#39; series</title>
      <link>https://fsharpforfunandprofit.com/series/a-functional-approach-to-authorization/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/series/a-functional-approach-to-authorization/</guid>
      <description>In this series of posts, I&amp;rsquo;ll look at how you might handle the common security challenge of authorization. That is, how can you ensure that clients of your code can only do what you want them to do?
This series will sketch out two different approaches, first using an approach called capability based security, and second using statically checked types to emulate access tokens.
Interestingly, both approaches tend to produce a cleaner, more modular design as a side effect, which is why I like them!</description>
    </item>
    
    <item>
      <title>The &#39;Handling State&#39; series</title>
      <link>https://fsharpforfunandprofit.com/series/handling-state/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/series/handling-state/</guid>
      <description>In this series of posts, I&amp;rsquo;ll look at how you can thread state through a series of pure functions in a convenient way.
To start with, I&amp;rsquo;ll tell the story of Dr Frankenfunctor and the Monadster, and how the Doctor needed a way to create &amp;ldquo;recipes&amp;rdquo; that were activated when lightning struck.
The Doctor then devised ways to work with these recipes using functions such as map, bind and apply.</description>
    </item>
    
    <item>
      <title>The &#39;object-oriented programming in F#&#39; series</title>
      <link>https://fsharpforfunandprofit.com/series/object-oriented-programming-in-fsharp/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/series/object-oriented-programming-in-fsharp/</guid>
      <description>As has been stressed many times before, F# is fundamentally a functional language at heart, yet the OO features have been nicely integrated and do not have a &amp;ldquo;tacked-on&amp;rdquo; feeling. As a result, it is quite viable to use F# just as an OO language, as an alternative to C#, say.
In this series, we&amp;rsquo;ll look at how F# supports object-oriented classes and methods.</description>
    </item>
    
    <item>
      <title>The &#39;Optimization&#39; series</title>
      <link>https://fsharpforfunandprofit.com/series/optimization/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/series/optimization/</guid>
      <description>This is a placeholder for a series I haven&amp;rsquo;t written yet. Please check back later!</description>
    </item>
    
    <item>
      <title>The &#39;porting from C#&#39; series</title>
      <link>https://fsharpforfunandprofit.com/series/porting-from-csharp/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/series/porting-from-csharp/</guid>
      <description>Do you want to port C# code to F#? In this series of posts we&amp;rsquo;ll look at various approaches to this, and the design decisions and trade-offs involved.</description>
    </item>
    
    <item>
      <title>The &#39;Property Based Testing&#39; series</title>
      <link>https://fsharpforfunandprofit.com/series/property-based-testing/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/series/property-based-testing/</guid>
      <description>This series of posts will introduce you to the fundamentals of property-based testing: how it is different from traditional example-based testing, why it is important, and how to work with properties in theory and practice.
A follow-up series is available too: The Return of the Enterprise Developer From Hell.
There is also a talk on property-based testing based on these posts. Slides and video here.</description>
    </item>
    
    <item>
      <title>The &#39;recipe for a functional app&#39; series</title>
      <link>https://fsharpforfunandprofit.com/series/a-recipe-for-a-functional-app/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/series/a-recipe-for-a-functional-app/</guid>
      <description>&amp;ldquo;I think I understand functional programming at the micro level, and I have written toy programs, but how do I actually go about writing a complete application, with real data, real error handling, and so on?&amp;quot;
This is a very common question, so I thought that in this series of posts I&amp;rsquo;d describe a recipe for doing exactly this, covering design, validation, error handling, persistence, dependency management, code organization, and so on.</description>
    </item>
    
    <item>
      <title>The &#39;thinking functionally&#39; series</title>
      <link>https://fsharpforfunandprofit.com/series/thinking-functionally/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/series/thinking-functionally/</guid>
      <description>This series of posts will introduce you to the fundamentals of functional programming – what does it really mean to &amp;ldquo;program functionally&amp;rdquo;, and how this approach differs from object oriented or imperative programming.</description>
    </item>
    
    <item>
      <title>The &#39;Understanding F# types&#39; series</title>
      <link>https://fsharpforfunandprofit.com/series/understanding-fsharp-types/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/series/understanding-fsharp-types/</guid>
      <description>F# is not just about functions; the powerful type system is another key ingredient. And just as with functions, understanding the type system is critical to being fluent and comfortable in the language.
In addition to the common .NET types. F# has some other types that are very common in functional languages but not available in imperative languages like C# or Java.
This series introduces these types and how to use them.</description>
    </item>
    
    <item>
      <title>The &#39;Understanding monoids&#39; series</title>
      <link>https://fsharpforfunandprofit.com/series/understanding-monoids/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/series/understanding-monoids/</guid>
      <description>In this series, we&amp;rsquo;ll look at a very common &amp;ldquo;pattern&amp;rdquo; known as a monoid.
Monoids are not really a design pattern; more an approach to working with many different types of values in a common way. In fact, once you understand monoids, you will start seeing them everywhere!</description>
    </item>
    
    <item>
      <title>The &#39;Why use F#&#39; series</title>
      <link>https://fsharpforfunandprofit.com/series/why-use-fsharp/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/series/why-use-fsharp/</guid>
      <description>This series of posts will give you a guided tour through the main features of F# and then show you ways that F# can help you in your day-to-day development.</description>
    </item>
    
    <item>
      <title>Understanding Map and Apply and Bind</title>
      <link>https://fsharpforfunandprofit.com/series/map-and-bind-and-apply-oh-my/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/series/map-and-bind-and-apply-oh-my/</guid>
      <description>In this series of posts, I&amp;rsquo;ll attempt to describe some of the core functions for dealing with generic data types (such as Option and List). This is a follow-up post to my talk on functional patterns.
Yes, I know that I promised not to do this kind of thing, but for this post I thought I&amp;rsquo;d take a different approach from most people. Rather than talking about abstractions such as type classes, I thought it might be useful to focus on the core functions themselves and how they are used in practice.</description>
    </item>
    
    <item>
      <title>Understanding Parser Combinators</title>
      <link>https://fsharpforfunandprofit.com/series/understanding-parser-combinators/</link>
      <pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/series/understanding-parser-combinators/</guid>
      <description>In this series, we&amp;rsquo;ll look at how so-called &amp;ldquo;applicative parsers&amp;rdquo; work. In order to understand something, there&amp;rsquo;s nothing like building it for yourself, and so we&amp;rsquo;ll create a basic parser library from scratch, then some useful &amp;ldquo;parser combinators&amp;rdquo;, and then finish off by building a complete JSON parser.</description>
    </item>
    
    <item>
      <title>Against Railway-Oriented Programming</title>
      <link>https://fsharpforfunandprofit.com/posts/against-railway-oriented-programming/</link>
      <pubDate>Fri, 20 Dec 2019 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/against-railway-oriented-programming/</guid>
      <description>This post is part of the 2019 F# Advent Calendar. Check out all the other great posts there! And special thanks to Sergey Tihon for organizing this.
 Six and half years ago, I wrote a post and did a talk on what I called &amp;ldquo;Railway Oriented Programming&amp;rdquo;. It was a way for me to explain to myself and others how to use Result/Either to for chaining together error-generating functions.</description>
    </item>
    
    <item>
      <title>Why F# is the best enterprise language</title>
      <link>https://fsharpforfunandprofit.com/posts/fsharp-is-the-best-enterprise-language/</link>
      <pubDate>Thu, 20 Dec 2018 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/fsharp-is-the-best-enterprise-language/</guid>
      <description>This post is part of the 2018 F# Advent Calendar. Check out all the other great posts there! And special thanks to Sergey Tihon for organizing this.
 &amp;ldquo;Why F# is the best enterprise language&amp;rdquo; is not meant to be a clickbait title &amp;ndash; it is my sincere opinion, and in this post I will attempt to justify it. If you stick around to the end, I hope that you will agree, or at least be a little bit persuaded.</description>
    </item>
    
    <item>
      <title>Serializing your domain model</title>
      <link>https://fsharpforfunandprofit.com/posts/serializing-your-domain-model/</link>
      <pubDate>Wed, 20 Dec 2017 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/serializing-your-domain-model/</guid>
      <description>This post is part of the F# Advent Calendar in English 2017 project. Check out all the other great posts there! And special thanks to Sergey Tihon for organizing this.
 In most discussions of functional design principles, we focus on implementing business workflows as pure functions with inputs and outputs. But where do these inputs come from? And where do the outputs go? They come from, or go to, some infrastructure that lives outside our workflow &amp;ndash; a message queue, a web request, and so on.</description>
    </item>
    
    <item>
      <title>Functional approaches to dependency injection</title>
      <link>https://fsharpforfunandprofit.com/posts/dependency-injection-1/</link>
      <pubDate>Mon, 05 Dec 2016 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/dependency-injection-1/</guid>
      <description>This post is part of the F# Advent Calendar in English 2016 project. Check out all the other great posts there! And special thanks to Sergey Tihon for organizing this.
 UPDATE: This post is superceded by a newer one here.
For people who are learning functional programming techniques, one of the more common questions is: &amp;ldquo;how do you do dependency injection?&amp;rdquo; This series of posts addresses that topic.</description>
    </item>
    
    <item>
      <title>Happy F# Day!</title>
      <link>https://fsharpforfunandprofit.com/posts/happy-fsharp-day-2/</link>
      <pubDate>Tue, 12 Apr 2016 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/happy-fsharp-day-2/</guid>
      <description>Last year, I wrote a post called &amp;ldquo;Happy F# Day&amp;rdquo;, explaining why I thought F# needed a &amp;ldquo;birthday&amp;rdquo; that we could celebrate as a community.
Here we are one year later! I&amp;rsquo;m going to promote that date (April 12th) again, and use it an excuse to review what has happened in the last year in the world of F#.
And a lot has happened in the last year. Here&amp;rsquo;s my personal take.</description>
    </item>
    
    <item>
      <title>Thirteen ways of looking at a turtle - addendum</title>
      <link>https://fsharpforfunandprofit.com/posts/13-ways-of-looking-at-a-turtle-3/</link>
      <pubDate>Mon, 07 Dec 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/13-ways-of-looking-at-a-turtle-3/</guid>
      <description>UPDATE: Slides and video from my talk on this topic
In this, the third part of my two-part mega-post, I&amp;rsquo;m continuing to stretch the simple turtle graphics model to the breaking point.
In the first and second post, I described thirteen different ways of looking at a turtle graphics implementation.
Unfortunately, after I published them, I realized that there were some other ways that I had forgotten to mention. So in this post, you&amp;rsquo;ll get to see two BONUS ways.</description>
    </item>
    
    <item>
      <title>Thirteen ways of looking at a turtle (part 2)</title>
      <link>https://fsharpforfunandprofit.com/posts/13-ways-of-looking-at-a-turtle-2/</link>
      <pubDate>Sun, 06 Dec 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/13-ways-of-looking-at-a-turtle-2/</guid>
      <description>UPDATE: Slides and video from my talk on this topic
 This post is part of the F# Advent Calendar in English 2015 project. Check out all the other great posts there! And special thanks to Sergey Tihon for organizing this.
 In this two-part mega-post, I&amp;rsquo;m stretching the simple turtle graphics model to the limit while demonstrating partial application, validation, the concept of &amp;ldquo;lifting&amp;rdquo;, agents with message queues, dependency injection, the State monad, event sourcing, stream processing, and an interpreter!</description>
    </item>
    
    <item>
      <title>Thirteen ways of looking at a turtle</title>
      <link>https://fsharpforfunandprofit.com/posts/13-ways-of-looking-at-a-turtle/</link>
      <pubDate>Sat, 05 Dec 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/13-ways-of-looking-at-a-turtle/</guid>
      <description>UPDATE: Slides and video from my talk on this topic
 This post is part of the F# Advent Calendar in English 2015 project. Check out all the other great posts there! And special thanks to Sergey Tihon for organizing this.
 I was discussing how to implement a simple turtle graphics system some time ago, and it struck me that, because the turtle requirements are so simple and so well known, it would make a great basis for demonstrating a range of different techniques.</description>
    </item>
    
    <item>
      <title>Writing a JSON parser from scratch</title>
      <link>https://fsharpforfunandprofit.com/posts/understanding-parser-combinators-4/</link>
      <pubDate>Fri, 13 Nov 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/understanding-parser-combinators-4/</guid>
      <description>UPDATE: Slides and video from my talk on this topic
In this series, we are looking at how applicative parsers and parser combinators work.
 In the first post, we created the foundations of a parsing library. In the second post, we built out the library with many other useful combinators. In the third post, we improved the error messages. In this last post, we&amp;rsquo;ll use the library we&amp;rsquo;ve written to build a JSON parser.</description>
    </item>
    
    <item>
      <title>Improving the parser library</title>
      <link>https://fsharpforfunandprofit.com/posts/understanding-parser-combinators-3/</link>
      <pubDate>Thu, 12 Nov 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/understanding-parser-combinators-3/</guid>
      <description>UPDATE: Slides and video from my talk on this topic
In this series, we are looking at how applicative parsers and parser combinators work.
 In the first post, we created the foundations of a parsing library. In the second post, we built out the library with many other useful combinators. In this post, we&amp;rsquo;ll rework the library to provide more helpful error messages.   1. Labelling a Parser     In some of the failing code examples from earlier posts, we got confusing errors:</description>
    </item>
    
    <item>
      <title>Building a useful set of parser combinators</title>
      <link>https://fsharpforfunandprofit.com/posts/understanding-parser-combinators-2/</link>
      <pubDate>Wed, 11 Nov 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/understanding-parser-combinators-2/</guid>
      <description>UPDATE: Slides and video from my talk on this topic
In this series, we are looking at how applicative parsers and parser combinators work.
 In the first post, we created the foundations of a parsing library. In this post, we&amp;rsquo;ll build out the library with many other useful combinators. The combinator names will be copied from those used by FParsec, so that you can easily migrate to it.   1.</description>
    </item>
    
    <item>
      <title>Understanding Parser Combinators</title>
      <link>https://fsharpforfunandprofit.com/posts/understanding-parser-combinators/</link>
      <pubDate>Tue, 10 Nov 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/understanding-parser-combinators/</guid>
      <description>UPDATE: Slides and video from my talk on this topic
In this series, we&amp;rsquo;ll look at how so-called &amp;ldquo;applicative parsers&amp;rdquo; work. In order to understand something, there&amp;rsquo;s nothing like building it for yourself, and so we&amp;rsquo;ll create a basic parser library from scratch, and then some useful &amp;ldquo;parser combinators&amp;rdquo;, and then finish off by building a complete JSON parser.
Now terms like &amp;ldquo;applicative parsers&amp;rdquo; and &amp;ldquo;parser combinators&amp;rdquo; can make this approach seem complicated, but rather than attempting to explain these concepts up front, we&amp;rsquo;ll just dive in and start coding.</description>
    </item>
    
    <item>
      <title>Trees in the real world</title>
      <link>https://fsharpforfunandprofit.com/posts/recursive-types-and-folds-3b/</link>
      <pubDate>Tue, 25 Aug 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/recursive-types-and-folds-3b/</guid>
      <description>This post is the sixth in a series.
In the previous post, we briefly looked at some generic types.
In this post, we&amp;rsquo;ll do some deeper dives into some real-world examples of using trees and folds.
Series contents     Here&amp;rsquo;s the contents of this series:
 Part 1: Introduction to recursive types and catamorphisms  A simple recursive type Parameterize all the things Introducing catamorphisms Benefits of catamorphisms Rules for creating a catamorphism   Part 2: Catamorphism examples  Catamorphism example: File system domain Catamorphism example: Product domain   Part 3: Introducing folds  A flaw in our catamorphism implementation Introducing fold Problems with fold Using functions as accumulators Introducing foldback Rules for creating a fold   Part 4: Understanding folds  Iteration vs.</description>
    </item>
    
    <item>
      <title>Generic recursive types</title>
      <link>https://fsharpforfunandprofit.com/posts/recursive-types-and-folds-3/</link>
      <pubDate>Mon, 24 Aug 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/recursive-types-and-folds-3/</guid>
      <description>This post is the fifth in a series.
In the previous post, we spent some time understanding folds for specific domain types.
In this post, we&amp;rsquo;ll broaden our horizons and look at how to use generic recursive types.
Series contents     Here&amp;rsquo;s the contents of this series:
 Part 1: Introduction to recursive types and catamorphisms  A simple recursive type Parameterize all the things Introducing catamorphisms Benefits of catamorphisms Rules for creating a catamorphism   Part 2: Catamorphism examples  Catamorphism example: File system domain Catamorphism example: Product domain   Part 3: Introducing folds  A flaw in our catamorphism implementation Introducing fold Problems with fold Using functions as accumulators Introducing foldback Rules for creating a fold   Part 4: Understanding folds  Iteration vs.</description>
    </item>
    
    <item>
      <title>Understanding Folds</title>
      <link>https://fsharpforfunandprofit.com/posts/recursive-types-and-folds-2b/</link>
      <pubDate>Sun, 23 Aug 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/recursive-types-and-folds-2b/</guid>
      <description>This post is the fourth in a series.
In the previous post, I introduced &amp;ldquo;folds&amp;rdquo;, a way of creating top-down iterative functions for recursive types.
In this post, we&amp;rsquo;ll spend some time understanding folds in more detail.
Series contents     Here&amp;rsquo;s the contents of this series:
 Part 1: Introduction to recursive types and catamorphisms  A simple recursive type Parameterize all the things Introducing catamorphisms Benefits of catamorphisms Rules for creating a catamorphism   Part 2: Catamorphism examples  Catamorphism example: File system domain Catamorphism example: Product domain   Part 3: Introducing folds  A flaw in our catamorphism implementation Introducing fold Problems with fold Using functions as accumulators Introducing foldback Rules for creating a fold   Part 4: Understanding folds  Iteration vs.</description>
    </item>
    
    <item>
      <title>Introducing Folds</title>
      <link>https://fsharpforfunandprofit.com/posts/recursive-types-and-folds-2/</link>
      <pubDate>Sat, 22 Aug 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/recursive-types-and-folds-2/</guid>
      <description>This post is the third in a series.
In the first post, I introduced &amp;ldquo;catamorphisms&amp;rdquo;, a way of creating functions for recursive types, and in the second post, we created a few catamorphism implementations.
But at the end of the previous post, I noted that all the catamorphism implementations so far have had a potentially serious flaw.
In this post, we&amp;rsquo;ll look at the flaw and how to work around it, and in the process look at folds, tail-recursion and the difference between &amp;ldquo;left fold&amp;rdquo; and &amp;ldquo;right fold&amp;rdquo;.</description>
    </item>
    
    <item>
      <title>Catamorphism examples</title>
      <link>https://fsharpforfunandprofit.com/posts/recursive-types-and-folds-1b/</link>
      <pubDate>Fri, 21 Aug 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/recursive-types-and-folds-1b/</guid>
      <description>This post is the second in a series.
In the previous post, I introduced &amp;ldquo;catamorphisms&amp;rdquo;, a way of creating functions for recursive types, and listed some rules which can be used to implement them mechanically. In this post, we&amp;rsquo;ll use these rules to implement catamorphisms for some other domains.
Series contents     Here&amp;rsquo;s the contents of this series:
 Part 1: Introduction to recursive types and catamorphisms  A simple recursive type Parameterize all the things Introducing catamorphisms Benefits of catamorphisms Rules for creating a catamorphism   Part 2: Catamorphism examples  Catamorphism example: File system domain Catamorphism example: Product domain   Part 3: Introducing folds  A flaw in our catamorphism implementation Introducing fold Problems with fold Using functions as accumulators Introducing foldback Rules for creating a fold   Part 4: Understanding folds  Iteration vs.</description>
    </item>
    
    <item>
      <title>Introduction to recursive types</title>
      <link>https://fsharpforfunandprofit.com/posts/recursive-types-and-folds/</link>
      <pubDate>Thu, 20 Aug 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/recursive-types-and-folds/</guid>
      <description>In this series, we&amp;rsquo;ll look at recursive types and how to use them, and on the way, we&amp;rsquo;ll look at catamorphisms, tail recursion, the difference between left and right folds, and more.
Series contents     Here&amp;rsquo;s the contents of this series:
 Part 1: Introduction to recursive types and catamorphisms  A simple recursive type Parameterize all the things Introducing catamorphisms Benefits of catamorphisms Rules for creating a catamorphism   Part 2: Catamorphism examples  Catamorphism example: File system domain Catamorphism example: Product domain   Part 3: Introducing folds  A flaw in our catamorphism implementation Introducing fold Problems with fold Using functions as accumulators Introducing foldback Rules for creating a fold   Part 4: Understanding folds  Iteration vs.</description>
    </item>
    
    <item>
      <title>Choosing between collection functions</title>
      <link>https://fsharpforfunandprofit.com/posts/list-module-functions/</link>
      <pubDate>Fri, 14 Aug 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/list-module-functions/</guid>
      <description>There&amp;rsquo;s more to learning a new language than the language itself. In order to be productive, you need to memorize a big chunk of the standard library and be aware of most of the rest of it. For example, if you know C#, you can pick up Java-the-language quite quickly, but you won&amp;rsquo;t really get up to speed until you are comfortable with the Java Class Library as well.
Similarly, you can&amp;rsquo;t really be effective in F# until you have some familiarity with all the F# functions that work with collections.</description>
    </item>
    
    <item>
      <title>Algebraic type sizes and domain modelling</title>
      <link>https://fsharpforfunandprofit.com/posts/type-size-and-design/</link>
      <pubDate>Thu, 13 Aug 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/type-size-and-design/</guid>
      <description>In this post, we&amp;rsquo;ll look at how to calculate the &amp;ldquo;size&amp;rdquo;, or cardinality, of an algebraic type, and see how this knowledge can help us with design decisions.
Getting started     I&amp;rsquo;m going to define the &amp;ldquo;size&amp;rdquo; of a type by thinking of it as a set, and counting the number of possible elements.
For example, there are two possible booleans, so the size of the Boolean type is two.</description>
    </item>
    
    <item>
      <title>Map and Bind and Apply, a summary</title>
      <link>https://fsharpforfunandprofit.com/posts/elevated-world-7/</link>
      <pubDate>Sat, 08 Aug 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/elevated-world-7/</guid>
      <description>Series summary     Well, this series turned out to be longer than I originally planned. Thanks for making it to the end!
I hope that this discussion has been helpful in understanding the various function transformations like map and bind, and given you some useful techniques for dealing with world-crossing functions &amp;ndash; maybe even demystified the m-word a bit!
If you want to start using these kinds of functions in your own code, I hope that you can see how easy they are to write, but you should also consider using one of the excellent F# utility libraries that contain these and much more:</description>
    </item>
    
    <item>
      <title>Reinventing the Reader monad</title>
      <link>https://fsharpforfunandprofit.com/posts/elevated-world-6/</link>
      <pubDate>Fri, 07 Aug 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/elevated-world-6/</guid>
      <description>This post is the sixth in a series. In the first two posts, I described some of the core functions for dealing with generic data types: map, bind, and so on. In the third post, I discussed &amp;ldquo;applicative&amp;rdquo; vs &amp;ldquo;monadic&amp;rdquo; style, and how to lift values and functions to be consistent with each other. In the fourth and previous posts, I introduced traverse and sequence as a way of working with lists of elevated values, and we saw this used in a practical example: downloading some URLs.</description>
    </item>
    
    <item>
      <title>Using map, apply, bind and sequence in practice</title>
      <link>https://fsharpforfunandprofit.com/posts/elevated-world-5/</link>
      <pubDate>Thu, 06 Aug 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/elevated-world-5/</guid>
      <description>This post is the fifth in a series. In the first two posts, I described some of the core functions for dealing with generic data types: map, bind, and so on. In the third post, I discussed &amp;ldquo;applicative&amp;rdquo; vs &amp;ldquo;monadic&amp;rdquo; style, and how to lift values and functions to be consistent with each other. In the previous post, I introduced traverse and sequence as a way of working with lists of elevated values.</description>
    </item>
    
    <item>
      <title>Understanding traverse and sequence</title>
      <link>https://fsharpforfunandprofit.com/posts/elevated-world-4/</link>
      <pubDate>Wed, 05 Aug 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/elevated-world-4/</guid>
      <description>This post is one in a series. In the first two posts, I described some of the core functions for dealing with generic data types: map, bind, and so on. In the previous post, I discussed &amp;ldquo;applicative&amp;rdquo; vs &amp;ldquo;monadic&amp;rdquo; style, and how to lift values and functions to be consistent with each other.
In this post, we&amp;rsquo;ll look at a common problem: working with lists of elevated values.
Series contents     Here&amp;rsquo;s a list of shortcuts to the various functions mentioned in this series:</description>
    </item>
    
    <item>
      <title>Using the core functions in practice</title>
      <link>https://fsharpforfunandprofit.com/posts/elevated-world-3/</link>
      <pubDate>Tue, 04 Aug 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/elevated-world-3/</guid>
      <description>This post is the third in a series. In the previous two posts, I described some of the core functions for dealing with generic data types: map, apply, bind, and so on.
In this post, I&amp;rsquo;ll show how to use these functions in practice, and will explain the difference between the so-called &amp;ldquo;applicative&amp;rdquo; and &amp;ldquo;monadic&amp;rdquo; styles.
Series contents     Here&amp;rsquo;s a list of shortcuts to the various functions mentioned in this series:</description>
    </item>
    
    <item>
      <title>Understanding bind</title>
      <link>https://fsharpforfunandprofit.com/posts/elevated-world-2/</link>
      <pubDate>Mon, 03 Aug 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/elevated-world-2/</guid>
      <description>This post is the second in a series. In the previous post, I described some of the core functions for lifting a value from a normal world to an elevated world.
In this post, we&amp;rsquo;ll look at &amp;ldquo;world-crossing&amp;rdquo; functions, and how they can be tamed with the bind function.
Series contents     Here&amp;rsquo;s a list of shortcuts to the various functions mentioned in this series:
 Part 1: Lifting to the elevated world  The map function The return function The apply function The liftN family of functions The zip function and ZipList world   Part 2: How to compose world-crossing functions  The bind function List is not a monad.</description>
    </item>
    
    <item>
      <title>Understanding map and apply</title>
      <link>https://fsharpforfunandprofit.com/posts/elevated-world/</link>
      <pubDate>Sun, 02 Aug 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/elevated-world/</guid>
      <description>In this series of posts, I&amp;rsquo;ll attempt to describe some of the core functions for dealing with generic data types (such as Option and List). This is a follow-up post to my talk on functional patterns.
Yes, I know that I promised not to do this kind of thing, but for this post I thought I&amp;rsquo;d take a different approach from most people. Rather than talking about abstractions such as type classes, I thought it might be useful to focus on the core functions themselves and how they are used in practice.</description>
    </item>
    
    <item>
      <title>Swapping type-safety for high performance using compiler directives</title>
      <link>https://fsharpforfunandprofit.com/posts/typesafe-performance-with-compiler-directives/</link>
      <pubDate>Tue, 21 Jul 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/typesafe-performance-with-compiler-directives/</guid>
      <description>TL;DR; An experiment: you can use lots of domain modelling types at development time and swap them out for a more performant implementation later using compiler directives.
Domain Modelling vs. Performance     I am a big fan of using types for domain modelling &amp;ndash; lots and lots and lots of types!
These types act both as documentation and as a compile time constraint to ensure that only valid data is used.</description>
    </item>
    
    <item>
      <title>Introvert and extrovert programming languages</title>
      <link>https://fsharpforfunandprofit.com/posts/introvert-vs-extrovert/</link>
      <pubDate>Sat, 18 Jul 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/introvert-vs-extrovert/</guid>
      <description>What&amp;rsquo;s the difference between an introvert and extrovert mathematician? An introvert mathematician looks at his shoes while talking to you; an extrovert mathematician looks at your shoes.
 For a long time, I&amp;rsquo;ve been aware of differences in how programming languages present themselves to the outside world.
If programming languages had personalities, I would be tempted to call some of them &amp;ldquo;introvert&amp;rdquo;, and some of them &amp;ldquo;extrovert&amp;rdquo;.
An extrovert programming language is all about the outside world, never happier than when partying with IO and external data sources.</description>
    </item>
    
    <item>
      <title>F# decompiled into C#</title>
      <link>https://fsharpforfunandprofit.com/posts/fsharp-decompiled/</link>
      <pubDate>Wed, 15 Jul 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/fsharp-decompiled/</guid>
      <description>The complete code for this post is available on GitHub
A favorite trick of F# proponents is to take some F# code, compile it, and then decompile the result to C# using a tool such as ILSpy. This shows you the C# code you would have to write to get the same functionality as the F# code.
Generally, the F# code is much shorter than the equivalent C# code &amp;ndash; due to things like one-line type definitions, lack of curly braces, and so on.</description>
    </item>
    
    <item>
      <title>Refactoring the Monadster</title>
      <link>https://fsharpforfunandprofit.com/posts/monadster-3/</link>
      <pubDate>Thu, 09 Jul 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/monadster-3/</guid>
      <description>UPDATE: Slides and video from my talk on this topic
Warning! This post contains gruesome topics, strained analogies, discussion of monads
Welcome to the third installment in the gripping tale of Dr Frankenfunctor and the Monadster!
We saw in the first installment how Dr Frankenfunctor created life out of dead body parts using &amp;ldquo;Monadster part generators&amp;rdquo; (or &amp;ldquo;M&amp;quot;s for short), that would, on being supplied with some vital force, return a live body part.</description>
    </item>
    
    <item>
      <title>Completing the body of the Monadster</title>
      <link>https://fsharpforfunandprofit.com/posts/monadster-2/</link>
      <pubDate>Wed, 08 Jul 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/monadster-2/</guid>
      <description>UPDATE: Slides and video from my talk on this topic
Warning! This post contains gruesome topics, strained analogies, discussion of monads
Welcome to the gripping tale of Dr Frankenfunctor and the Monadster!
We saw in the previous installment how Dr Frankenfunctor created life out of dead body parts using &amp;ldquo;Monadster part generators&amp;rdquo; (or &amp;ldquo;M&amp;quot;s for short), that would, on being supplied with some vital force, return a live body part.</description>
    </item>
    
    <item>
      <title>Dr Frankenfunctor and the Monadster</title>
      <link>https://fsharpforfunandprofit.com/posts/monadster/</link>
      <pubDate>Tue, 07 Jul 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/monadster/</guid>
      <description>UPDATE: Slides and video from my talk on this topic
Warning! This post contains gruesome topics, strained analogies, discussion of monads
For generations, we have been captivated by the tragic story of Dr Frankenfunctor. The fascination with vital forces, the early experiments with electricity and galvanism, and finally the breakthrough culminating in the bringing to life of a collection of dead body parts &amp;ndash; the Monadster.
But then, as we all know, the creature escaped and the free Monadster rampaged through computer science conferences, bringing fear to the hearts of even the most seasoned programmers.</description>
    </item>
    
    <item>
      <title>We don&#39;t need no stinking UML diagrams</title>
      <link>https://fsharpforfunandprofit.com/posts/no-uml-diagrams/</link>
      <pubDate>Tue, 30 Jun 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/no-uml-diagrams/</guid>
      <description>In my talk on functional DDD, I often use this slide (in context):
Which is of course is a misquote of this famous scene. Oops, I mean this one.
Ok, I might be exaggerating a bit. Some UML diagrams are useful (I like sequence diagrams for example) and in general, I do think a good picture or diagram can be worth 1000 words.
But I believe that, in many cases, using UML for class diagrams is not necessary.</description>
    </item>
    
    <item>
      <title>Happy F# Day!</title>
      <link>https://fsharpforfunandprofit.com/posts/happy-fsharp-day/</link>
      <pubDate>Sun, 12 Apr 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/happy-fsharp-day/</guid>
      <description>I&amp;rsquo;ve been thinking for a while that F# needs a &amp;ldquo;birthday&amp;rdquo; that we can celebrate as a community.
Of course, like any long term project, there is rarely a single date that you can point to as a birthday. Even the 4th of July and the Queen&amp;rsquo;s birthday are not as straightforward as they seem.
Nevertheless, it&amp;rsquo;s fun to celebrate a date, even if it&amp;rsquo;s not accurate!
So what date would best symbolize the &amp;ldquo;birth&amp;rdquo; of F#?</description>
    </item>
    
    <item>
      <title>Enterprise Tic-Tac-Toe, part 2</title>
      <link>https://fsharpforfunandprofit.com/posts/enterprise-tic-tac-toe-2/</link>
      <pubDate>Mon, 16 Feb 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/enterprise-tic-tac-toe-2/</guid>
      <description>UPDATE: Slides and video from my talk on this topic
This post is one of series in I which I hope to close the gap between theory and practice in functional programming. I pick a small project and show you my thought processes as I go about designing and implementing it from beginning to end.
In the previous post, I did a design for a Tic-Tac-Toe (aka Noughts and Crosses) game.</description>
    </item>
    
    <item>
      <title>Enterprise Tic-Tac-Toe</title>
      <link>https://fsharpforfunandprofit.com/posts/enterprise-tic-tac-toe/</link>
      <pubDate>Thu, 12 Feb 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/enterprise-tic-tac-toe/</guid>
      <description>UPDATE: Slides and video from my talk on this topic
This post is one of series in I which I hope to close the gap between theory and practice in functional programming. I pick a small project and show you my thought processes as I go about designing and implementing it from beginning to end.
For the next project in this series of posts, I&amp;rsquo;m going to do a walkthrough of a Tic-Tac-Toe (aka Noughts and Crosses) implementation, written in a functional style.</description>
    </item>
    
    <item>
      <title>Is your programming language unreasonable?</title>
      <link>https://fsharpforfunandprofit.com/posts/is-your-language-unreasonable/</link>
      <pubDate>Mon, 26 Jan 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/is-your-language-unreasonable/</guid>
      <description>As should be obvious, one of the goals of this site is to persuade people to take F# seriously as a general purpose development language.
But as functional idioms have become more mainstream, and C# has added functional capabilities such as lambdas and LINQ, it seems like C# is &amp;ldquo;catching up&amp;rdquo; with F# more and more.
So, ironically, I&amp;rsquo;ve now started to hear people say things like this:
 &amp;ldquo;C# already has most of the features of F#, so why should I bother to switch?</description>
    </item>
    
    <item>
      <title>Using types as access tokens</title>
      <link>https://fsharpforfunandprofit.com/posts/capability-based-security-3/</link>
      <pubDate>Tue, 20 Jan 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/capability-based-security-3/</guid>
      <description>UPDATE: Slides and video from my talk on this topic
In the previous posts (link, link) we looked at &amp;ldquo;capabilities&amp;rdquo; as the basis for locking down code.
But in most of the examples so far, we&amp;rsquo;ve been relying on self-discipline to avoid using the global capabilities, or by trying to hide the &amp;ldquo;raw&amp;rdquo; capabilities using the internal keyword.
It&amp;rsquo;s a bit ugly &amp;ndash; can we do better?
In this post, we&amp;rsquo;ll show that we can by using types to emulate &amp;ldquo;access tokens&amp;rdquo;.</description>
    </item>
    
    <item>
      <title>Constraining capabilities based on identity and role</title>
      <link>https://fsharpforfunandprofit.com/posts/capability-based-security-2/</link>
      <pubDate>Mon, 19 Jan 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/capability-based-security-2/</guid>
      <description>UPDATE: Slides and video from my talk on this topic
In the previous post, we started looking at &amp;ldquo;capabilities&amp;rdquo; as the basis for ensuring that code could not do any more than it was supposed to do. And I demonstrated this with a simple application that changed a configuration flag.
In this post, we&amp;rsquo;ll look at how to constrain capabilities based on the current user&amp;rsquo;s identity and role.
So let&amp;rsquo;s switch from the configuration example to a typical situation where stricter authorization is required.</description>
    </item>
    
    <item>
      <title>A functional approach to authorization</title>
      <link>https://fsharpforfunandprofit.com/posts/capability-based-security/</link>
      <pubDate>Sun, 18 Jan 2015 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/capability-based-security/</guid>
      <description>UPDATE: Slides and video from my talk on this topic
In this series of posts, I&amp;rsquo;ll look at how you might handle the common security challenge of authorization. That is, how can you ensure that clients of your code can only do what you want them to do?
This series will sketch out two different approaches, first using an approach called capability based security, and second using statically checked types to emulate access tokens.</description>
    </item>
    
    <item>
      <title>Choosing properties in practice, part 3</title>
      <link>https://fsharpforfunandprofit.com/posts/property-based-testing-5/</link>
      <pubDate>Mon, 15 Dec 2014 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/property-based-testing-5/</guid>
      <description>In the previous two posts, we looked at applying property-based testing to lists and roman numerals. Now let&amp;rsquo;s look at one more example problem, and see if we can find properties for it.
This sample is based on the well-known Dollar example described in Kent Beck&amp;rsquo;s &amp;ldquo;TDD By Example&amp;rdquo; book. We&amp;rsquo;re not going to attempt to critique the design itself and make it more type-driven &amp;ndash; others have done that. Instead, we&amp;rsquo;ll take the design as given and see what properties we can come up with.</description>
    </item>
    
    <item>
      <title>Choosing properties in practice, part 2</title>
      <link>https://fsharpforfunandprofit.com/posts/property-based-testing-4/</link>
      <pubDate>Sun, 14 Dec 2014 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/property-based-testing-4/</guid>
      <description>In the previous post, we tested some list functions using various properties. Let&amp;rsquo;s keep going and test some more code in the same way. For this post, our challenge will be to test roman numeral conversion logic.
 &amp;ldquo;Two heads are better than one&amp;rdquo; applied to two different implementations &amp;ldquo;There and back again&amp;rdquo; applied to encoding and decoding roman numerals &amp;ldquo;Solving a smaller problem&amp;rdquo; applied to decoding roman numerals &amp;ldquo;Some things never change&amp;rdquo;.</description>
    </item>
    
    <item>
      <title>Choosing properties in practice, part 1</title>
      <link>https://fsharpforfunandprofit.com/posts/property-based-testing-3/</link>
      <pubDate>Sat, 13 Dec 2014 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/property-based-testing-3/</guid>
      <description>In the previous post, we looked at some common patterns for finding properties. In this post, we&amp;rsquo;ll apply these approaches to see if we can come up with properties for some simple functions such as &amp;ldquo;sort a list&amp;rdquo; and &amp;ldquo;reverse a list&amp;rdquo;. As we work, we&amp;rsquo;ll always being thinking about the Enterprise Developer From Hell (see earlier post) and how the EDFH could trick our tests into passing.
 &amp;ldquo;Different paths, same destination&amp;rdquo; applied to sorting a list &amp;ldquo;Different paths, same destination&amp;rdquo; applied to reversing a list &amp;ldquo;There and back again&amp;rdquo; applied to reversing a list &amp;ldquo;Hard to prove, easy to verify&amp;rdquo; applied to splitting a string &amp;ldquo;Hard to prove, easy to verify&amp;rdquo; applied to sorting a list &amp;ldquo;Some things never change&amp;rdquo;.</description>
    </item>
    
    <item>
      <title>Choosing properties for property-based testing</title>
      <link>https://fsharpforfunandprofit.com/posts/property-based-testing-2/</link>
      <pubDate>Fri, 12 Dec 2014 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/property-based-testing-2/</guid>
      <description>UPDATE: I did a talk on property-based testing based on these posts. Slides and video here.
In the previous two posts, I described the basics of property-based testing, and showed how it can save a lot of time by generating random tests.
But here&amp;rsquo;s a common problem. Everyone who sees a property-based testing tool like FsCheck or QuickCheck thinks that it is amazing&amp;hellip; but when it comes time to start creating your own properties, the universal complaint is: &amp;ldquo;what properties should I use?</description>
    </item>
    
    <item>
      <title>Understanding FsCheck</title>
      <link>https://fsharpforfunandprofit.com/posts/property-based-testing-1/</link>
      <pubDate>Tue, 02 Dec 2014 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/property-based-testing-1/</guid>
      <description>UPDATE: I did a talk on property-based testing based on these posts. Slides and video here.
In the previous post, I described the basics of property-based testing, and showed how it could save a lot of time by generating random tests.
But how does it actually work in detail? That&amp;rsquo;s the topic of this post.
Understanding FsCheck: Generators     The first thing that FsCheck does is generate random inputs for you.</description>
    </item>
    
    <item>
      <title>The Enterprise Developer from Hell</title>
      <link>https://fsharpforfunandprofit.com/posts/property-based-testing/</link>
      <pubDate>Mon, 01 Dec 2014 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/property-based-testing/</guid>
      <description>This post is part of the F# Advent Calendar in English 2014 project. Check out all the other great posts there! And special thanks to Sergey Tihon for organizing this.
 UPDATE: I did a talk on property-based testing based on these posts. Slides and video here.
Also, there is now a post on how to choose properties for property-based testing
Let&amp;rsquo;s start with a discussion that I might have had once (topic changed to protect the guilty):</description>
    </item>
    
    <item>
      <title>Calculator Walkthrough: Part 4</title>
      <link>https://fsharpforfunandprofit.com/posts/calculator-complete-v2/</link>
      <pubDate>Thu, 16 Oct 2014 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/calculator-complete-v2/</guid>
      <description>In this series of posts, I&amp;rsquo;ve been developing a simple pocket calculator app.
In the first post, we completed a first draft of the design, using type-first development. and in the second post, we created an initial implementation.
In the previous post, we created the rest of the code, including the user interface, and attempted to use it.
But the final result was unusable! The problem wasn&amp;rsquo;t that the code was buggy, it was that I didn&amp;rsquo;t spend enough time thinking about the requirements before I started coding!</description>
    </item>
    
    <item>
      <title>Calculator Walkthrough: Part 3</title>
      <link>https://fsharpforfunandprofit.com/posts/calculator-complete-v1/</link>
      <pubDate>Wed, 15 Oct 2014 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/calculator-complete-v1/</guid>
      <description>In this post, I&amp;rsquo;ll continue developing a simple pocket calculator app.
In the first post, we completed a first draft of the design, using only types (no UML diagrams!). and in the previous post, we created an initial implementation that exercised the design and revealed a missing requirement.
Now it&amp;rsquo;s time to build the remaining components and assemble them into a complete application
Creating the services     We have a implementation.</description>
    </item>
    
    <item>
      <title>Calculator Walkthrough: Part 2</title>
      <link>https://fsharpforfunandprofit.com/posts/calculator-implementation/</link>
      <pubDate>Tue, 14 Oct 2014 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/calculator-implementation/</guid>
      <description>In this post, I&amp;rsquo;ll continue developing a simple pocket calculator app, like this:
In the previous post, we completed a first draft of the design, using only types (no UML diagrams!).
Now it&amp;rsquo;s time to create a trial implementation that uses the design.
Doing some real coding at this point acts as a reality check. It ensures that the domain model actually makes sense and is not too abstract. And of course, it often drives more questions about the requirements and domain model.</description>
    </item>
    
    <item>
      <title>Calculator Walkthrough: Part 1</title>
      <link>https://fsharpforfunandprofit.com/posts/calculator-design/</link>
      <pubDate>Mon, 13 Oct 2014 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/calculator-design/</guid>
      <description>One comment I hear often is a complaint about the gap between theory and practice in F# and functional programming in general. In other words, you know the theory, but how do you actually design and implement an application using FP principles?
So I thought it might be useful to show you how I personally would go about designing and implementing some little applications from beginning to end.
These will be sort of annotated &amp;ldquo;live coding&amp;rdquo; sessions.</description>
    </item>
    
    <item>
      <title>Other interesting ways of using F# at work</title>
      <link>https://fsharpforfunandprofit.com/posts/low-risk-ways-to-use-fsharp-at-work-5/</link>
      <pubDate>Thu, 24 Apr 2014 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/low-risk-ways-to-use-fsharp-at-work-5/</guid>
      <description>This post is the conclusion of the series on low-risk and incremental ways to use F# at work.
To wrap up, we&amp;rsquo;ll look at a few more ways in which F# can help you with various development tasks around the edges, without impacting any core or mission critical code.
Series contents     Before moving on to the content of the post, here&amp;rsquo;s the full list of the twenty six ways:</description>
    </item>
    
    <item>
      <title>Using F# for database related tasks</title>
      <link>https://fsharpforfunandprofit.com/posts/low-risk-ways-to-use-fsharp-at-work-4/</link>
      <pubDate>Wed, 23 Apr 2014 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/low-risk-ways-to-use-fsharp-at-work-4/</guid>
      <description>This post is a continuation of the previous series on low-risk and incremental ways to use F# at work.
In this one, we&amp;rsquo;ll see how F# can be unexpectedly helpful when it comes to database related tasks.
Series contents     Before moving on to the content of the post, here&amp;rsquo;s the full list of the twenty six ways:
Part 1 - Using F# to explore and develop interactively</description>
    </item>
    
    <item>
      <title>Using F# for testing</title>
      <link>https://fsharpforfunandprofit.com/posts/low-risk-ways-to-use-fsharp-at-work-3/</link>
      <pubDate>Tue, 22 Apr 2014 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/low-risk-ways-to-use-fsharp-at-work-3/</guid>
      <description>This post is a continuation of the previous series on low-risk and incremental ways to use F# at work &amp;ndash; how can you get your hands dirty with F# in a low-risk, incremental way, without affecting any mission critical code?
In this one, we&amp;rsquo;ll talk about using F# for testing.
Series contents     Before moving on to the content of the post, here&amp;rsquo;s the full list of the twenty six ways:</description>
    </item>
    
    <item>
      <title>Using F# for development and devops scripts</title>
      <link>https://fsharpforfunandprofit.com/posts/low-risk-ways-to-use-fsharp-at-work-2/</link>
      <pubDate>Mon, 21 Apr 2014 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/low-risk-ways-to-use-fsharp-at-work-2/</guid>
      <description>This post is a continuation of the series on low-risk ways to use F# at work. I&amp;rsquo;ve been suggesting a number of ways you can get your hands dirty with F# in a low-risk, incremental way, without affecting any mission critical code.
In this one, we&amp;rsquo;ll talk about using F# for builds and other development and devops scripts.
If you&amp;rsquo;re new to F#, you might want to read the sections on getting started and working with NuGet in the previous post.</description>
    </item>
    
    <item>
      <title>Twenty six low-risk ways to use F# at work</title>
      <link>https://fsharpforfunandprofit.com/posts/low-risk-ways-to-use-fsharp-at-work/</link>
      <pubDate>Sun, 20 Apr 2014 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/low-risk-ways-to-use-fsharp-at-work/</guid>
      <description>So you&amp;rsquo;re all excited about functional programming, and you&amp;rsquo;ve been learning F# in your spare time, and you&amp;rsquo;re annoying your co-workers by ranting about how great it is, and you&amp;rsquo;re itching to use it for serious stuff at work&amp;hellip;
But then you hit a brick wall.
Your workplace has a &amp;ldquo;C# only&amp;rdquo; policy and won&amp;rsquo;t let you use F#.
If you work in a typical enterprise environment, getting a new language approved will be a long drawn out process, involving persuading your teammates, the QA guys, the ops guys, your boss, your boss&amp;rsquo;s boss, and the mysterious bloke down the hall who you&amp;rsquo;ve never talked to.</description>
    </item>
    
    <item>
      <title>Analysis of Roslyn vs. the F# compiler</title>
      <link>https://fsharpforfunandprofit.com/posts/roslyn-vs-fsharp-compiler/</link>
      <pubDate>Sat, 12 Apr 2014 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/roslyn-vs-fsharp-compiler/</guid>
      <description>After a long wait, the Roslyn project (C# compiler and analysis tools) has finally been released to much excitement (HN and Reddit and introductory post here).
Immediately, I got a request to do a follow up to my previous analysis of C# and F# code &amp;ldquo;in the wild&amp;rdquo; and apply a similar analysis to Roslyn, comparing it with the (already open source) F# compiler.
You might ask, is it really fair to compare such different projects?</description>
    </item>
    
    <item>
      <title>Commentary on &#39;Roman Numerals Kata with Commentary&#39;</title>
      <link>https://fsharpforfunandprofit.com/posts/roman-numeral-kata/</link>
      <pubDate>Sun, 12 Jan 2014 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/roman-numeral-kata/</guid>
      <description>I recently watched a video called &amp;ldquo;Roman Numerals Kata with Commentary&amp;rdquo;. In it, Corey Haines demonstrates how to implement the Arabic to Roman Numerals Kata in Ruby using a TDD approach.
This video annoyed me intensely.
I mean no disrespect to Corey Haines&#39; programming skills, and many people seem to have found the video useful, but I just found it exasperating.
I thought that in this post I&amp;rsquo;d try to explain why I got annoyed, and to present my alternative approach to problems like this.</description>
    </item>
    
    <item>
      <title>Working with non-monoids</title>
      <link>https://fsharpforfunandprofit.com/posts/monoids-part3/</link>
      <pubDate>Fri, 25 Oct 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/monoids-part3/</guid>
      <description>In the previous posts in this series, we only dealt with things that were proper monoids.
But what if the thing you want to work with is not a monoid? What then? Well, in this post, I&amp;rsquo;ll give you some tips on converting almost anything into a monoid.
In the process, we&amp;rsquo;ll be introduced to a number of important and common functional design idioms, such as preferring lists rather than singletons, and using the option type at every opportunity.</description>
    </item>
    
    <item>
      <title>Monoids in practice</title>
      <link>https://fsharpforfunandprofit.com/posts/monoids-part2/</link>
      <pubDate>Thu, 24 Oct 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/monoids-part2/</guid>
      <description>In the previous post, we looked at the definition of a monoid. In this post, we&amp;rsquo;ll see how to implement some monoids.
First, let&amp;rsquo;s revisit the definition:
 You start with a bunch of things, and some way of combining them two at a time. Rule 1 (Closure): The result of combining two things is always another one of the things. Rule 2 (Associativity): When combining more than two things, which pairwise combination you do first doesn&amp;rsquo;t matter.</description>
    </item>
    
    <item>
      <title>Monoids without tears</title>
      <link>https://fsharpforfunandprofit.com/posts/monoids-without-tears/</link>
      <pubDate>Wed, 23 Oct 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/monoids-without-tears/</guid>
      <description>If you are coming from an OO background, one of the more challenging aspects of learning functional programming is the lack of obvious design patterns. There are plenty of idioms such as partial application, and error handling techniques, but no apparent patterns in the GoF sense.
In this post, we&amp;rsquo;ll look at a very common &amp;ldquo;pattern&amp;rdquo; known as a monoid. Monoids are not really a design pattern; more an approach to working with many different types of values in a common way.</description>
    </item>
    
    <item>
      <title>Railway oriented programming: Carbonated edition</title>
      <link>https://fsharpforfunandprofit.com/posts/railway-oriented-programming-carbonated/</link>
      <pubDate>Sat, 22 Jun 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/railway-oriented-programming-carbonated/</guid>
      <description>As a follow up to the Railway Oriented Programming post, I thought I&amp;rsquo;d apply the same technique to the FizzBuzz problem, and compare it with other implementations.
A large part of this post was directly stolen from inspired by Dave Fayram&amp;rsquo;s post on FizzBuzz, with some additional ideas from raganwald.
FizzBuzz: The imperative version     As a reminder, here are the requirements for the FizzBuzz problem:
Write a program that prints the numbers from 1 to 100.</description>
    </item>
    
    <item>
      <title>Cycles and modularity in the wild</title>
      <link>https://fsharpforfunandprofit.com/posts/cycles-and-modularity-in-the-wild/</link>
      <pubDate>Tue, 28 May 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/cycles-and-modularity-in-the-wild/</guid>
      <description>(Updated 2013-06-15. See comments at the end of the post)
(Updated 2014-04-12. A follow up post that applies the same analysis to Roslyn)
(Updated 2015-01-23. A much clearer version of this analysis has been done by Evelina Gabasova. She knows what she is talking about, so I highly recommend you read her post first!)
This is a follow up post to two earlier posts on module organization and cyclic dependencies.</description>
    </item>
    
    <item>
      <title>Cyclic dependencies are evil</title>
      <link>https://fsharpforfunandprofit.com/posts/cyclic-dependencies/</link>
      <pubDate>Mon, 27 May 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/cyclic-dependencies/</guid>
      <description>One of three related posts on module organization and cyclic dependencies.
One of the most common complaints about F# is that it requires code to be in dependency order. That is, you cannot use forward references to code that hasn&amp;rsquo;t been seen by the compiler yet.
Here&amp;rsquo;s a typical example:
 &amp;ldquo;The order of .fs files makes it hard to compile&amp;hellip; My F# application is just over 50 lines of code, but it&amp;rsquo;s already more work than it&amp;rsquo;s worth to compile even the tiniest non-trivial application.</description>
    </item>
    
    <item>
      <title>Refactoring to remove cyclic dependencies</title>
      <link>https://fsharpforfunandprofit.com/posts/removing-cyclic-dependencies/</link>
      <pubDate>Mon, 27 May 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/removing-cyclic-dependencies/</guid>
      <description>In the previous post, we looked at the concept of dependency cycles, and why they are bad.
In this post, we&amp;rsquo;ll look at some techniques for eliminating them from your code. Having to do this may seem annoying at first, but really, you&amp;rsquo;ll come to appreciate that in the long run, &amp;ldquo;it&amp;rsquo;s not a bug, it&amp;rsquo;s a feature!&amp;rdquo;
Classifying some common cyclic dependencies     Let&amp;rsquo;s classify the kinds of dependencies you&amp;rsquo;re likely to run into.</description>
    </item>
    
    <item>
      <title>Organizing modules in a project</title>
      <link>https://fsharpforfunandprofit.com/posts/recipe-part3/</link>
      <pubDate>Sun, 26 May 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/recipe-part3/</guid>
      <description>Before we move on to any coding in the recipe, let&amp;rsquo;s look at the overall structure of a F# project. In particular: (a) what code should be in which modules and (b) how the modules should be organized within a project.
How not to do it     A newcomer to F# might be tempted to organize code in classes just like in C#. One class per file, in alphabetical order.</description>
    </item>
    
    <item>
      <title>Why I won&#39;t be writing a monad tutorial</title>
      <link>https://fsharpforfunandprofit.com/posts/why-i-wont-be-writing-a-monad-tutorial/</link>
      <pubDate>Tue, 14 May 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/why-i-wont-be-writing-a-monad-tutorial/</guid>
      <description>&amp;ldquo;A &amp;lsquo;newbie&amp;rsquo;, in Haskell, is someone who hasn&amp;rsquo;t yet implemented a compiler. They&amp;rsquo;ve only written a monad tutorial&amp;rdquo; - Pseudonymn
Let&amp;rsquo;s start with a story&amp;hellip;
Alice learns to count     Young Alice and her father (who happens to be a mathematician) are visiting a petting zoo&amp;hellip;
Alice: Look at those kitties.
Daddy: Aren&amp;rsquo;t they cute. There are two of them.
Alice: Look at those doggies.
Daddy: That&amp;rsquo;s right.</description>
    </item>
    
    <item>
      <title>Railway oriented programming</title>
      <link>https://fsharpforfunandprofit.com/posts/recipe-part2/</link>
      <pubDate>Sat, 11 May 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/recipe-part2/</guid>
      <description>UPDATE: Slides and video from a more comprehensive presentation available here (and if you understand the Either monad, read this first!).
UPDATE 2: This is one of my most popular posts, and it is a useful approach to error handling, but please don&amp;rsquo;t overuse the idea! See my post on &amp;ldquo;Against Railway-Oriented Programming&amp;rdquo;.
In the previous post, we saw how a use case could be broken into steps, and all the errors shunted off onto a separate error track, like this:</description>
    </item>
    
    <item>
      <title>How to design and code a complete program</title>
      <link>https://fsharpforfunandprofit.com/posts/recipe-part1/</link>
      <pubDate>Fri, 10 May 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/recipe-part1/</guid>
      <description>&amp;ldquo;I think I understand functional programming at the micro level, and I have written toy programs, but how do I actually go about writing a complete application, with real data, real error handling, and so on?&amp;quot;
This is a very common question, so I thought that in this series of posts I&amp;rsquo;d describe a recipe for doing exactly this, covering design, validation, error handling, persistence, dependency management, code organization, and so on.</description>
    </item>
    
    <item>
      <title>Ten reasons not to use a statically typed functional programming language</title>
      <link>https://fsharpforfunandprofit.com/posts/ten-reasons-not-to-use-a-functional-programming-language/</link>
      <pubDate>Fri, 12 Apr 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/ten-reasons-not-to-use-a-functional-programming-language/</guid>
      <description>Are you fed up with all the hype about functional programming? Me too! I thought I&amp;rsquo;d rant about some reasons why sensible people like us should stay away from it.
Just to be clear, when I say &amp;ldquo;statically typed functional programming language&amp;rdquo;, I mean languages that also include things such as type inference, immutability by default, and so on. In practice, this means Haskell and the ML-family (including OCaml and F#).</description>
    </item>
    
    <item>
      <title>Implementing a CE: The rest of the standard methods</title>
      <link>https://fsharpforfunandprofit.com/posts/computation-expressions-builder-part6/</link>
      <pubDate>Wed, 30 Jan 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/computation-expressions-builder-part6/</guid>
      <description>We&amp;rsquo;re coming into the home stretch now. There are only a few more builder methods that need to be covered, and then you will be ready to tackle anything!
These methods are:
 While for repetition. TryWith and TryFinally for handling exceptions. Use for managing disposables  Remember, as always, that not all methods need to be implemented. If While is not relevant to you, don&amp;rsquo;t bother with it.
One important note before we get started: all the methods discussed here rely on delays being used.</description>
    </item>
    
    <item>
      <title>Implementing a CE: Adding laziness</title>
      <link>https://fsharpforfunandprofit.com/posts/computation-expressions-builder-part5/</link>
      <pubDate>Tue, 29 Jan 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/computation-expressions-builder-part5/</guid>
      <description>In a previous post, we saw how to avoid unnecessary evaluation of expressions in a workflow until needed.
But that approach was designed for expressions inside a workflow. What happens if we want to delay the whole workflow itself until needed.
Note that the &amp;ldquo;builder&amp;rdquo; in the context of a computation expression is not the same as the OO &amp;ldquo;builder pattern&amp;rdquo; for constructing and validating objects. There is a post on the &amp;ldquo;builder pattern&amp;rdquo; here.</description>
    </item>
    
    <item>
      <title>Implementing a CE: Overloading</title>
      <link>https://fsharpforfunandprofit.com/posts/computation-expressions-builder-part4/</link>
      <pubDate>Mon, 28 Jan 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/computation-expressions-builder-part4/</guid>
      <description>In this post, we&amp;rsquo;ll take a detour and look at some tricks you can do with methods in a computation expression builder.
Ultimately, this detour will lead to a dead end, but I hope the journey might provide some more insight into good practices for designing your own computation expressions.
Note that the &amp;ldquo;builder&amp;rdquo; in the context of a computation expression is not the same as the OO &amp;ldquo;builder pattern&amp;rdquo; for constructing and validating objects.</description>
    </item>
    
    <item>
      <title>Implementing a CE: Delay and Run</title>
      <link>https://fsharpforfunandprofit.com/posts/computation-expressions-builder-part3/</link>
      <pubDate>Sun, 27 Jan 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/computation-expressions-builder-part3/</guid>
      <description>In the last few posts we have covered all the basic methods (Bind, Return, Zero, and Combine) needed to create your own computation expression builder. In this post, we&amp;rsquo;ll look at some of the extra features needed to make the workflow more efficient, by controlling when expressions get evaluated.
Note that the &amp;ldquo;builder&amp;rdquo; in the context of a computation expression is not the same as the OO &amp;ldquo;builder pattern&amp;rdquo; for constructing and validating objects.</description>
    </item>
    
    <item>
      <title>Implementing a CE: Combine</title>
      <link>https://fsharpforfunandprofit.com/posts/computation-expressions-builder-part2/</link>
      <pubDate>Sat, 26 Jan 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/computation-expressions-builder-part2/</guid>
      <description>In this post we&amp;rsquo;re going to look at returning multiple values from a computation expression using the Combine method.
Note that the &amp;ldquo;builder&amp;rdquo; in the context of a computation expression is not the same as the OO &amp;ldquo;builder pattern&amp;rdquo; for constructing and validating objects. There is a post on the &amp;ldquo;builder pattern&amp;rdquo; here.The story so far&amp;hellip;     So far, our expression builder class looks like this:</description>
    </item>
    
    <item>
      <title>Implementing a CE: Zero and Yield</title>
      <link>https://fsharpforfunandprofit.com/posts/computation-expressions-builder-part1/</link>
      <pubDate>Fri, 25 Jan 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/computation-expressions-builder-part1/</guid>
      <description>Having covered bind and continuations, and the use of wrapper types, we&amp;rsquo;re finally ready to take on the full set of methods associated with &amp;ldquo;builder&amp;rdquo; classes.
Note that the &amp;ldquo;builder&amp;rdquo; in the context of a computation expression is not the same as the OO &amp;ldquo;builder pattern&amp;rdquo; for constructing and validating objects. There is a post on the &amp;ldquo;builder pattern&amp;rdquo; here.If you look at the MSDN documentation, you&amp;rsquo;ll see not just Bind and Return, but also other strangely named methods like Delay and Zero.</description>
    </item>
    
    <item>
      <title>More on wrapper types</title>
      <link>https://fsharpforfunandprofit.com/posts/computation-expressions-wrapper-types-part2/</link>
      <pubDate>Thu, 24 Jan 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/computation-expressions-wrapper-types-part2/</guid>
      <description>In the previous post, we looked at the concept of &amp;ldquo;wrapper types&amp;rdquo; and their relation to computation expressions. In this post, we&amp;rsquo;ll investigate what types are suitable for being wrapper types.
What kinds of types can be wrapper types?     If every computation expression must have an associated wrapper type, then what kinds of type can be used as wrapper types? Are there any special constraints or limitations that apply?</description>
    </item>
    
    <item>
      <title>Computation expressions and wrapper types</title>
      <link>https://fsharpforfunandprofit.com/posts/computation-expressions-wrapper-types/</link>
      <pubDate>Wed, 23 Jan 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/computation-expressions-wrapper-types/</guid>
      <description>In the previous post, we were introduced to the &amp;ldquo;maybe&amp;rdquo; workflow, which allowed us to hide the messiness of chaining together option types.
A typical use of the &amp;ldquo;maybe&amp;rdquo; workflow looked something like this:
let result = maybe { let! anInt = expression of Option&amp;lt;int&amp;gt; let! anInt2 = expression of Option&amp;lt;int&amp;gt; return anInt + anInt2 } As we saw before, there is some apparently strange behavior going on here:
  In the let!</description>
    </item>
    
    <item>
      <title>Introducing &#39;bind&#39;</title>
      <link>https://fsharpforfunandprofit.com/posts/computation-expressions-bind/</link>
      <pubDate>Tue, 22 Jan 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/computation-expressions-bind/</guid>
      <description>In the last post we talked about how we can think of let as a nice syntax for doing continuations behind scenes. And we introduced a pipeInto function that allowed us to add hooks into the continuation pipeline.
Now we are ready to look at our first builder method, Bind, which formalizes this approach and is the core of any computation expression.
Note that the &amp;ldquo;builder&amp;rdquo; in the context of a computation expression is not the same as the OO &amp;ldquo;builder pattern&amp;rdquo; for constructing and validating objects.</description>
    </item>
    
    <item>
      <title>Understanding continuations</title>
      <link>https://fsharpforfunandprofit.com/posts/computation-expressions-continuations/</link>
      <pubDate>Mon, 21 Jan 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/computation-expressions-continuations/</guid>
      <description>In the previous post we saw how some complex code could be condensed using computation expressions.
Here&amp;rsquo;s the code before using a computation expression:
let log p = printfn &amp;#34;expression is %A&amp;#34; p let loggedWorkflow = let x = 42 log x let y = 43 log y let z = x + y log z //return  z And here&amp;rsquo;s the same code after using a computation expression:
let loggedWorkflow = logger { let!</description>
    </item>
    
    <item>
      <title>Computation expressions: Introduction</title>
      <link>https://fsharpforfunandprofit.com/posts/computation-expressions-intro/</link>
      <pubDate>Sun, 20 Jan 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/computation-expressions-intro/</guid>
      <description>By popular request, it is time to talk about the mysteries of computation expressions, what they are, and how they can be useful in practice (and I will try to avoid using the forbidden m-word).
In this series, you&amp;rsquo;ll learn what computation expressions are, how to make your own, and some common patterns involving them. In the process, we&amp;rsquo;ll also look at continuations, the bind function, wrapper types, and more.</description>
    </item>
    
    <item>
      <title>Designing with types: Conclusion</title>
      <link>https://fsharpforfunandprofit.com/posts/designing-with-types-conclusion/</link>
      <pubDate>Sat, 19 Jan 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/designing-with-types-conclusion/</guid>
      <description>In this series, we&amp;rsquo;ve looked at some of the ways we can use types as part of the design process, including:
 Breaking large structures down into small &amp;ldquo;atomic&amp;rdquo; components. Using single case unions to add semantic meaning and validation to key domain types such EmailAddress and ZipCode. Ensuring that the type system can only represent valid data (&amp;ldquo;making illegal states unrepresentable&amp;rdquo;). Using types as an analysis tool to uncover hidden requirements Replacing flags and enums with simple state machines Replacing primitive strings with types that guarantee various constraints  For this final post, let&amp;rsquo;s see them all applied together.</description>
    </item>
    
    <item>
      <title>Designing with types: Non-string types</title>
      <link>https://fsharpforfunandprofit.com/posts/designing-with-types-non-strings/</link>
      <pubDate>Fri, 18 Jan 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/designing-with-types-non-strings/</guid>
      <description>In this series we&amp;rsquo;ve seen a lot of uses of single case discriminated unions to wrap strings.
There is no reason why you cannot use this technique with other primitive types, such as numbers and dates. Let&amp;rsquo;s look a few examples.
Single case unions     In many cases, we want to avoid accidentally mixing up different kinds of integers. Two domain objects may have the same representation (using integers) but they should never be confused.</description>
    </item>
    
    <item>
      <title>Designing with types: Constrained strings</title>
      <link>https://fsharpforfunandprofit.com/posts/designing-with-types-more-semantic-types/</link>
      <pubDate>Thu, 17 Jan 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/designing-with-types-more-semantic-types/</guid>
      <description>In a previous post, I talked about avoiding using plain primitive strings for email addresses, zip codes, states, etc. By wrapping them in a single case union, we could (a) force the types to be distinct and (b) add validation rules.
In this post, we&amp;rsquo;ll look at whether we can extend that concept to an even more fine grained level.
When is a string not a string?     Let&amp;rsquo;s look a simple PersonalName type.</description>
    </item>
    
    <item>
      <title>Designing with types: Making state explicit</title>
      <link>https://fsharpforfunandprofit.com/posts/designing-with-types-representing-states/</link>
      <pubDate>Wed, 16 Jan 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/designing-with-types-representing-states/</guid>
      <description>In this post we will look at making implicit states explicit by using state machines, and then modelling these state machines with union types.
Background     In an earlier post in this series, we looked at single case unions as a wrapper for types such as email addresses.
module EmailAddress = type T = EmailAddress of string let create (s:string) = if System.Text.RegularExpressions.Regex.IsMatch(s,@&amp;#34;^\S+@\S+\.\S+$&amp;#34;) then Some (EmailAddress s) else None This code assumes that either an address is valid or it is not.</description>
    </item>
    
    <item>
      <title>Designing with types: Discovering new concepts</title>
      <link>https://fsharpforfunandprofit.com/posts/designing-with-types-discovering-the-domain/</link>
      <pubDate>Tue, 15 Jan 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/designing-with-types-discovering-the-domain/</guid>
      <description>In the last post, we looked at how we could represent a business rule using types.
The rule was: &amp;ldquo;A contact must have an email or a postal address&amp;rdquo;.
And the type we designed was:
type ContactInfo = | EmailOnly of EmailContactInfo | PostOnly of PostalContactInfo | EmailAndPost of EmailContactInfo * PostalContactInfo Now let&amp;rsquo;s say that the business decides that phone numbers need to be supported as well. The new business rule is: &amp;ldquo;A contact must have at least one of the following: an email, a postal address, a home phone, or a work phone&amp;rdquo;.</description>
    </item>
    
    <item>
      <title>Designing with types: Making illegal states unrepresentable</title>
      <link>https://fsharpforfunandprofit.com/posts/designing-with-types-making-illegal-states-unrepresentable/</link>
      <pubDate>Mon, 14 Jan 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/designing-with-types-making-illegal-states-unrepresentable/</guid>
      <description>In this post, we look at a key benefit of F#, which using the type system to &amp;ldquo;make illegal states unrepresentable&amp;rdquo; (a phrase borrowed from Yaron Minsky).
Let&amp;rsquo;s look at our Contact type. Thanks to the previous refactoring, it is quite simple:
type Contact = { Name: Name; EmailContactInfo: EmailContactInfo; PostalContactInfo: PostalContactInfo; } Now let&amp;rsquo;s say that we have the following simple business rule: &amp;ldquo;A contact must have an email or a postal address&amp;rdquo;.</description>
    </item>
    
    <item>
      <title>Designing with types: Single case union types</title>
      <link>https://fsharpforfunandprofit.com/posts/designing-with-types-single-case-dus/</link>
      <pubDate>Sun, 13 Jan 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/designing-with-types-single-case-dus/</guid>
      <description>At the end of the previous post, we had values for email addresses, zip codes, etc., defined like this:
EmailAddress: string; State: string; Zip: string; These are all defined as simple strings. But really, are they just strings? Is an email address interchangeable with a zip code or a state abbreviation?
In a domain driven design, they are indeed distinct things, not just strings. So we would ideally like to have lots of separate types for them so that they cannot accidentally be mixed up.</description>
    </item>
    
    <item>
      <title>Designing with types: Introduction</title>
      <link>https://fsharpforfunandprofit.com/posts/designing-with-types-intro/</link>
      <pubDate>Sat, 12 Jan 2013 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/designing-with-types-intro/</guid>
      <description>In this series, we&amp;rsquo;ll look at some of the ways we can use types as part of the design process. In particular, the thoughtful use of types can make a design more transparent and improve correctness at the same time.
This series will be focused on the &amp;ldquo;micro level&amp;rdquo; of design. That is, working at the lowest level of individual types and functions. Higher level design approaches, and the associated decisions about using functional or object-oriented style, will be discussed in another series.</description>
    </item>
    
    <item>
      <title>Getting started with direct porting</title>
      <link>https://fsharpforfunandprofit.com/posts/porting-to-csharp-getting-started/</link>
      <pubDate>Thu, 02 Aug 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/porting-to-csharp-getting-started/</guid>
      <description>Before we get started on the detailed examples, we&amp;rsquo;ll go back to basics and do some simple porting of trivial examples.
In this post and the next, we&amp;rsquo;ll look at the nearest F# equivalents to common C# statements and keywords, to guide you when doing direct ports.
Basic syntax conversion guidelines     Before starting a port, you need to understand how F# syntax is different from C# syntax.</description>
    </item>
    
    <item>
      <title>Porting from C# to F#: Introduction</title>
      <link>https://fsharpforfunandprofit.com/posts/porting-to-csharp-intro/</link>
      <pubDate>Wed, 01 Aug 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/porting-to-csharp-intro/</guid>
      <description>NOTE: Before reading this series, I suggest that you read the following series as a prerequisite: &amp;ldquo;thinking functionally&amp;rdquo;, &amp;ldquo;expressions and syntax&amp;rdquo;, and &amp;ldquo;understanding F# types&amp;rdquo;.
For many developers, the next step after learning a new language might be to port some existing code over to it, so that they can get a good feel for the differences between the two languages.
As we pointed out earlier, functional languages are very different from imperative languages, and so trying to do a direct port of imperative code to a functional language is often not possible, and even if a crude port is done successfully, the ported code will probably not be using the functional model to its best advantage.</description>
    </item>
    
    <item>
      <title>Object expressions</title>
      <link>https://fsharpforfunandprofit.com/posts/object-expressions/</link>
      <pubDate>Tue, 17 Jul 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/object-expressions/</guid>
      <description>So as we saw in the previous post, implementing interfaces in F# is a bit more awkward than in C#. But F# has a trick up its sleeve, called &amp;ldquo;object expressions&amp;rdquo;.
With object expressions, you can implement an interface on-the-fly, without having to create a class.
Implementing interfaces with object expressions     Object expressions are most commonly used to implement interfaces. To do this, you use the syntax new MyInterface with .</description>
    </item>
    
    <item>
      <title>Interfaces</title>
      <link>https://fsharpforfunandprofit.com/posts/interfaces/</link>
      <pubDate>Mon, 16 Jul 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/interfaces/</guid>
      <description>Interfaces are available and fully supported in F#, but there are number of important ways in which their usage differs from what you might be used to in C#.
Defining interfaces     Defining an interface is similar to defining an abstract class. So similar, in fact, that you might easily get them confused.
Here&amp;rsquo;s an interface definition:
type MyInterface = // abstract method  abstract member Add: int -&amp;gt; int -&amp;gt; int // abstract immutable property  abstract member Pi : float // abstract read/write property  abstract member Area : float with get,set And here&amp;rsquo;s the definition for the equivalent abstract base class:</description>
    </item>
    
    <item>
      <title>Inheritance and abstract classes</title>
      <link>https://fsharpforfunandprofit.com/posts/inheritance/</link>
      <pubDate>Sun, 15 Jul 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/inheritance/</guid>
      <description>This is a follow-on from the previous post on classes. This post will focus on inheritance in F#, and how to define and use abstract classes and interfaces.
Inheritance     To declare that a class inherits from another class, use the syntax:
type DerivedClass(param1, param2) = inherit BaseClass(param1) The inherit keyword signals that DerivedClass inherits from BaseClass. In addition, some BaseClass constructor must be called at the same time.</description>
    </item>
    
    <item>
      <title>Classes</title>
      <link>https://fsharpforfunandprofit.com/posts/classes/</link>
      <pubDate>Sat, 14 Jul 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/classes/</guid>
      <description>This post and the next will cover the basics of creating and using classes and methods in F#.
Defining a class     Just like all other data types in F#, class definitions start with the type keyword.
The thing that distinguishes them from other types is that classes always have some parameters passed in when they are created &amp;ndash; the constructor &amp;ndash; and so there are always parentheses after the class name.</description>
    </item>
    
    <item>
      <title>Object-oriented programming in F#: Introduction</title>
      <link>https://fsharpforfunandprofit.com/posts/object-oriented-intro/</link>
      <pubDate>Fri, 13 Jul 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/object-oriented-intro/</guid>
      <description>In this series, we&amp;rsquo;ll look at how F# supports object-oriented classes and methods.
Should you use object-oriented features at all?     As has been stressed many times before, F# is fundamentally a functional language at heart, yet the OO features have been nicely integrated and do not have a &amp;ldquo;tacked-on&amp;rdquo; feeling. As a result, it is quite viable to use F# just as an OO language, as an alternative to C#, say.</description>
    </item>
    
    <item>
      <title>Formatted text using printf</title>
      <link>https://fsharpforfunandprofit.com/posts/printf/</link>
      <pubDate>Thu, 12 Jul 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/printf/</guid>
      <description>In this post, we&amp;rsquo;ll take a small detour and look at how to create formatted text. The printing and formatting functions are technically library functions, but in practice they as used as if they were part of the core language.
F# supports two distinct styles of formatting text:
 The standard .NET technique of &amp;ldquo;composite formatting&amp;rdquo; as seen in String.Format, Console.WriteLine and other places. The C-style technique of using printf and the associated family of functions such as printfn, sprintf and so on.</description>
    </item>
    
    <item>
      <title>Built-in .NET types</title>
      <link>https://fsharpforfunandprofit.com/posts/cli-types/</link>
      <pubDate>Tue, 10 Jul 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/cli-types/</guid>
      <description>In this post we&amp;rsquo;ll take a quick look at how F# handles the standard types that are built into .NET.
Literals     F# uses the same syntax for literals that C# does, with a few exceptions.
I&amp;rsquo;ll divide the built-in types into the following groups:
 miscellaneous types (bool, char, etc. ) string types integer types (int, uint and byte, etc) float types (float, decimal, etc) pointer types (IntPtr, etc)  The following tables list the primitive types, with their F# keywords, their suffixes if any, an example, and the corresponding .</description>
    </item>
    
    <item>
      <title>Units of measure</title>
      <link>https://fsharpforfunandprofit.com/posts/units-of-measure/</link>
      <pubDate>Tue, 10 Jul 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/units-of-measure/</guid>
      <description>As we mentioned earlier in the &amp;ldquo;why use F#?&amp;rdquo; series, F# has a very cool feature which allows you to add extra unit-of-measure information to as metadata to numeric types.
The F# compiler will then make sure that only numerics with the same unit-of-measure can be combined. This can be very useful to stop accidental mismatches and to make your code safer.
Defining units of measure     A unit of measure definition consists of the attribute [&amp;lt;Measure&amp;gt;], followed by the type keyword and then a name.</description>
    </item>
    
    <item>
      <title>Enum types</title>
      <link>https://fsharpforfunandprofit.com/posts/enum-types/</link>
      <pubDate>Mon, 09 Jul 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/enum-types/</guid>
      <description>The enum type in F# is the same as the enum type in C#. Its definition is superficially just like that of a union type, but there are many non-obvious differences to be aware of.
Defining enums     To define an enum you use exactly the same syntax as a union type with empty cases, except that you must specify a constant value for each case, and the constants must all be of the same type.</description>
    </item>
    
    <item>
      <title>Understanding type inference</title>
      <link>https://fsharpforfunandprofit.com/posts/type-inference/</link>
      <pubDate>Mon, 09 Jul 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/type-inference/</guid>
      <description>Before we finish with types, let&amp;rsquo;s revisit type inference: the magic that allows the F# compiler to deduce what types are used and where. We have seen this happen through all the examples so far, but how does it work and what can you do if it goes wrong?
How does type inference work?     It does seem to be magic, but the rules are mostly straightforward. The fundamental logic is based on an algorithm often called &amp;ldquo;Hindley-Milner&amp;rdquo; or &amp;ldquo;HM&amp;rdquo; (more accurately it should be called &amp;ldquo;Damas-Milner&amp;rsquo;s Algorithm W&amp;rdquo;).</description>
    </item>
    
    <item>
      <title>Worked example: A stack based calculator</title>
      <link>https://fsharpforfunandprofit.com/posts/stack-based-calculator/</link>
      <pubDate>Sat, 07 Jul 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/stack-based-calculator/</guid>
      <description>In this post, we&amp;rsquo;ll implement a simple stack based calculator (also known as &amp;ldquo;reverse Polish&amp;rdquo; style). The implementation is almost entirely done with functions, with only one special type and no pattern matching at all, so it is a great testing ground for the concepts introduced in this series.
If you are not familiar with a stack based calculator, it works as follows: numbers are pushed on a stack, and operations such as addition and multiplication pop numbers off the stack and push the result back on.</description>
    </item>
    
    <item>
      <title>Worked example: Roman numerals</title>
      <link>https://fsharpforfunandprofit.com/posts/roman-numerals/</link>
      <pubDate>Sat, 30 Jun 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/roman-numerals/</guid>
      <description>Last time we looked at parsing a command line. This time we&amp;rsquo;ll look at another pattern matching example, this time using Roman numerals.
As before, we will try to have a &amp;ldquo;pure&amp;rdquo; internal model with separate stages to convert the input to the internal model, and then another separate stage to convert from the internal model to the output.
Requirements     Let&amp;rsquo;s start with the requirements:
1) Accept a string of letters like &amp;quot;MMMXCLXXIV&amp;quot; as a string and convert it to an integer.</description>
    </item>
    
    <item>
      <title>Worked example: Parsing command line arguments</title>
      <link>https://fsharpforfunandprofit.com/posts/pattern-matching-command-line/</link>
      <pubDate>Fri, 29 Jun 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/pattern-matching-command-line/</guid>
      <description>Now that we&amp;rsquo;ve seen how the match expression works, let&amp;rsquo;s look at some examples in practice. But first, a word about the design approach.
Application design in F#     We&amp;rsquo;ve seen that a generic function takes input and emits output. But in a sense, that approach applies at any level of functional code, even at the top level.
In fact, we can say that a functional application takes input, transforms it, and emits output:</description>
    </item>
    
    <item>
      <title>Match expressions</title>
      <link>https://fsharpforfunandprofit.com/posts/match-expression/</link>
      <pubDate>Thu, 28 Jun 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/match-expression/</guid>
      <description>Pattern matching is ubiquitous in F#. It is used for binding values to expressions with let, and in function parameters, and for branching using the match..with syntax.
We have briefly covered binding values to expressions in a post in the &amp;ldquo;why use F#?&amp;rdquo; series, and it will be covered many times as we investigate types.
So in this post, we&amp;rsquo;ll cover the match..with syntax and its use for control flow.</description>
    </item>
    
    <item>
      <title>The Option type</title>
      <link>https://fsharpforfunandprofit.com/posts/the-option-type/</link>
      <pubDate>Thu, 07 Jun 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/the-option-type/</guid>
      <description>Now let&amp;rsquo;s look at a particular union type, the Option type. It is so common and so useful that it is actually built into the language.
You have already seen the option type discussed in passing, but let&amp;rsquo;s go back to basics and understand how it fits into the type system.
A very common situation is when you want to represent missing or invalid values. Using a diagram, the domain would look like this:</description>
    </item>
    
    <item>
      <title>Discriminated Unions</title>
      <link>https://fsharpforfunandprofit.com/posts/discriminated-unions/</link>
      <pubDate>Wed, 06 Jun 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/discriminated-unions/</guid>
      <description>Tuples and records are examples of creating new types by &amp;ldquo;multiplying&amp;rdquo; existing types together. At the beginning of the series, I mentioned that the other way of creating new types was by &amp;ldquo;summing&amp;rdquo; existing types. What does this mean?
Well, let&amp;rsquo;s say that we want to define a function that works with integers OR booleans, maybe to convert them into strings. But we want to be strict and not accept any other type (such as floats or strings).</description>
    </item>
    
    <item>
      <title>Records</title>
      <link>https://fsharpforfunandprofit.com/posts/records/</link>
      <pubDate>Tue, 05 Jun 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/records/</guid>
      <description>As we noted in the previous post, plain tuples are useful in many cases. But they have some disadvantages too. Because all tuple types are pre-defined, you can&amp;rsquo;t distinguish between a pair of floats used for geographic coordinates say, vs. a similar tuple used for complex numbers. And when tuples have more than a few elements, it is easy to get confused about which element is in which place.
In these situations, what you would like to do is label each slot in the tuple, which will both document what each element is for and force a distinction between tuples made from the same types.</description>
    </item>
    
    <item>
      <title>Tuples</title>
      <link>https://fsharpforfunandprofit.com/posts/tuples/</link>
      <pubDate>Mon, 04 Jun 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/tuples/</guid>
      <description>We&amp;rsquo;re ready for our first extended type &amp;ndash; the tuple.
Let&amp;rsquo;s start by stepping back again and looking at a type such as &amp;ldquo;int&amp;rdquo;. As we hinted at before, rather than thinking of &amp;ldquo;int&amp;rdquo; as a abstract thing, you can think of it as concrete collection of all its possible values, namely the set {&amp;hellip;,-3, -2, -1, 0, 2, 3, &amp;hellip;}.
So next, imagine two copies of this &amp;ldquo;int&amp;rdquo; collection. We can &amp;ldquo;multiply&amp;rdquo; them together by taking the Cartesian product of them; that is, making a new list of objects by picking every possible combination of the two &amp;ldquo;int&amp;rdquo; lists, as shown below:</description>
    </item>
    
    <item>
      <title>Type abbreviations</title>
      <link>https://fsharpforfunandprofit.com/posts/type-abbreviations/</link>
      <pubDate>Sun, 03 Jun 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/type-abbreviations/</guid>
      <description>Let&amp;rsquo;s start with the simplest type definition, a type abbreviation or alias.
It has the form:
type [typename] = [existingType] where &amp;ldquo;existing type&amp;rdquo; can be any type: one of the basic types we have already seen, or one of the extended types we will be seeing soon.
Some examples:
type RealNumber = float type ComplexNumber = float * float type ProductCode = string type CustomerId = int type AdditionFunction = int-&amp;gt;int-&amp;gt;int type ComplexAdditionFunction = ComplexNumber-&amp;gt; ComplexNumber -&amp;gt; ComplexNumber And so on &amp;ndash; pretty straightforward.</description>
    </item>
    
    <item>
      <title>Overview of types in F#</title>
      <link>https://fsharpforfunandprofit.com/posts/overview-of-types-in-fsharp/</link>
      <pubDate>Sat, 02 Jun 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/overview-of-types-in-fsharp/</guid>
      <description>Before we dive into all the specific types, let&amp;rsquo;s look at the big picture.
What are types for?     If you are coming from an object-oriented design background, one of the paradigm shifts involved in &amp;ldquo;thinking functionally&amp;rdquo; is to change how you think about types.
A well designed object-oriented program will have a strong focus on behavior rather than data, so it will use a lot of polymorphism, either using &amp;ldquo;duck-typing&amp;rdquo; or explicit interfaces, and will try to avoid having explicit knowledge of the actual concrete classes being passed around.</description>
    </item>
    
    <item>
      <title>Understanding F# types: Introduction</title>
      <link>https://fsharpforfunandprofit.com/posts/types-intro/</link>
      <pubDate>Fri, 01 Jun 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/types-intro/</guid>
      <description>NOTE: Before reading this series, I suggest that you read the &amp;ldquo;thinking functionally&amp;rdquo; and &amp;ldquo;expressions and syntax&amp;rdquo; series as a prerequisite.
F# is not just about functions; the powerful type system is another key ingredient. And just as with functions, understanding the type system is critical to being fluent and comfortable in the language.
Now, so far we have seen some basic types that can be used as input and output to functions:</description>
    </item>
    
    <item>
      <title>Exceptions</title>
      <link>https://fsharpforfunandprofit.com/posts/exceptions/</link>
      <pubDate>Mon, 21 May 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/exceptions/</guid>
      <description>Just like other .NET languages, F# supports throwing and catching exceptions. As with the control flow expressions, the syntax will feel familiar, but again there are a few catches that you should know about.
Defining your own exceptions     When raising/throwing exceptions, you can use the standard system ones such as InvalidOperationException, or you can define your own exception types using the simple syntax shown below, where the &amp;ldquo;content&amp;rdquo; of the exception is any F# type:</description>
    </item>
    
    <item>
      <title>Control flow expressions</title>
      <link>https://fsharpforfunandprofit.com/posts/control-flow-expressions/</link>
      <pubDate>Sun, 20 May 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/control-flow-expressions/</guid>
      <description>In this post, we&amp;rsquo;ll look at the control flow expressions, namely:
 if-then-else for x in collection (which is the same as foreach in C#) for x = start to end while-do  These control flow expressions are no doubt very familiar to you. But they are very &amp;ldquo;imperative&amp;rdquo; rather than functional.
So I would strongly recommend that you do not use them if at all possible, especially when you are learning to think functionally.</description>
    </item>
    
    <item>
      <title>Parameter and value naming conventions</title>
      <link>https://fsharpforfunandprofit.com/posts/naming-conventions/</link>
      <pubDate>Sat, 19 May 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/naming-conventions/</guid>
      <description>If you are coming to F# from an imperative language such as C#, then you might find a lot of the names shorter and more cryptic than you are used to.
In C# and Java, the best practice is to have long descriptive identifiers. In functional languages, the function names themselves can be descriptive, but the local identifiers inside a function tend to be quite short, and piping and composition is used a lot to get everything on a minimal number of lines.</description>
    </item>
    
    <item>
      <title>F# syntax: indentation and verbosity</title>
      <link>https://fsharpforfunandprofit.com/posts/fsharp-syntax/</link>
      <pubDate>Fri, 18 May 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/fsharp-syntax/</guid>
      <description>The syntax for F# is mostly straightforward. But there are a few rules that you should understand if you want to avoid common indentation errors. If you are familiar with a language like Python that also is whitespace sensitive, be aware that that the rules for indentation in F# are subtly different.
Indentation and the &amp;ldquo;offside&amp;rdquo; rule     In soccer, the offside rule says that in some situations, a player cannot be &amp;ldquo;ahead&amp;rdquo; of the ball when they should be behind or level with it.</description>
    </item>
    
    <item>
      <title>Binding with let, use, and do</title>
      <link>https://fsharpforfunandprofit.com/posts/let-use-do/</link>
      <pubDate>Thu, 17 May 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/let-use-do/</guid>
      <description>As we&amp;rsquo;ve have already seen, there are no &amp;ldquo;variables&amp;rdquo; in F#. Instead there are values.
And we have also seen that keywords such as let, use, and do act as bindings &amp;ndash; associating an identifier with a value or function expression.
In this post we&amp;rsquo;ll look at these bindings in more detail.
&amp;ldquo;let&amp;rdquo; bindings     The let binding is straightforward, it has the general form:
let aName = someExpression But there are two uses of let that are subtly different.</description>
    </item>
    
    <item>
      <title>Overview of F# expressions</title>
      <link>https://fsharpforfunandprofit.com/posts/understanding-fsharp-expressions/</link>
      <pubDate>Thu, 17 May 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/understanding-fsharp-expressions/</guid>
      <description>In this post we&amp;rsquo;ll look at the different kinds of expressions that are available in F# and some general tips for using them.
Is everything really an expression?     You might be wondering how &amp;ldquo;everything is an expression&amp;rdquo; actually works in practice.
Let&amp;rsquo;s start with some basic expression examples that should be familiar:
1 // literal [1;2;3] // list expression -2 // prefix operator 2 + 2 // infix operator &amp;#34;string&amp;#34;.</description>
    </item>
    
    <item>
      <title>Expressions vs. statements</title>
      <link>https://fsharpforfunandprofit.com/posts/expressions-vs-statements/</link>
      <pubDate>Wed, 16 May 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/expressions-vs-statements/</guid>
      <description>In programming language terminology, an &amp;ldquo;expression&amp;rdquo; is a combination of values and functions that are combined and interpreted by the compiler to create a new value, as opposed to a &amp;ldquo;statement&amp;rdquo; which is just a standalone unit of execution and doesn&amp;rsquo;t return anything. One way to think of this is that the purpose of an expression is to create a value (with some possible side-effects), while the sole purpose of a statement is to have side-effects.</description>
    </item>
    
    <item>
      <title>Expressions and syntax: Introduction</title>
      <link>https://fsharpforfunandprofit.com/posts/expressions-intro/</link>
      <pubDate>Tue, 15 May 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/expressions-intro/</guid>
      <description>NOTE: Before reading this series, I suggest that you read the &amp;ldquo;thinking functionally&amp;rdquo; series as a prerequisite.
In this series we&amp;rsquo;ll look at how functions and values are combined into expressions, and the different kinds of expressions that are available in F#.
We&amp;rsquo;ll also look at some other basic topics, such as let bindings, F# syntax, pattern matching, and outputting text with printf.
This series is not meant to be exhaustive or definitive.</description>
    </item>
    
    <item>
      <title>Attaching functions to types</title>
      <link>https://fsharpforfunandprofit.com/posts/type-extensions/</link>
      <pubDate>Fri, 11 May 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/type-extensions/</guid>
      <description>Although we have focused on the pure functional style so far, sometimes it is convenient to switch to an object oriented style. And one of the key features of the OO style is the ability to attach functions to a class and &amp;ldquo;dot into&amp;rdquo; the class to get the desired behavior.
In F#, this is done using a feature called &amp;ldquo;type extensions&amp;rdquo;. And any F# type, not just classes, can have functions attached to them.</description>
    </item>
    
    <item>
      <title>Organizing functions</title>
      <link>https://fsharpforfunandprofit.com/posts/organizing-functions/</link>
      <pubDate>Thu, 10 May 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/organizing-functions/</guid>
      <description>Now that you know how to define functions, how can you organize them?
In F#, there are three options:
 functions can be nested inside other functions. at an application level, the top level functions are grouped into &amp;ldquo;modules&amp;rdquo;. alternatively, you can also use the object-oriented approach and attach functions to types as methods.  We&amp;rsquo;ll look at the first two options in this post, and the third in the next post.</description>
    </item>
    
    <item>
      <title>Function signatures</title>
      <link>https://fsharpforfunandprofit.com/posts/function-signatures/</link>
      <pubDate>Wed, 09 May 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/function-signatures/</guid>
      <description>It may not be obvious, but F# actually has two syntaxes - one for normal (value) expressions, and one for type definitions. For example:
[1;2;3] // a normal expression int list // a type expression  Some 1 // a normal expression int option // a type expression  (1,&amp;#34;a&amp;#34;) // a normal expression int * string // a type expression Type expressions have a special syntax that is different from the syntax used in normal expressions.</description>
    </item>
    
    <item>
      <title>Defining functions</title>
      <link>https://fsharpforfunandprofit.com/posts/defining-functions/</link>
      <pubDate>Tue, 08 May 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/defining-functions/</guid>
      <description>We have seen how to create typical functions using the &amp;ldquo;let&amp;rdquo; syntax, below:
let add x y = x + y In this section, we&amp;rsquo;ll look at some other ways of creating functions, and tips for defining functions.
Anonymous functions (a.k.a. lambdas)     If you are familiar with lambdas in other languages, this will not be new to you. An anonymous function (or &amp;ldquo;lambda expression&amp;rdquo;) is defined using the form:</description>
    </item>
    
    <item>
      <title>Function associativity and composition</title>
      <link>https://fsharpforfunandprofit.com/posts/function-composition/</link>
      <pubDate>Mon, 07 May 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/function-composition/</guid>
      <description>Function associativity     If we have a chain of functions in a row, how are they combined?
For example, what does this mean?
let F x y z = x y z Does it mean apply the function y to the argument z, and then take the result and use it as an argument for x? In which case it is the same as:
let F x y z = x (y z) Or does it mean apply the function x to the argument y, and then take the resulting function and evaluate it with the argument z?</description>
    </item>
    
    <item>
      <title>Partial application</title>
      <link>https://fsharpforfunandprofit.com/posts/partial-application/</link>
      <pubDate>Sun, 06 May 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/partial-application/</guid>
      <description>In the previous post on currying, we looked at breaking multiple parameter functions into smaller one parameter functions. It is the mathematically correct way of doing it, but that is not the only reason it is done &amp;ndash; it also leads to a very powerful technique called partial function application. This is a very widely used style in functional programming, and it is important to understand it.
The idea of partial application is that if you fix the first N parameters of the function, you get a function of the remaining parameters.</description>
    </item>
    
    <item>
      <title>Currying</title>
      <link>https://fsharpforfunandprofit.com/posts/currying/</link>
      <pubDate>Sat, 05 May 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/currying/</guid>
      <description>After that little digression on basic types, we can turn back to functions again, and in particular the puzzle we mentioned earlier: if a mathematical function can only have one parameter, then how is it possible that an F# function can have more than one?
The answer is quite simple: a function with multiple parameters is rewritten as a series of new functions, each with only one parameter. And this is done automatically by the compiler for you.</description>
    </item>
    
    <item>
      <title>How types work with functions</title>
      <link>https://fsharpforfunandprofit.com/posts/how-types-work-with-functions/</link>
      <pubDate>Fri, 04 May 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/how-types-work-with-functions/</guid>
      <description>Now that we have some understanding of functions, we&amp;rsquo;ll look at how types work with functions, both as domains and ranges. This is just an overview; the series &amp;ldquo;understanding F# types&amp;rdquo; will cover types in detail.
First, we need to understand the type notation a bit more. We&amp;rsquo;ve seen that the arrow notation &amp;ldquo;-&amp;gt;&amp;rdquo; is used to show the domain and range. So that a function signature always looks like:</description>
    </item>
    
    <item>
      <title>Function Values and Simple Values</title>
      <link>https://fsharpforfunandprofit.com/posts/function-values-and-simple-values/</link>
      <pubDate>Thu, 03 May 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/function-values-and-simple-values/</guid>
      <description>Let&amp;rsquo;s look at the simple function again
let add1 x = x + 1 What does the &amp;ldquo;x&amp;rdquo; mean here? It means:
 Accept some value from the input domain. Use the name &amp;ldquo;x&amp;rdquo; to represent that value so that we can refer to it later.  This process of using a name to represent a value is called &amp;ldquo;binding&amp;rdquo;. The name &amp;ldquo;x&amp;rdquo; is &amp;ldquo;bound&amp;rdquo; to the input value.
So if we evaluate the function with the input 5 say, what is happening is that everywhere we see &amp;ldquo;x&amp;rdquo; in the original definition, we replace it with &amp;ldquo;5&amp;rdquo;, sort of like search and replace in a word processor.</description>
    </item>
    
    <item>
      <title>Mathematical functions</title>
      <link>https://fsharpforfunandprofit.com/posts/mathematical-functions/</link>
      <pubDate>Wed, 02 May 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/mathematical-functions/</guid>
      <description>The impetus behind functional programming comes from mathematics. Mathematical functions have a number of very nice features that functional languages try to emulate in the real world.
So first, let&amp;rsquo;s start with a mathematical function that adds 1 to a number.
Add1(x) = x+1 What does this really mean? Well it seems pretty straightforward. It means that there is an operation that starts with a number, and adds one to it.</description>
    </item>
    
    <item>
      <title>Thinking Functionally: Introduction</title>
      <link>https://fsharpforfunandprofit.com/posts/thinking-functionally-intro/</link>
      <pubDate>Tue, 01 May 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/thinking-functionally-intro/</guid>
      <description>Now that you have seen some of the power of F# in the &amp;ldquo;why use F#&amp;quot; series, we&amp;rsquo;re going to step back and look at the fundamentals of functional programming &amp;ndash; what does it really mean to &amp;ldquo;program functionally&amp;rdquo;, and how this approach is different from object oriented or imperative programming.
Changing the way you think     It is important to understand that functional programming is not just a stylistic difference; it is a completely different way of thinking about programming, in the way that truly object-oriented programming (in Smalltalk say) is also a different way of thinking from a traditional imperative language such as C.</description>
    </item>
    
    <item>
      <title>Why use F#: Conclusion</title>
      <link>https://fsharpforfunandprofit.com/posts/why-use-fsharp-conclusion/</link>
      <pubDate>Mon, 30 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/why-use-fsharp-conclusion/</guid>
      <description>This completes the tour of F# features. I hope that the examples have given you some appreciation of the power of F# and functional programming. If you have any comments on the series as a whole, please leave them at the bottom of this page.
In later series I hope to go deeper into data structures, pattern matching, list processing, asynchronous and parallel programming, and much more.
But before those, I recommend you read the &amp;ldquo;thinking functionally&amp;rdquo; series, which will help you understand functional programming at a deeper level.</description>
    </item>
    
    <item>
      <title>Anything C# can do...</title>
      <link>https://fsharpforfunandprofit.com/posts/completeness-anything-csharp-can-do/</link>
      <pubDate>Sun, 29 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/completeness-anything-csharp-can-do/</guid>
      <description>As should be apparent, you should generally try to prefer functional-style code over object-oriented code in F#, but in some situations, you may need all the features of a fully fledged OO language &amp;ndash; classes, inheritance, virtual methods, etc.
So just to conclude this section, here is a whirlwind tour of the F# versions of these features.
Some of these will be dealt with in much more depth in a later series on .</description>
    </item>
    
    <item>
      <title>Seamless interoperation with .NET libraries</title>
      <link>https://fsharpforfunandprofit.com/posts/completeness-seamless-dotnet-interop/</link>
      <pubDate>Sat, 28 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/completeness-seamless-dotnet-interop/</guid>
      <description>We have already seen many examples of F#&amp;rsquo;s use with the .NET libraries, such as using System.Net.WebRequest and System.Text.RegularExpressions. And the integration was indeed seamless.
For more complex requirements, F# natively supports .NET classes, interfaces, and structures, so the interop is still very straightforward. For example, you can write an ISomething interface in C# and have the implementation be done in F#.
But not only can F# call into existing .</description>
    </item>
    
    <item>
      <title>Completeness</title>
      <link>https://fsharpforfunandprofit.com/posts/completeness-intro/</link>
      <pubDate>Fri, 27 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/completeness-intro/</guid>
      <description>In this final set of posts, we will look at some other aspects of F# under the theme of &amp;ldquo;completeness&amp;rdquo;.
Programming languages coming from the academic world tend to focus on elegance and purity over real-world usefulness, while more mainstream business languages such as C# and Java are valued precisely because they are pragmatic; they can work in a wide array of situations and have extensive tools and libraries to meet almost every need.</description>
    </item>
    
    <item>
      <title>Functional Reactive Programming</title>
      <link>https://fsharpforfunandprofit.com/posts/concurrency-reactive/</link>
      <pubDate>Thu, 26 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/concurrency-reactive/</guid>
      <description>Events are everywhere. Almost every program has to handle events, whether it be button clicks in the user interface, listening to sockets in a server, or even a system shutdown notification.
And events are the basis of one of the most common OO design patterns: the &amp;ldquo;Observer&amp;rdquo; pattern.
But as we know, event handling, like concurrency in general, can be tricky to implement. Simple event logic is straightforward, but what about logic like &amp;ldquo;do something if two events happen in a row but do something different if only one event happens&amp;rdquo; or &amp;ldquo;do something if two events happen at roughly the same time&amp;rdquo;.</description>
    </item>
    
    <item>
      <title>Messages and Agents</title>
      <link>https://fsharpforfunandprofit.com/posts/concurrency-actor-model/</link>
      <pubDate>Wed, 25 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/concurrency-actor-model/</guid>
      <description>In this post, we&amp;rsquo;ll look at the message-based (or actor-based) approach to concurrency.
In this approach, when one task wants to communicate with another, it sends it a message, rather than contacting it directly. The messages are put on a queue, and the receiving task (known as an &amp;ldquo;actor&amp;rdquo; or &amp;ldquo;agent&amp;rdquo;) pulls the messages off the queue one at a time to process them.
This message-based approach has been applied to many situations, from low-level network sockets (built on TCP/IP) to enterprise wide application integration systems (for example RabbitMQ or IBM WebSphere MQ).</description>
    </item>
    
    <item>
      <title>Asynchronous programming</title>
      <link>https://fsharpforfunandprofit.com/posts/concurrency-async-and-parallel/</link>
      <pubDate>Tue, 24 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/concurrency-async-and-parallel/</guid>
      <description>In this post we&amp;rsquo;ll have a look at a few ways to write asynchronous code in F#, and a very brief example of parallelism as well.
Traditional asynchronous programming     As noted in the previous post, F# can directly use all the usual .NET suspects, such as Thread AutoResetEvent, BackgroundWorker and IAsyncResult.
Let&amp;rsquo;s see a simple example where we wait for a timer event to go off:</description>
    </item>
    
    <item>
      <title>Concurrency</title>
      <link>https://fsharpforfunandprofit.com/posts/concurrency-intro/</link>
      <pubDate>Mon, 23 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/concurrency-intro/</guid>
      <description>We hear a lot about concurrency nowadays, how important it is, and how it is &amp;ldquo;the next major revolution in how we write software&amp;rdquo;.
So what do we actually mean by &amp;ldquo;concurrency&amp;rdquo; and how can F# help?
The simplest definition of concurrency is just &amp;ldquo;several things happening at once, and maybe interacting with each other&amp;rdquo;. It seems a trivial definition, but the key point is that most computer programs (and languages) are designed to work serially, on one thing at a time, and are not well-equipped to handle concurrency.</description>
    </item>
    
    <item>
      <title>Worked example: Designing for correctness</title>
      <link>https://fsharpforfunandprofit.com/posts/designing-for-correctness/</link>
      <pubDate>Sun, 22 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/designing-for-correctness/</guid>
      <description>In this post, we&amp;rsquo;ll see how you can design for correctness (or at least, for the requirements as you currently understand them), by which I mean that a client of a well designed model will not be able to put the system into an illegal state &amp;ndash; a state that doesn&amp;rsquo;t meet the requirements. You literally cannot create incorrect code because the compiler will not let you.
For this to work, we do have to spend some time up front thinking about design and making an effort to encode the requirements into the types that you use.</description>
    </item>
    
    <item>
      <title>Using the type system to ensure correct code</title>
      <link>https://fsharpforfunandprofit.com/posts/correctness-type-checking/</link>
      <pubDate>Sat, 21 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/correctness-type-checking/</guid>
      <description>You are familiar with static type checking through languages such as C# and Java. In these languages, the type checking is straightforward but rather crude, and can be seen as an annoyance compared with the freedom of dynamic languages such as Python and Ruby.
But in F# the type system is your friend, not your enemy. You can use static type checking almost as an instant unit test &amp;ndash; making sure that your code is correct at compile time.</description>
    </item>
    
    <item>
      <title>Exhaustive pattern matching</title>
      <link>https://fsharpforfunandprofit.com/posts/correctness-exhaustive-pattern-matching/</link>
      <pubDate>Fri, 20 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/correctness-exhaustive-pattern-matching/</guid>
      <description>We briefly noted earlier that when pattern matching there is a requirement to match all possible cases. This turns out be a very powerful technique to ensure correctness.
Let&amp;rsquo;s compare some C# to F# again. Here&amp;rsquo;s some C# code that uses a switch statement to handle different types of state.
enum State { New, Draft, Published, Inactive, Discontinued } void HandleState(State state) { switch (state) { case State.Inactive: ... case State.</description>
    </item>
    
    <item>
      <title>Immutability</title>
      <link>https://fsharpforfunandprofit.com/posts/correctness-immutability/</link>
      <pubDate>Thu, 19 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/correctness-immutability/</guid>
      <description>To see why immutability is important, let&amp;rsquo;s start with a small example.
Here&amp;rsquo;s some simple C# code that processes a list of numbers.
public List&amp;lt;int&amp;gt; MakeList() { return new List&amp;lt;int&amp;gt; {1,2,3,4,5,6,7,8,9,10}; } public List&amp;lt;int&amp;gt; OddNumbers(List&amp;lt;int&amp;gt; list) { // some code } public List&amp;lt;int&amp;gt; EvenNumbers(List&amp;lt;int&amp;gt; list) { // some code } Now let me test it:
public void Test() { var odds = OddNumbers(MakeList()); var evens = EvenNumbers(MakeList()); // assert odds = 1,3,5,7,9 -- OK!</description>
    </item>
    
    <item>
      <title>Correctness</title>
      <link>https://fsharpforfunandprofit.com/posts/correctness-intro/</link>
      <pubDate>Wed, 18 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/correctness-intro/</guid>
      <description>As a programmer, you are constantly judging the code that you and others write. In an ideal world, you should be able to look at a piece of code and easily understand exactly what it does; and of course, being concise, clear and readable is a major factor in this.
But more importantly, you have to be able to convince yourself that the code does what it is supposed to do.</description>
    </item>
    
    <item>
      <title>Active patterns</title>
      <link>https://fsharpforfunandprofit.com/posts/convenience-active-patterns/</link>
      <pubDate>Tue, 17 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/convenience-active-patterns/</guid>
      <description>F# has a special type of pattern matching called &amp;ldquo;active patterns&amp;rdquo; where the pattern can be parsed or detected dynamically. As with normal patterns, the matching and output are combined into a single step from the caller&amp;rsquo;s point of view.
Here is an example of using active patterns to parse a string into an int or bool.
// create an active pattern let (|Int|_|) str = match System.Int32.TryParse(str:string) with | (true,int) -&amp;gt; Some(int) | _ -&amp;gt; None // create an active pattern let (|Bool|_|) str = match System.</description>
    </item>
    
    <item>
      <title>Partial Application</title>
      <link>https://fsharpforfunandprofit.com/posts/convenience-partial-application/</link>
      <pubDate>Mon, 16 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/convenience-partial-application/</guid>
      <description>A particularly convenient feature of F# is that complicated functions with many parameters can have some of the parameters fixed or &amp;ldquo;baked in&amp;rdquo; and yet leave other parameters open. In this post, we&amp;rsquo;ll take a quick look at how this might be used in practice.
Let&amp;rsquo;s start with a very simple example of how this works. We&amp;rsquo;ll start with a trivial function:
// define a adding function let add x y = x + y // normal use let z = add 1 2 But we can do something strange as well &amp;ndash; we can call the function with only one parameter!</description>
    </item>
    
    <item>
      <title>Functions as interfaces</title>
      <link>https://fsharpforfunandprofit.com/posts/convenience-functions-as-interfaces/</link>
      <pubDate>Sun, 15 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/convenience-functions-as-interfaces/</guid>
      <description>An important aspect of functional programming is that, in a sense, all functions are &amp;ldquo;interfaces&amp;rdquo;, meaning that many of the roles that interfaces play in object-oriented design are implicit in the way that functions work.
In fact, one of the critical design maxims, &amp;ldquo;program to an interface, not an implementation&amp;rdquo;, is something you get for free in F#.
To see how this works, let&amp;rsquo;s compare the same design pattern in C# and F#.</description>
    </item>
    
    <item>
      <title>Out-of-the-box behavior for types</title>
      <link>https://fsharpforfunandprofit.com/posts/convenience-types/</link>
      <pubDate>Sat, 14 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/convenience-types/</guid>
      <description>One nice thing about F# is that most types immediately have some useful &amp;ldquo;out-of-the-box&amp;rdquo; behavior such as immutability and built-in equality, functionality that often has to be explicitly coded for in C#.
By &amp;ldquo;most&amp;rdquo; F# types, I mean the core &amp;ldquo;structural&amp;rdquo; types such as tuples, records, unions, options, lists, etc. Classes and some other types have been added to help with .NET integration, but lose some of the power of the structural types.</description>
    </item>
    
    <item>
      <title>Convenience</title>
      <link>https://fsharpforfunandprofit.com/posts/convenience-intro/</link>
      <pubDate>Fri, 13 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/convenience-intro/</guid>
      <description>In the next set of posts, we will explore a few more features of F# that I have grouped under the theme of &amp;ldquo;convenience&amp;rdquo;. These features do not necessarily result in more concise code, but they do remove much of the drudgery and boilerplate code that would be needed in C#.
 Useful &amp;ldquo;out-of-the-box&amp;rdquo; behavior for types. Most types that you create will immediately have some useful behavior, such as immutability and built-in equality &amp;ndash; functionality that has to be explicitly coded for in C#.</description>
    </item>
    
    <item>
      <title>Pattern matching for conciseness</title>
      <link>https://fsharpforfunandprofit.com/posts/conciseness-pattern-matching/</link>
      <pubDate>Thu, 12 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/conciseness-pattern-matching/</guid>
      <description>So far we have seen the pattern matching logic in the match..with expression, where it seems to be just a switch/case statement. But in fact pattern matching is much more general &amp;ndash; it can compare expressions in a number of ways, matching on values, conditions, and types, and then assign or extract values, all at the same time.
Pattern matching will be discussed in depth in later posts, but to start with, here is a little taster of one way that it aids conciseness.</description>
    </item>
    
    <item>
      <title>Using functions as building blocks</title>
      <link>https://fsharpforfunandprofit.com/posts/conciseness-functions-as-building-blocks/</link>
      <pubDate>Wed, 11 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/conciseness-functions-as-building-blocks/</guid>
      <description>A well-known principle of good design is to create a set of basic operations and then combine these building blocks in various ways to build up more complex behaviors. In object-oriented languages, this goal gives rise to a number of implementation approaches such as &amp;ldquo;fluent interfaces&amp;rdquo;, &amp;ldquo;strategy pattern&amp;rdquo;, &amp;ldquo;decorator pattern&amp;rdquo;, and so on. In F#, they are all done the same way, via function composition.
Let&amp;rsquo;s start with a simple example using integers.</description>
    </item>
    
    <item>
      <title>Using functions to extract boilerplate code</title>
      <link>https://fsharpforfunandprofit.com/posts/conciseness-extracting-boilerplate/</link>
      <pubDate>Tue, 10 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/conciseness-extracting-boilerplate/</guid>
      <description>In the very first example in this series, we saw a simple function that calculated the sum of squares, implemented in both F# and C#. Now let&amp;rsquo;s say we want some new functions which are similar, such as:
 Calculating the product of all the numbers up to N Counting the sum of odd numbers up to N The alternating sum of the numbers up to N  Obviously, all these requirements are similar, but how would you extract any common functionality?</description>
    </item>
    
    <item>
      <title>Low overhead type definitions</title>
      <link>https://fsharpforfunandprofit.com/posts/conciseness-type-definitions/</link>
      <pubDate>Mon, 09 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/conciseness-type-definitions/</guid>
      <description>In C#, there is a disincentive for creating new types &amp;ndash; the lack of type inference means you need to explicitly specify types in most places, resulting in brittleness and more visual clutter. As a result, there is always a temptation to create monolithic classes rather than modularizing them.
In F# there is no penalty for making new types, so it is quite common to have hundreds if not thousands of them.</description>
    </item>
    
    <item>
      <title>Type inference</title>
      <link>https://fsharpforfunandprofit.com/posts/conciseness-type-inference/</link>
      <pubDate>Sun, 08 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/conciseness-type-inference/</guid>
      <description>As you have already seen, F# uses a technique called &amp;ldquo;type inference&amp;rdquo; to greatly reduce the number of type annotations that need to be explicitly specified in normal code. And even when types do need to be specified, the syntax is less longwinded compared to C#.
To see this, here are some C# methods that wrap two standard LINQ functions. The implementations are trivial, but the method signatures are extremely complex:</description>
    </item>
    
    <item>
      <title>Conciseness</title>
      <link>https://fsharpforfunandprofit.com/posts/conciseness-intro/</link>
      <pubDate>Sat, 07 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/conciseness-intro/</guid>
      <description>After having seen some simple code, we will now move on to demonstrating the major themes (conciseness, convenience, correctness, concurrency and completeness), filtered through the concepts of types, functions and pattern matching.
With the next few posts, we&amp;rsquo;ll examine the features of F# that aid conciseness and readability.
An important goal for most mainstream programming languages is a good balance of readability and conciseness. Too much conciseness can result in hard-to-understand or obfuscated code (APL anyone?</description>
    </item>
    
    <item>
      <title>Four Key Concepts</title>
      <link>https://fsharpforfunandprofit.com/posts/key-concepts/</link>
      <pubDate>Fri, 06 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/key-concepts/</guid>
      <description>In the next few posts we&amp;rsquo;ll move on to demonstrating the themes of this series: conciseness, convenience, correctness, concurrency and completeness.
But before that, let&amp;rsquo;s look at some of the key concepts in F# that we will meet over and over again. F# is different in many ways from a standard imperative language like C#, but there are a few major differences that are particularly important to understand:
 Function-oriented rather than object-oriented Expressions rather than statements Algebraic types for creating domain models Pattern matching for flow of control  In later posts, these will be dealt with in much greater depth &amp;ndash; this is just a taster to help you understand the rest of this series.</description>
    </item>
    
    <item>
      <title>Comparing F# with C#: Downloading a web page</title>
      <link>https://fsharpforfunandprofit.com/posts/fvsc-download/</link>
      <pubDate>Thu, 05 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/fvsc-download/</guid>
      <description>In this example, we will compare the F# and C# code for downloading a web page, with a callback to process the text stream.
We&amp;rsquo;ll start with a straightforward F# implementation.
// &amp;#34;open&amp;#34; brings a .NET namespace into visibility open System.Net open System open System.IO // Fetch the contents of a web page let fetchUrl callback url = let req = WebRequest.Create(Uri(url)) use resp = req.GetResponse() use stream = resp.GetResponseStream() use reader = new IO.</description>
    </item>
    
    <item>
      <title>Comparing F# with C#: Sorting</title>
      <link>https://fsharpforfunandprofit.com/posts/fvsc-quicksort/</link>
      <pubDate>Wed, 04 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/fvsc-quicksort/</guid>
      <description>In this next example, we will implement a quicksort-like algorithm for sorting lists and compare an F# implementation to a C# implementation.
Here is the logic for a simplified quicksort-like algorithm:
If the list is empty, there is nothing to do. Otherwise: 1. Take the first element of the list 2. Find all elements in the rest of the list that are less than the first element, and sort them. 3.</description>
    </item>
    
    <item>
      <title>Comparing F# with C#: A simple sum</title>
      <link>https://fsharpforfunandprofit.com/posts/fvsc-sum-of-squares/</link>
      <pubDate>Tue, 03 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/fvsc-sum-of-squares/</guid>
      <description>To see what some real F# code looks like, let&amp;rsquo;s start with a simple problem: &amp;ldquo;sum the squares from 1 to N&amp;rdquo;.
We&amp;rsquo;ll compare an F# implementation with a C# implementation. First, the F# code:
// define the square function let square x = x * x // define the sumOfSquares function let sumOfSquares n = [1..n] |&amp;gt; List.map square |&amp;gt; List.sum // try it sumOfSquares 100 The mysterious looking |&amp;gt; is called the pipe operator.</description>
    </item>
    
    <item>
      <title>F# syntax in 60 seconds</title>
      <link>https://fsharpforfunandprofit.com/posts/fsharp-in-60-seconds/</link>
      <pubDate>Mon, 02 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/fsharp-in-60-seconds/</guid>
      <description>Here is a very quick overview on how to read F# code for newcomers unfamiliar with the syntax.
It is obviously not very detailed but should be enough so that you can read and get the gist of the upcoming examples in this series. Don&amp;rsquo;t worry if you don&amp;rsquo;t understand all of it, as I will give more detailed explanations when we get to the actual code examples.
The two major differences between F# syntax and a standard C-like syntax are:</description>
    </item>
    
    <item>
      <title>Introduction to the &#39;Why use F#&#39; series</title>
      <link>https://fsharpforfunandprofit.com/posts/why-use-fsharp-intro/</link>
      <pubDate>Sun, 01 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/posts/why-use-fsharp-intro/</guid>
      <description>This series of posts will give you a guided tour through the main features of F# and then show you ways that F# can help you in your day-to-day development.
Key benefits of F# compared with C#     If you are already familiar with C# or Java, you might be wondering why it would be worth learning yet another language. F# has some major benefits which I have grouped under the following themes:</description>
    </item>
    
    <item>
      <title>License</title>
      <link>https://fsharpforfunandprofit.com/about/license/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/about/license/</guid>
      <description>Text and images     All text and images copyright (c) 2012-2021 Scott Wlaschin
MIT License for code     Code copyright (c) 2012-2021 Scott Wlaschin
All code on this site is released under the free MIT License as follows:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &amp;ldquo;Software&amp;rdquo;), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</description>
    </item>
    
    <item>
      <title>Search</title>
      <link>https://fsharpforfunandprofit.com/search/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/search/</guid>
      <description>(function() {var cx = &#39;005822461080256964871:ukp7bevhyrw&#39;;var gcse = document.createElement(&#39;script&#39;);gcse.type = &#39;text/javascript&#39;;gcse.async = true;gcse.src = &#39;https://cse.google.com/cse.js?cx=&#39; + cx;var s = document.getElementsByTagName(&#39;script&#39;)[0];s.parentNode.insertBefore(gcse, s);})();</description>
    </item>
    
    <item>
      <title>Shopping cart example in C#</title>
      <link>https://fsharpforfunandprofit.com/csharp/union-types-in-csharp/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/csharp/union-types-in-csharp/</guid>
      <description>This is an appendix to the post on &amp;ldquo;designing for correctness&amp;rdquo;.
In that post, I had some requirements for a simple shopping cart. I showed some bad C# code, and some F# code that implemented the requirements easily. There are some responses that come up when a C# developer looks at the F# code, such as &amp;ldquo;why not just use an interface?&amp;rdquo; or &amp;ldquo;what about the visitor pattern?&amp;rdquo;
In this post, I&amp;rsquo;ll demonstrate why the solution is not as straightforward as you might think.</description>
    </item>
    
    <item>
      <title>Subscribe</title>
      <link>https://fsharpforfunandprofit.com/subscribe/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>https://fsharpforfunandprofit.com/subscribe/</guid>
      <description>I&amp;rsquo;m not doing a newsletter currently!</description>
    </item>
    
  </channel>
</rss>
