Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Eric Torreborre
The Eff monad
One monad to
rule them all!
It must be evident how multifarious
and how mutually complicated are
the considerations which the working
of such an engin...
You could have
invented monads!
Exceptions?
Exceptions?
State?
State?
Genius!
Can we have both state and error?
First idea: stack them!
1996!
Which order?
DOES NOT WORK!
THIS ONE WORKS!
DIFFERENCE?
DIFFERENCE?
DIFFERENCE?
ORDER IS
IMPORTANT!
GENERALISE
STACKING HAS A COST!
SIMILAR EFFECTS?
IN PRACTICE
Specialized stacks
Specialized functions
WHAT IF?
We need to use both Hadoop and S3?
WHAT ELSE?
WHAT ELSE?
Type-
level
effects
Eff monad
Value-
level
effects
Continuatio
nsInterpreters
Member
typeclass
Effect
Type-level
effects
Value-level
effects
Value-level
effect
Continuations
Option
Interpreter
State
Interpreter
Continuation1
Continuation2
Option
Interpreter
Continuation3 +
State
Interpreter
OPTION RELOADED
KLEISLI
OPTION AS EFFECT
EFF
ERROR AS EFFECT
NEVER RE-IMPLEMENT
flatMap
EVER AGAIN!
EFFECTS UNITE!
Type-level
effects
Value-level
effects
Value-level
effects
Member
typeclass
LIBRARY
scalaz.Future
STACKOVERFLOW
:-(
STACK SAFE
TRANSFORM
EFFECTS
SO, SILVER
BULLET?
SORRY
NO
Implicits
Implicits
Use it in prod'
Renamings
Check laws
Missing functions
Benchmarking, Scalajs...
CREDITS
LINKS
Monads for functional programming
Monad transformers and modular interpreters
Extensible effects
Reflection without ...
THANKS!
Matchers
Matchers
Matchers
Matchers
MORE
TROUBLE
List(5, 7, 1)
TOO BIG?
ONE MORE ERROR LAYER!
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
The Eff monad, one monad to rule them all
Upcoming SlideShare
Loading in …5
×

The Eff monad, one monad to rule them all

4,523 views

Published on

The Eff monad is an alternative to monad transformers. It is implemented as a library in https://github.com/atnos-org/eff-cats and https://github.com/atnos-org/eff-scalaz

Published in: Technology
  • Be the first to comment

The Eff monad, one monad to rule them all

  1. 1. Eric Torreborre The Eff monad One monad to rule them all!
  2. 2. It must be evident how multifarious and how mutually complicated are the considerations which the working of such an engine involve. There are frequently several distinct sets of effects going on simultaneously; all in a manner independent of each other, and yet to a greater or less degree exercising a mutual influence. Ada Lovelace, 1842
  3. 3. You could have invented monads!
  4. 4. Exceptions?
  5. 5. Exceptions?
  6. 6. State?
  7. 7. State?
  8. 8. Genius!
  9. 9. Can we have both state and error?
  10. 10. First idea: stack them!
  11. 11. 1996!
  12. 12. Which order?
  13. 13. DOES NOT WORK!
  14. 14. THIS ONE WORKS!
  15. 15. DIFFERENCE?
  16. 16. DIFFERENCE?
  17. 17. DIFFERENCE?
  18. 18. ORDER IS IMPORTANT!
  19. 19. GENERALISE
  20. 20. STACKING HAS A COST!
  21. 21. SIMILAR EFFECTS?
  22. 22. IN PRACTICE
  23. 23. Specialized stacks
  24. 24. Specialized functions
  25. 25. WHAT IF? We need to use both Hadoop and S3?
  26. 26. WHAT ELSE?
  27. 27. WHAT ELSE?
  28. 28. Type- level effects Eff monad Value- level effects Continuatio nsInterpreters Member typeclass
  29. 29. Effect
  30. 30. Type-level effects Value-level effects
  31. 31. Value-level effect Continuations
  32. 32. Option Interpreter State Interpreter Continuation1 Continuation2 Option Interpreter Continuation3 + State Interpreter
  33. 33. OPTION RELOADED
  34. 34. KLEISLI
  35. 35. OPTION AS EFFECT
  36. 36. EFF
  37. 37. ERROR AS EFFECT
  38. 38. NEVER RE-IMPLEMENT flatMap EVER AGAIN!
  39. 39. EFFECTS UNITE!
  40. 40. Type-level effects
  41. 41. Value-level effects
  42. 42. Value-level effects
  43. 43. Member typeclass
  44. 44. LIBRARY
  45. 45. scalaz.Future
  46. 46. STACKOVERFLOW :-(
  47. 47. STACK SAFE
  48. 48. TRANSFORM EFFECTS
  49. 49. SO, SILVER BULLET?
  50. 50. SORRY NO
  51. 51. Implicits
  52. 52. Implicits Use it in prod' Renamings Check laws Missing functions Benchmarking, Scalajs...
  53. 53. CREDITS
  54. 54. LINKS Monads for functional programming Monad transformers and modular interpreters Extensible effects Reflection without remorse Freer monad, more extensible effects
  55. 55. THANKS!
  56. 56. Matchers
  57. 57. Matchers
  58. 58. Matchers
  59. 59. Matchers
  60. 60. MORE TROUBLE
  61. 61. List(5, 7, 1)
  62. 62. TOO BIG?
  63. 63. ONE MORE ERROR LAYER!

×