Advent of Code is an online Advent calendar where you have to solve two small programming puzzles, of increasing difficulty, every day from December 1st to the 25th.

Last year, I solved most of the problems using Rust. The challenge for this year is to use a different programming language every day, based on Tsoding.

You can find my solutions on GitHub:

For the first 5 days I decided to use functional programming languages (mostly).

Day 1 - Haskell

Day 2 - Ruby

Day 3 - OCaml

Day 4 - Scala

Day 5 - Erlang

This first week turned out to be quite a challenge. I had never before programmed using Haskell, OCaml, Scala nor Erlang.

My solutions probably aren’t the most elegant ones out there, but I managed to get away without using the imperative features of these languages.

And I learned a few new things along the way, such as:

  • List comprehension
  • Partially applied functions
  • Pattern matching
  • Tail recursion

I’m looking forward to get better at functional programming languages in the future.