Paweł Szulc - GETTING MORE MILEAGE FROM YOUR MONADS WITH MTL

preview_player
Показать описание
MTL stands for Monads Transformers Library, but it has barely little in common with monad transformers. Well that's confusing, right? To be honest, in the ancient times, in some long forgotten, prehistoric version of Haskell, MTL was a library holding monad transformers - but those times are long forgoten.
In a nutshell, MTL provides set of abstractions (defined as typeclasses) over many useful patterns that can be applied to types. This allows to write a lot more generic & maintainable code, with noticeably less amount of boilerplatte. MTL brings a a breath of fresh air to pure FP projects that heavly rely on effectful computations closed over monads.
Intrigued? Confused? Or maybe both? You should see my talk, it will be fun & instructive.
Рекомендации по теме
Комментарии
Автор

Isn't there a better way to get around the conflict between MonadError and MonadState without copy pasting?

lobomeister
Автор

Worth noting that instead of writing a partial clone of `MonadError`, you can ditch the syntactic sugar and just call a method on the instance you want (e.g. `merr.point(StatusReport(true, 0)`) - but of course it'll make it impossible to use for comprehensions there.

jk____