Third part of the series: we define the persistence contract with a generic trait, implement two adapters (in-memory and JSON to disk), and delve into the difference between interface and implementation as the axis of hexagonal architecture.
We explore in detail what typeclasses are, how to define them in Scala 2, and how they are implemented in other languages such as Haskell and Rust. Through practical examples, we demonstrate how to model behaviors clearly and scalably using this powerful design pattern in functional programming. We also discuss automatic derivation and the improvements Scala 3 brings to this area.
We analyzed different functional pattern designs to address the abstraction of a functionality and its implementation.
My first impressions of Rust from a functional programming background (Scala and Haskell). A mix of excitement, frustration, and a paradigm shift in thinking.