Skip to content
0:00 / 0:00

#freemonad#interpreterpattern#typelevel

A Year living Freely – Chris Myers

Typelevel

2.6K subscribers • 8 videos on Hallway

YouTube

Intermediate. Assumes working knowledge.

7.7K views10 years ago2 recommendations

Software designProgramming languagesScalaFunctional programmingDesign patterns

Chris Myers shares his team's experience adopting the Free monad and interpreter pattern in Scala to decouple pure functions from effects.

The Free monad and the Interpreter Pattern has gained significant interest in the Scala community of late. It is a pattern that has helped unlock the problems of separating pure functions from effects. At REA Group we have had an explosion of interest in FP and Scala in the last two years. Beginning with just a couple of experienced functional programmers to now multiple teams and dozens of developers, we have experienced the growing pains of introducing FP and Scala to a large organisation. The Free monad has been a key element in our journey. As we grew, we were particularly conscious of what patterns we could lay down, especially for beginners, that promoted the integral values of FP such as referential transparency and to allow obvious ways that software should grow. After many experiments and much research, we discovered that the Free monad and interpreter pattern has been something that tangibly isolates effects, maintains referential transparency, subsumes dependency injection, is modular and is surprisingly accessible to FP/Scala new comers. This talk briefly covers the mechanics of the Free monad and the interpreter pattern but largely looks at how a year with the Free monad has allowed us to make novice teams productive while they learn and embrace FP and Scala. * Material * Slides: github.com/cwmyers/talks/raw/master/typelevel-summit-oslo-20… Code: github.com/cwmyers/event-stream-api * Event * Typelevel Summit Oslo, May 2016: typelevel.org/event/2016-05-summit-oslo/ * About Speaker * Chris is an experienced FP/Scala dev working at REA Group, Australia's largest Property website. He uses Scala daily in building the next generation APIs for our business. He also curates functionaltalks.org and is the creator of Monet.js (cwmyers.github.io/monet.js/), a powerful monad library for JS. * Licensing * This recording is licensed under CC-BY 4.0 (creativecommons.org/licenses/by/4.0/).

Why it's here

2 people recommend this

What people say. Recommended as an engaging talk on how the Free monad helps decouple independent parts of a system and minimize the cost of change.

u/joshlemerin r/scala • Recommends

A Year living Freely - Chris Myers -- A talk about the Interpreter Pattern at Typelevel Summit Oslo, May 2016

u/kritzcreekin r/haskell • Recommends

On “How do I get up to speed with the Free approach?”

Are you sure you are not looking at Free strictly from the library perspective here? One of the most engaging talks I've seen in the last couple of months is Chris Myrs talking about how Free allowed them to decouple independent parts of their system and minimize the cost for change. I'm sure you understand the technical implications a lot better than I do, but maybe Free's scope is more of a architectural / organizational one?

u/xalyamain r/scala • Mentions

On “Must watch talks ?”

I really liked this talk on free monads.

u/Duraluminin r/scala • Mentions

On “Is there an "easy" way to write effectful programs in a functional way?”

I wouldn't use the word "can't". Certainly it takes time to create some sort of clean wrapper, it's difficult to magic that away. And if you're dealing with clients/management who believe in deadlines above all else, and never spare time for refactoring, code debt, etc., the code is probably going to end up looking horrible, no matter what. But if you're looking for actual case studies showing that free monads can be used in a pragmatic way to handle business logic, see link to this video for one example (and they seem fairly happy with the results).