Flattening Scala Play Controllers with For Comprehensions and Eithers

It's been a little over a year since I've started programming in Scala professionally - so I wanted to come back to this blog and focus on a Scala centric post with some real world application.

I have found that some of the Play controller code I need to write can get very pyramid-shaped in nature, since most of the steps that interact with IO return options, which need to send sensible error messages back to the client in the case of `None`. Let's take a look at a contrived example function:

Read More

Pattern Matching in Elm

One of the great things about some functional programming languages is pattern matching. At its core, it is a way to deconstruct the elements of your program and to do something meaningful with said deconstruction. In this blog post, I'm going to demonstrate how to create a singly linked list and a few functions that operate on it using the language, Elm.

Read More