From a3ead38f98dbd1322286176bcc3f0ab698fb31c0 Mon Sep 17 00:00:00 2001 From: Flavio Brasil Date: Mon, 4 Nov 2024 14:24:30 -0800 Subject: [PATCH 1/2] Update talk.md --- slides/talk.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/slides/talk.md b/slides/talk.md index 59c7fec..41904e1 100755 --- a/slides/talk.md +++ b/slides/talk.md @@ -17,7 +17,7 @@ autoscale: false - `kyo-prelude`: Side-effect free **Algebraic effects** - `kyo-core`: Effects for IO, Async, & Concurrency - `kyo-scheduler`: high performance adaptive scheduler - - `kyo-scheduler-zio`: run your ZIO App! + - `kyo-scheduler-zio`: boost your ZIO App! --- # What are Algebraic Effects? @@ -35,7 +35,7 @@ autoscale: false * Suspension defers a computation until later * Separation of execution from definition: * Flexibility in execution (Retry, Delay, Interrupt) - * Delayed implementation (Clock.live vs Clock.test) + * Delayed implementation (Clock.live vs Clock.withTimeControl) ^ Effects are probably the most overloaded term in FP ^ Most people end up describing Side-Effects, not functional effects @@ -100,10 +100,13 @@ object DB: def run(query: SQL[Result]): Result < IO = ??? object MyApp: - val _: Chunk[Person] < Any = IO.run(DB.run(sql"select * from person")) + val _: Chunk[Person] < Any = + import AllowUnsafe.embrace.danger + IO.Unsafe.run(DB.run(sql"select * from person")) ``` -- `IO` must be handled individually (`IO.run`) +- `IO` must be handled individually (`IO.Unit.run`) +- Unsafe APIs require an `AllowUnsafe` evidence - The above expression is not fully evaluated and may be pending further suspensions. --- @@ -131,6 +134,7 @@ val x: Unit < IO = --- # Env: Dependency Injection ``` +// TODO Fix code trait DB: def apply(id: Int): String < IO @@ -245,4 +249,4 @@ Wrap up: - Running your App TODO: Kyo Data -kyo-scheduler \ No newline at end of file +kyo-scheduler From eff3fa0b4d9e12cb6c9d7daf9d78bbdca1b2eae8 Mon Sep 17 00:00:00 2001 From: Adam Hearn <22334119+hearnadam@users.noreply.github.com> Date: Tue, 5 Nov 2024 22:05:36 +0100 Subject: [PATCH 2/2] Update slides/talk.md --- slides/talk.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slides/talk.md b/slides/talk.md index 41904e1..5fdfff0 100755 --- a/slides/talk.md +++ b/slides/talk.md @@ -105,7 +105,7 @@ object MyApp: IO.Unsafe.run(DB.run(sql"select * from person")) ``` -- `IO` must be handled individually (`IO.Unit.run`) +- `IO` must be handled individually (`IO.Unsafe.run`) - Unsafe APIs require an `AllowUnsafe` evidence - The above expression is not fully evaluated and may be pending further suspensions.