Functional programming divides the world into actions, calculations, and data. Actions are hard to test by definition, and we explore why.
Thoughts on Functional Programming Podcast
An off-the-cuff stream of Functional Programming ideas, skills, patterns, and news from Functional Programming expert Eric Normand.
A few episodes ago I talked about how things compose. But I didn’t get into how things compose across domains. For instance, how do actions compose with calculations? Let’s get into that, and what it reveals about our work as functional programmers.
People often say that functional programming is a “declarative paradigm”. I push back against that categorization. I simply think the word is mostly meaningless.
I have talked about the difficulty of typing certain JSON values coming from some APIs. The JSON is just very complicated. When I do that, I often get this question “how can you work with a JSON value if you know nothing about it?” The question is rhetorical. Of course you can’t do anything if you know nothing about it. But we do know a ton! We just can’t (or it’s very difficult to) encode what we know as a type.
Dan Friedman’s The Little Typer is coming out in September. I’m very excited about this book. It’s about dependent types, and it claims to “demonstrate the most beautiful aspects”. I can’t wait!
I wrote my interpretation of Rich Hickey’s keynote. I called it “Clojure vs the Static Typing World”. However, I missed something very big. I missed that he talked about how common it was to have lots of sub-solutions and partial data. I expand on that idea here.
People often ask ‘what are the design patterns of functional programming?’ A common answer is that categories from category theory, like monads and functors, are the design patterns. But is that true? I explore the consequences of that answer.
People often say that functional programming is more expressive. But how does FP achieve that? The key is by making things first-class.
Pure functions have no effect besides returning an immutable value. If that’s true, then how can we use them to represent changing state?