Past Meetup

Explaining Folds to Yourself & Isolating Side Effects with Monads

This Meetup is past

44 people went


This month features two beginner level talks from Tony Morris and Ben Kolera to help kickstart your FP understanding and interest just in time for Lambda Jam. :)

Explain List Folds to Yourself

Tony Morris

Many introductions to functional programming discuss the fold functions on lists. There is fold-left and fold-right, followed by attempts to develop an intuition on how to understand, internalise, then exploit these functions as necessary. Such attempts use concepts like "folding from the right or left", but this can often lead to even more confusion, because it is not entirely accurate.

In this talk, I will explain to you how list folds work using an explanation that is very easy to understand, but most importantly, without sacrificing accuracy. After I have convinced you about how to explain list folds to yourself, I will then further convince you that you should always use this explanation on others. You should then be able to deploy these functions as necessary on your own by appealing to this easy, accurate explanation.

As a minimum, you will be expected to have some simple introduction to the existence of list folding. If you know these functions exist, but you are totally confused about what they mean, then this talk is for you.

Isolating Side Effects with Monads: A brief tour of the Reader / Writer & State Monads

Ben Kolera

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.


Go to Attendee List