The Heavy-Duty Archaeology of galando/scala99
How a decade-old Maven project reveals the 'Enterprise' roots of modern functional programming.
- The repository serves as a historical artifact showing how Scala was forced into rigid Maven architectures to gain enterprise legitimacy.
- Accidentally preserved compiled bytecode and IDE configurations offer a rare look at the friction early functional adopters faced within the JVM ecosystem.
- The project uses ScalaTest's FlatSpec to transform static logic problems into a dynamic, test-driven development kata.
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.
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.
| Feature | 2013 'Industrial' Approach | Modern 'Cloud-Native' Approach |
|---|---|---|
| Build Tool | Maven (pom.xml) | Scala CLI or SBT |
| IDE Config | Checked-in .iml files | Bloop / BSP integration |
| Execution | Compiled .class artifacts | In-memory .sc scripts |
| Compiler | Scala 2.11 | Scala 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.
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.