Bruno Ribeiro asked a great question about the practical uses of monads. Are they useful? Why are they used so much in Haskell? In this episode, we briefly go over the history of monads in Haskell and how they allow you to do imperative programming in a pure functional language.
Thoughts on Functional Programming Podcast
An off-the-cuff stream of Functional Programming ideas, skills, patterns, and news from Functional Programming expert Eric Normand.
Subscribe on iTunes, Google Play Music, Overcast, or via RSS.
Where does structural similarity come from?
In a recent episode, I said structural similarity comes from the algebraic properties of the relationships between things. But that’s not the case. Rotislav mentioned in the comments that it actually comes from the structure in the relationships. I explore that idea in this episode.
Do you need immutability for functional programming?
Of course immutable data structures are great, but are they necessary for FP? Short answer is: no. There’s a lot of functional ideas and perspectives that can be applied even if you don’t have them. And you can always make things immutable through discipline. In this episode, we explore those two ideas.
Algebra is about composition
When we look at the definitions of algebraic properties, we often see that we are defining how things compose. This is one of the main advantages of using algebraic properties to constrain our operations. If we define how they should compose before we implement them (as a unit test, for instance) we can guarantee that things will compose.
What do product and sum types have to do with data modeling?
Product and sum types allow us to exactly model any number of states with a lot of flexibility.
Can you have a clean domain model?
I was asked a great question by a listener about whether it’s always possible to find a good domain model. Sometimes, the business rules are so messy, how can we find something clean and stable? In this episode, I explore how we can find a stable and clean domain model within the chaos.
What is abstraction?
We use the term ‘abstraction’ all the time. But what does it mean? If it’s such an important concept, we should have a clear idea of its meaning. In this episode, I go over two related definitions from two important sources.
Why does stratified design work?
Stratified design is one where you build more specific things on top of more general things, typically with many layers. But why is this powerful? In this episode, we explore why it’s sometimes easier to solve a more general problem than a specific one.
Why are algebraic properties important?
We often write software to automate an existing physical process. But what makes this possible? When translating from physical to digital, something must be preserved. In this episode, we look into what is preserved across that translation and why algebraic properties might help us find it.