Regaining Control with State Monad and Friends (Felix Mulder)

preview_player
Показать описание
A state transition can be modeled as a simple function:

type State[S, A] = S ⇒ (S, A)

In this talk we’ll see how indexed monads like the State Monad are built around this simple concept.

From side-effect free state modification to Finite State Machines. The State Monad is immensely useful and actually - as will be shown throughout this talk, definitely, not scary at all.

We’ll get comfortable with the state monad from the Cats library, and learn how we can write functional APIs that describe state transition on the type level using indexed monads.

Bio:
Former Compiler Engineer at LAMP, EPFL. Building the next generation Scala compiler - Dotty. Currently lambda head at Klarna in Stockholm, building purely functional things in Scala.
Рекомендации по теме
Комментарии
Автор

I'm learning functional programming with the Manning: "Functional Programming in Scala", and I just finished the purely functional state chapter. All functions that I have written Felix calls as naive :o

no_more_free_nicks
Автор

Great presentation, Felix! Wrote a naive State Monad once (I think it was a chapter in the red book), but forgot about its usefulness. So, adventofcode brought me here where the task was to decode binary packets.

flwi