Please log in to watch this conference skillscast.
Functional programming is on the rise; monads are everywhere. But how to choose the right wrapper for the values which we manipulate (i.e. monad)? Quite often, the answer is far from obvious, and it’s useful to delay the decision as much as possible. Furthermore, picking a particular monad too early might only obscure important business logic details.
There are (at least) two ways to solve the problem, which are quite popular: free monads and the tagless final encoding. Both are equivalent in expressive power, but are radically different when it comes to code.
In this live-coding talk, you will learn how to transform a simple application which relies on
Futures into more generic forms, using either the free monad or tagless final. You will discover how these two representations compare in terms of boilerplate, readability, composability and stack-safety. You will also explore which approach might be a better fit for selected use-ca
YOU MAY ALSO LIKE:
- sttp: the Scala HTTP client that you always wanted! (SkillsCast recorded in September 2017)
- Fast Track to F# with Tomas Petricek & Phil Trelford (in London on 9th - 10th September 2019)
- Lightbend Scala Language - Professional (in London on 9th - 10th September 2019)
- Haskell eXchange 2019 (in London on 10th - 11th October 2019)
- Clojure eXchange 2019 (in London on 2nd - 3rd December 2019)
- Hands-on: Fractal art with Fable and WebGL (in London on 20th June 2019)
- Keynote by Dick Wall on Why API Design Matters, and Why Yours Sucks! (and mine sucks too!) (in London on 24th June 2019)
- The Elements of Tagless Final Style (SkillsCast recorded in May 2019)
- Scala 2.13 and Beyond! (SkillsCast recorded in April 2019)
Free Monad or Tagless Final? How Not to Commit to a Monad Too Early
Adam is one of the co-founders of SoftwareMill, a company specialising in delivering customised software solutions. He codes mostly on the back-end using Scala and other interesting technologies. Adam created a couple of open-source projects, such as sttp, MacWire, Hibernate Envers and ElasticMQ. He has been a speaker at major conferences, such as Devoxx, JavaOne, LambdaConf and ScalaDays.