Conceptualizing Map and FlatMap

I originally wrote this post for my friend Andrew's learning scala blog Scala Eye for the Java Guy. Reposting here to have it on my archives as well. A couple very minor edits only, and I've posted this with the same date as the original post.

Read More

Scala Options and Sudoku

Scala Options are a nice alternative to null values. They force us to consider the None case explicitly, rather than hiding in documentation, for example, the fact that a method can return null in some circumstances. They also tie in nicely to chained behavior, so that a sequence of operations that produce a None along the way can collapse to just the None, similar to constructs such as Groovy’s elvis operator ?:.

Read More