Slide 70
Slide 70 text
Design tips
Small, high-level, compositional abstractions
Concurrency details away from domain
Trust the laws, nothing else
trait Background[F[_]] {
def managedStart[A](fa: F[A]): F[Unit]
}
trait SimpleCache[K, V] {
def clear(k: K): IO[Unit]
def getOrFetch(k: K): IO[V]
}
trait JobScheduler[F[_]] {
def schedule(at: Instant, job: F[Unit]): F[Unit]
}
trait RateLimiter[F[_]] {
def limited[A](action: F[A]): F[A]
}