Electrifying Norway with F# and DDD

Almir Mesic

Experience Report

Imagine inheriting a large C# legacy codebase for electrical transmission line modeling software. It desperately needs love. Where do you start? What would happen if you rewrote its core parts to F# with Domain-Driven Design in mind?

It turns out that Units of Measure, Expressions-only syntax, Immutability, and Exhaustive Pattern Matching are incredibly useful features of F#. Combined with Domain-Driven Design (DDD), strongly typing your domain with Algebraic Data Types in F# has never been easier.

Join me as I take you through our rewriting journey with specific examples. There was some agony involved, but it was mostly pure fun!