Why is Monoid?
January 7, 2022
Monoid is fairly easy to understand, even if you’re just starting out in functional programming. First, you need to understand what a Semigroup is. The Cats definition is very accessible:
A journal of my peripatetic journeys in code
January 7, 2022
Monoid is fairly easy to understand, even if you’re just starting out in functional programming. First, you need to understand what a Semigroup is. The Cats definition is very accessible:
June 11, 2021
A few times I’ve fallen into the trap of making incorrect assumptions about what a type is based on how I read it in my head. Most recently, this happened with the asRight and asLeft wrappers of cats.Either.
March 12, 2021
The name of flatMap might trick you into thinking that it is the same as flatten followed by map. But it’s exactly the other way around: it’s map followed by flatten.
March 2, 2021
According to the documentation for java.nio.ByteBuffer.wrap(array):
February 11, 2021
Say you want to implement a function add1 that takes a list of integers and adds 1 to each one, so that:
January 24, 2021
I recently realised that ambiguous argument naming has been a major obstacle for me building intuition about how foldRight works in Scala.