Folding Away Mutations in F#

I’ve been working in F# lately, and one of its smaller features has had a big impact on my programming style: Variables are immutable by default. If you want to change something, you have to declare it mutable. Sometimes, this is what I naturally reach for, and the language rubs my nose in it.

Here’s a story of one of those instances, and a new pattern I’ve picked up as a result. Read more on Folding Away Mutations in F#…

TDD in a REPL

REPLs (Read-Eval-Print-Loops) are often billed as a great place to experiment and learn a language or a framework. They provide a very tight feedback loop. However, it can be difficult or time-consuming to extract the knowledge gained from a REPL and include it in your source code. I’ve hit the up arrow many times in Ruby’s pry, trying to find the specific input I wanted to copy. And don’t get me started on dealing with multi-line input. Thankfully, the developers behind F# came up with a clever way of dealing with this problem. Read more on TDD in a REPL…