Ben Hutchison - Getting Work Done with the Eff Monad in Scala
Автор: Compose Conference
Загружено: 2016-09-19
Просмотров: 4580
Ben Hutchinson's talk at Compose :: Conference in Melbourne, 2016.
--
This talk introduces the Eff monad via Eff-cats Scala library, and gives a sense of how use it to solve practical programming problems.
The Eff-cats library is an implementation of the Freer monad concept in Scala, developed by Eric Torreborre. It is inspired by Oleg Kiselyov's Haskell paper 'Freer Monads, More Extensible Effects' . Like Monad Transformer stacks and the Free monad, it provides an organising principle for the construction of pure functional programs. It has a number of desirable qualities:
Purity: the construction of the program is decoupled from its interpretation
Type-safety: Effects such as error handling or asychronicity are visible in the type signatures
Flexible effect stacks: the final effect stack members can be varied without unduly affecting local code
Performance: scales gracefully, as the program is stored as a Vector of continuations
Flexible evaluation: effects interpretation can be reordered without rewriting the program
This talk focuses on what code written using the Eff monad looks and feels like. It covers several common Eff 'effects' including
Using Reader effects for dependency injection
Using Either effects for error handling
State effects for stateful computation
It will also demonstrate some challenges that arise when using Eff and how to tackle them:
Adding new effects to an existing program
Mixing Eff-based and non-Eff modules together
--
http://www.composeconference.org/2016...
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: