<?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 C# Programmers on F# for Fun and Profit</title><link>https://kant2002.github.io/fsharpforfunandprofit.com/csharp/</link><description>Recent content in F# for C# Programmers on F# for Fun and Profit</description><generator>Hugo -- gohugo.io</generator><language>uk-ua</language><lastBuildDate>Wed, 01 Jan 2020 00:00:00 +0000</lastBuildDate><atom:link href="https://kant2002.github.io/fsharpforfunandprofit.com/csharp/index.xml" rel="self" type="application/rss+xml"/><item><title>Shopping cart example in C#</title><link>https://kant2002.github.io/fsharpforfunandprofit.com/csharp/union-types-in-csharp/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://kant2002.github.io/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></channel></rss>