State monad recap We've seen previously that the state monad can be used to create...
Background Previously, we learned about applicative functors, which are souped-up functors...
Arithmetic expressions Let's say we want to represent a simple arithmetic expression in C#...
Side effects Side effects are impossible to avoid in imperative code, but they can make re...
This is a primer on implementing stateful computations in F# without violating functional purity....
If you dabble in Haskell or category theory, you might have heard of "free monads". But what exactly...
Recap In a previous article, we saw how to emulate first-class polymorphism by encapsulati...
As we discussed last time, an existentially quantified type is one that contains a hidden implementat...
Emulating first-class polymorphism Last time, we talked about universally quantified types...
Generic types Generic types in C# are universally quantified. That means, for example, tha...
GeoPoint Consider a class that represents a point on the surface of the earth, with the fo...
Domain model classes Object-orientation is great when classes represent actual domain mode...
Functional programming relies on pure functions, which have no side-effects and always return the sam...
Last time, we investigated double negation in the Curry-Howard correspondence. We found that we can c...
Let's take a look at another interesting aspect of the Curry-Howard correspondence using C#....
Improved syntax The composableCombiner function that we ended up with last time works fine...
When we left off, we had created a mechanism for applying multiple arbitrary functions to a sequence...
Sequences F# sequences have some interesting behavior. Because they are "lazy", the elemen...
Functors are a popular topic in the functional programming world1, but some of what's been written is...
This is a follow-up to my first article on the Curry-Howard correspondence. As before, all examples w...
Inspired by a blog post by Eirik Tsarpalis. Let's write a small F# function that safely takes the sq...
A power series is characterized by an infinite list of coefficients of powers of a variable, x: a₀...
F# sequence expressions are a great way to generate data in a loop. A simple sequence expression like...
It sounds crazy, but every time you instantiate a type in C#, you are proving a logical proposition....
F#'s pipe operator |> lets you chain function calls together easily: let car = Car.create Re...
If you're coming to F# from an object-oriented language like C#, you might be tempted to continue enc...
Normal functors in Haskell are pretty easy to understand: class Functor f where fmap :: (a ->...
I'm an F# developer reading a book called A Type of Programming, which is about Haskell and type theo...