All Posts

Scala Central: Functional Design Patterns in Scala

Video recording of a talk I gave on functional programming at a Scala Central meetup.

Functional Design Patterns in Scala: 2. Lenses

Case classes provide a convenient way of working with immutable objects in scala. Manipulating fields within them can be tedious, however. In this post, we will look at how lenses can be used to abstract over this complexity while preserving the benefits of immutability.

LCD Digits Kata with Scala

I recently attended one of the coding dojos run by the London Scala User Group. It was great fun, and I’d recommend getting involved to anyone who’s interested in meeting other developers and learning more about scala and functional programming. After breaking into groups, we set about tackling the ‘LCD Digits’ problem from cyber-dojo.org. Although fairly straightforward as a programming challenge, it offers a number of ways to experiment with different functional idioms. The goal is to write a program that takes an integer, and formats this as a string composed of the ‘.’, ‘_’, “|’ and ” ” characters so that the output resembles an LCD display.