This document summarizes a presentation about demystifying functional effect systems in Scala. It discusses building a basic functional effect system using an IO monad to represent effects. It describes how to add capabilities like handling failures, asynchrony using async effects, and concurrency using fibers. The presentation provides examples for each capability and discusses how they are implemented in the runtime. It concludes by discussing potential next steps like adding locking effects, fiber interruption, and resource management.
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
Demystifying functional effect systems in Scala
1. Demystifying
functional effect systems in Scala
Dmitry Karlinsky
Backend Engineer at Wix.com, Data Streams team
twitter: @drkarlinsky linkedin/dkarlinsky github.com/darlinsky
6. Allow describing
effects as values
that can be easily
and safely
composed into
descriptions of whole
programs
Effect Systems
FUNCTIONAL
EFFECT SYSTEMS
7. How to build an effect system?
Start with
basic Effects
and Runtime
Add
capabilities
Concurrency
with Fibers
FUNCTIONAL
EFFECT SYSTEMS
26. Asynchrony:
A process that continues its execution in a
different place or time than the one it started in.
Fabio Labella: “How do Fibers Work? A Peek Under the Hood”
38. Concurrency:
A property of systems where several processes
execute at the same time.
CONCURRENCY
WITH FIBERS
39. Fibers
TIO.flatMap combinator describes sequences of computations.
Logical threads of execution are not tied to specific OS threads.
New combinators:
fork creates new Fibers
CONCURRENCY
WITH FIBERS
join lets one fiber await the result of another
46. Start with
a basic IO
monad
Add
capabilities
Concurrency
with Fibers
FUNCTIONAL
EFFECT SYSTEMS
What’s Next
47. ❏ Locking effects to alternative Executors (e.g for blocking effects)
❏ Fiber interruption
❏ Resource management (e.g Bracket)
❏ Fiber supervision - auto interruption of child fibers
❏ Interruption safe resource management
What’s Next
48. More Resources
● My blog post (that this talk is based on) - goes into more details
● Fabio Labella — How do Fibers Work? A Peek Under the Hood
● FIBER SUPERVISION IN ZIO — Wiem Zine El Abidine, Adam Fraser | Scalar 2020