I’ve heard the term “Markov chain” a couple of times but never had a look at what it actually is. Probably because it sounded too impressive and complicated. It turns out it’s not as bad as it sounds. In fact the whole idea is pretty intuitive and once you get a feeling of how things […]

# Monthly archives: December 2016

## The free monad without the boilerplate

The free monad is really neat for creating DSL as it allows to completely separate the business logic from the implementation. It leaves a great freedom for the implementation choices and should you change your implementation you just need to rewrite your interpreter without changing any of the business logic. That’s great! However after playing […]

## The free monad in (almost) real life

Now that we have a fairly good understanding of what the free monad is and how it works. Let’s see what it looks like to write a real program based on this concept. This time we won’t implement Free ourselves but use the cats library for that. If you don’t know all the theory behind […]

## The Free monad explained – part 2

Remember in part 1 we implemented a little program to interact with the user. We nicely separated the business logic from the implementation. And as good as it is we now need to add more functionality to our application and this exactly what we’re going to cover here. The idea is to define a new […]

## The Free monad explained – part 1

My next series of blog posts will be on the Free monad. Don’t be scared by the name, it’s not so difficult to grasp it (if explains correctly) and your code could greatly improve. Why ? Because it allows a clear separation between the program definition (i.e. the business logic) and its implementation. That means […]