functional programming

Functional error handling in Scala

Because functional programming is like algebra, there are no null values or exceptions. But of course you can still have exceptions when you try to access servers that are down or files that are missing, so what can you do? This lesson demonstrates the techniques of functional error handling in Scala.

Scala: What do “effect” and “effectful” mean in functional programming?

Table of Contents1 - Effects are related to monads2 - Not a side effect, but the main effect3 - Effectful functions return F[A] rather than [A]4 - Summary5 - Notes

When you get started with functional programming (FP) a common question you’ll have is, “What is an effect in functional programming?” You’ll hear advanced FPers use the words effects and effectful, but it can be hard to find a definition of what these terms mean.

Functional Programming in Scala for Beginners

I see some crazy/weird critics in the world. I’ll skip the details, but yes, Functional Programming, Simplified is for beginners who are new to functional programming (FP). I wrote it because I thought many other current FP books were too hard to read, and I wasted a lot of my own time with those poorly-written resources. (Frankly, when I see that something is poorly written it makes me think that the author either doesn’t care about his readers, or doesn’t understand the subject well enough to explain it well.)

I guess I could have named my book Functional Programming in Scala for Beginners, but the key thing for me is that if you want more people to learn FP — which should be a positive thing — you need to break it down into smaller components, as I have done. The book isn’t perfect, and I hope the next edition is better, but it seems to be helping a lot of people, so I’m happy about that.

Functional programming leads to happiness

As I wrote in Functional Programming, Simplified, functional programming can lead to happiness (and sanity). The quotes in this slide from Rúnar Bjarnason’s FP talk expand on what I wrote in my book. They keys are that pure functions are very simple, and you don’t have to constantly worry about the mutable state in your application.