Blazing Fast, Pure Effects without Monads
summary
Claims that Kleisli arrows (a Clisly IO) beat monadic IO on the JVM by fusing impure calls and avoiding allocations. Uses Scala on the JVM with Scalaz 8 ideas and compares to Future, Monix, Cats Effect; earlier Futures are ~100x slower, monadic effect libs push that down but cannot improve much more, while the arrow-based implementation shows roughly 2x speedup over the fastest effect monads. Implements an impure constructor and benchmarks (10k array fill, 10k-element bubble sort) that run and validate the performance gains.
AI-written summary · about
chapters (49)
- 0:00Introduction
- 2:37Functional Programming
- 3:22Totality
- 6:38Type Reasoning
- 12:02What are Monads
- 13:05IO Monad
- 14:13Do Notation
- 14:39Unsafe Performing
- 16:17Single Statement Program
- 16:45Why is that a problem
- 18:25Future vs Monads
- 20:16Solution
- 20:49Kleiss Li Arrows
- 22:44IO
- 23:07Function IO
- 25:16Program IO
- 25:45Program Count
- 26:52impure constructor
- 28:11hype constructor
- 28:44Li IO
- 32:01Pure IO
- 32:21impure IO
- 32:55impure function
- 33:28identity arrow
- 33:56compose
- 34:23zip
- 35:04and
- 36:52First and Second
- 37:53Left
- 38:29Right
- 38:46PrintLine
- 40:02Conditional Logic
- 43:30recursive construct
- 43:41termination condition
- 43:57while loop
- 44:23how to make this really fast
- 44:37how to use the impure constructor
- 45:06example composition
- 46:05dynamic optimization
- 47:07ifthenelse
- 48:40speed
- 48:57fuse
- 49:33benchmark
- 51:26arrow notation
- 52:04results speak for themselves
- 52:35more complex logic
- 54:38less code
- 55:02Whats next
- 56:26Thanks
related talks
45mZIO: Next-Generation Effects in Scala
53mFunctional Async on the JVM
27mEffectful
01h 53mAsynchronous and Concurrent Programming in Scala Part 2
47mWhirlwind Tour of the Scala Functional Programming Ecosystem
47mIntroduction to Algebraic Effects
45mFP: The Good, the Bad and the Ugly
01h 28mAsynchronous and Concurrent Programming in Scala Part 1
