Isolating Side Effects with Monads: A brief tour of the Reader / Writer & State Monads
This talk largely follows on from Katie's talk last month, examining three monads that are extremely useful for modelling traditionally imperative things in purely functional code.
We'll explore a very imperative piece of scala code and refactor it gradually around the reader, writer and state monads until we're left with a purely functional piece of code. During this exploration we'll also stumble on the fact that nested monads aren't very fun and show how monad transformers make our lives easier. Finally by examining some of the helpful machinery that can be written abstractly around the monad typeclass (rather than each and every flatmappable thing), we'll hopefully convince ourselves again that this weird and wonderful monad concept is a Good Thing™.
This talk will be aimed at a beginner level, so don't fret if you have never heard of these things or programmed in Scala before. This talk will be done at a deliberately slow pace to let it all sink in.