Skip to content

Commit

Permalink
Merge pull request #1 from hearnadam/fwbrasil-patch-1
Browse files Browse the repository at this point in the history
Update talk.md
  • Loading branch information
hearnadam authored Nov 5, 2024
2 parents 1f28291 + eff3fa0 commit c3c157b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions slides/talk.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand All @@ -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
Expand Down Expand Up @@ -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.Unsafe.run`)
- Unsafe APIs require an `AllowUnsafe` evidence
- The above expression is not fully evaluated and may be pending further suspensions.

---
Expand Down Expand Up @@ -131,6 +134,7 @@ val x: Unit < IO =
---
# Env: Dependency Injection
```
// TODO Fix code
trait DB:
def apply(id: Int): String < IO
Expand Down Expand Up @@ -245,4 +249,4 @@ Wrap up:
- Running your App

TODO: Kyo Data
kyo-scheduler
kyo-scheduler

0 comments on commit c3c157b

Please sign in to comment.