The Heavy-Duty Archaeology of galando/scala99

How a decade-old Maven project reveals the 'Enterprise' roots of modern functional programming.

• View on GitHub • More from galando

A black and white ink illustration of a steampunk mechanical excavator unearthing a glowing geometric crystal, representing heavy Java tooling extracting elegant Scala logic.
Extracting functional elegance using industrial-era build tools.

Key Takeaways

The Accidental Time Capsule

Most GitHub repositories dedicated to the "99 Scala Problems" are lightweight collections of scripts. They prioritize functional purity over architectural scaffolding. The galando/scala99 repository takes a completely different path. It is a frozen snapshot of how functional programming was integrated into enterprise environments circa 2013.

A quick glance at the file tree reveals something unusual for a modern functional project: a pom.xml file, an .idea directory, and a fully populated target folder. The inclusion of compiled .class files makes this repo an accidental time capsule. It allows us to examine exactly how the Scala 2.11 compiler translated elegant functional primitives into rugged JVM bytecode.

Scala Through a Maven Lens

Today, Scala developers default to tools like SBT or the modern Scala CLI. These tools are designed around the language's specific needs. In 2013, Scala was still fighting for legitimacy in corporate Java shops. To survive, it had to wear the uniform of the enterprise.

A massive ornate Victorian filing cabinet with tiny sleek drawers, representing the heavy XML configuration required to house simple functional logic.
The heavy machinery required to run simple list recursion in 2013.

The pom.xml file in this repository is a masterclass in adaptation. It explicitly silences the default Maven Surefire plugin, routing all testing duties to the scalatest-maven-plugin. This heavy XML configuration highlights the friction early adopters faced. They had to construct massive architectural scaffolding just to evaluate simple recursive functions.

Feature2013 'Industrial' ApproachModern 'Cloud-Native' Approach
Build ToolMaven (pom.xml)Scala CLI or SBT
IDE ConfigChecked-in .iml filesBloop / BSP integration
ExecutionCompiled .class artifactsIn-memory .sc scripts
CompilerScala 2.11Scala 3 (Dotty)

The Anatomy of a Fold

The core logic lives in Solutions1To10.scala. The author tackles the first ten list manipulation problems using strict pattern matching and functional combinators. The transition from manual recursion to higher-order functions is visible in the implementation of flatten.

def flatten(list: List[_]) : List[_] = list flatMap {
  case xs: List[_] => flatten(xs)
  case x => List(x)
}

This snippet is elegant, but the repository also reveals the manual labor of early functional learning. For example, the isPalindrome function avoids the trivial list == list.reverse solution. Instead, it manually deconstructs the list by comparing the head to the last element, recursively chewing through the data structure.

How recursive pattern matching flattens a deeply nested list structure.

The Red-Green-Refactor Guardrails

The most compelling architectural choice is the use of Tests1To10.scala as the definitive requirements document. Rather than printing outputs to a console, the project utilizes ScalaTest's FlatSpec.

This transforms the repository from a static list of answers into a dynamic coding kata. The tests provide a Behavior-Driven Development (BDD) scaffold. Developers can clone the repository, delete the logic in the main file, and use the failing tests to guide their own implementations.

While modern platforms like Scala Exercises offer this interactively in the browser, galando/scala99 provides the bare-metal experience. It forces the developer to engage with the compiler, the build tool, and the test runner simultaneously. It is a reminder that mastering a language means mastering its environment.