Cats Core
·
Part 9
Cats Core, Part 7: Eq and the Comparisons == Lets Through
Scala's == compares any two values, so a TodoId against a String compiles and returns false. Cats' Eq makes that a type error, explains why Some(1) === None fails, and lets me decide which fields count as equal.
23 Oct 2026
·
5 min read
·49 views
Cats Core
·
Part 8
Cats Core: ValidatedNec and the Real Difference Between Applicative and Monad
I wrote a tiny Todo validator with cats' ValidatedNec and it made one rule click: you can only accumulate errors when the steps don't depend on each other. That's the whole difference between an Applicative and a Monad.
18 Oct 2026
·
5 min read
·87 views
Cats Core
·
Part 7
Cats Core, Interlude: Reading fa, f and F[_]
In Part 4 I wrote map[A, B](fa: Quote[A])(f: A => B) and moved on, but the letters kept slowing me down. A short break from new type classes: two rules that decode most Cats signatures, and the one name that breaks them.
13 Oct 2026
·
6 min read
·51 views
Cats Core
·
Part 6
Cats Core, Part 6: NonEmptyChain or NonEmptyList for Validation Errors
What the Nec in ValidatedNec guarantees, why errors.toList failed to compile in my Play controller, and when NonEmptyList is the better container.
10 Oct 2026
·
6 min read
·64 views
Cats Core
·
Part 5
Cats Core, Part 5: Combining Optional Amounts with Apply and Applicative
A price and a delivery cost are both optional, and nested map gives me Some(Some(15)). Apply combines independent values into one result, and Applicative adds the starting value a whole cart needs.
10 Oct 2026
·
6 min read
·72 views
Cats Core
·
Part 4
Cats Core, Part 4: Teaching Cats to Map Our Own Types
List and Option already know how to map. I give my own Quote a Functor instance, reuse the same discount function, and trace why identity and composition matter.
8 Oct 2026
·
6 min read
·70 views
Cats Core
·
Part 3
Cats Core, Part 3: From Empty Batches to Checkout Totals
I knew how to combine two error reports. Monoid gives an empty batch a useful result, and foldMap takes the same idea to a shopping cart: turn each line into a contribution, then combine the totals.
8 Oct 2026
·
6 min read
·78 views
Cats Core
·
Part 2
Cats Core, Part 2: Teaching Cats How to Combine Our Validation Errors
I could see Validated collecting errors, but I wanted to see the method call behind it. I made its Semigroup argument explicit, then supplied a combination rule for my own structured errors.
5 Oct 2026
·
5 min read
·90 views
Cats Core
·
Part 1
Cats Core, Part 1: From Optional Fields to Useful Validation Errors
I started learning Cats Core with a small policy form. The same mapN operation first combines optional fields, then collects useful validation errors with Validated.
26 Sep 2026
·
5 min read
·105 views
Scala and the JVM
·
Part 13
Scala: Part 12: Scala Either for Java Developers - A Result or a Reason
From a Java/Spring perspective, I build Scala Either from explicit Left/Right cases to map, flatMap and a for-comprehension, with three verified lookup outcomes and failure reasons that survive the chain.
22 Sep 2026
·
6 min read
·97 views