Functional Programming

This category contains 3 posts

Exploring Scala Options

About Scala options Scala Option is a very convenient way to deal with objects that may not be defined. Most languages tend to represent an undefined object as null, leading to all kinds of null-checking code, and uncaught NullPointerExceptions. In fact, null is such a bad idea that its inventor, Tony Hoare, called it his … Continue reading

Scala, SBT, IntelliJ, and Play! project as a child project

Motivation I’ve spent the last few days figuring out ways to organize a new Scala project, built using SBT, with IntelliJ IDEA 13.0.1 acting as the IDE of choice. The project structure is composed of a REST API implemented using a Play! Framework and a separate JSF UI project that will make calls to the … Continue reading

Scala List.mapWhile

Earlier today I needed to apply a map function to a list for as long as a predicate was satisfied; once the predicate was false, I need the map function to bail. I was somewhat surprised to find Scala has no built-in method to accomplish such a task. The easiest method would be to use … Continue reading