Haskell for Scala Developers: Part 4 — Objects and Modules

Here's a thesis worth defending: most of Scala's object-oriented machinery is answers to questions Haskell never asks. Inheritance, trait linearization, the five different places a definition can live, private and its dozen qualifiers: a lot of it exists to manage complexity that a language built on data and functions doesn't generate.

That's the spicy half. Here's the fair half. OOP was solving four real problems: polymorphic dispatch, code reuse, modularity, and controlled mutation with encapsulation. Every language needs answers to those. Haskell doesn't ignore them. It answers each with something smaller and more honest than a class hierarchy, and I think the smaller answer is usually the better one. Where Scala's version earns its keep, I'll say so; it does in two or three places.

I'll use one running example throughout: a notification service. It's the classic OOP teaching object, with a polymorphic send, a hierarchy of channels, mixins that add retry and rate-limiting, and a private counter tracking deliveries. If you've sat through an "intro to OOP" course, you've written this exact class. We'll watch it dissolve into a handful of data types and functions, and I'll argue that what's left is what you actually wanted.

Haskell for Scala Developers: Part 3 — Effects and Concurrency

IO is a Monad in both Scala and Haskell, and do { line <- getLine; putStrLn line } is the same shape as for { line <- IO.readLine; _ <- IO.println(line) } yield (). This post starts there, with the part of the language that made half the Scala community pick up Cats Effect in the first place.

My thesis: Cats Effect's IO is Haskell's IO, ported to the JVM. Ported, not "inspired by." The referential transparency, the lazy description of a computation, the run-it-at-the-edge model, bracket, Ref, race, fibers: all of it is the Haskell IO programming model rebuilt on a runtime that wasn't designed for it. Once you delete Future from your mental model, the distance between a Cats Effect program and the equivalent Haskell program is mostly tooling and syntax.

ZIO is where that story gets more interesting, and it's why I asked to cover both. ZIO's ZIO[R, E, A] is a different bet: it folds the environment and the error type into the effect type itself. Haskell makes the same bet but spreads the pieces across different tools: ReaderT for the R, ExceptT or plain exceptions for the E, and increasingly an effect-handler library (effectful, polysemy, fused-effects) when you want the whole thing in one place. Same problem, split up differently, with real trade-offs on both sides.

The plan: why Future is the thing to delete, what treating IO as a value buys you, how errors become just another effect, resource safety, shared state, structured concurrency with a worked example, and finally ZIO against Haskell's MTL. I'm leaving streaming for its own post, because fs2 and ZIO Streams against conduit and streamly deserves the room.

Haskell for Scala Developers: Part 2 — Type Classes and Implicits

Scala does functions, ADTs, options, and newtypes well, and Haskell does them slightly better. The gap is small. With type classes, it gets wide.

I think the origin story of Scala implicits gets understated. We use them to thread context through our code, but that's not what they're for. Implicits were Scala's way of doing the work of Haskell's type classes in a language that doesn't have them. Wadler and Blott published the original Haskell type-class paper in 1989; Odersky designed Scala's implicit-parameter machinery explicitly so the same shape of code could be written on the JVM. The mechanism was reverse-engineered from the Haskell feature it was meant to imitate.

Scala 3's given / using is the cleanup. After every incoherence horror story the community has collected, the language renamed the keywords, narrowed the resolution rules, and tried to hide the implicit-conversion traps that were eating juniors alive. It's much better than what it replaced, and it's still trying to be something Haskell already is.

This post is about what you get when the feature is native: less ceremony, fewer traps, no implicit-conversion magic, and instance coherence by default. We'll start with the simplest case (Eq, Show, Ord, same words and same job in both languages), then cover resolution and coherence, the type-system feature both languages had to invent for this (HKTs), the Functor/Applicative/Monad ladder on our own type, and finally deriving. I'll assume you can read Cats fluently, so I won't re-teach the abstractions.

Haskell for Scala Developers: Part 1 — Functions and Data

The usual way to write this kind of post is a feature-by-feature comparison table, with checkmarks and a sentence per row. I'm skipping that. Instead I'll take the parts of Scala you already write idiomatically (case classes, sealed traits, Option, Either, the occasional extends AnyVal for a typed id) and show what happens when the language stops apologizing for them.

Most of what made me love Scala is exactly what Haskell gives you, minus the JVM cost, the OOP escape hatches, and the long-running argument inside the Scala community about what good Scala even looks like. If you want the longer version of why I'm writing this at all, it's in The Rise and Fall of Scala.

This part is the easy one: functions, data, pattern matching, options, and newtypes, all things you already type twenty times a week. The translation is mostly mechanical. What's interesting is the handful of frictions that disappear when the language stops compromising on them.

Haskell Was Waiting for This

Every few months someone announces "the best language for AI." Usually it's Python, sometimes TypeScript, occasionally Rust when the mood is right. My claim is less fashionable: if you ship code an LLM helped you write and you want to be confident it works, Haskell is the best fit in 2026.

It's not the trendiest choice, and it's not the easiest to hire for. I still think it fits best. Here's why.