-
-
Notifications
You must be signed in to change notification settings - Fork 566
Closed
Labels
Description
Currently we have:
sealed trait Hotswap[F[_], R] {
def swap(next: Resource[F, R]): F[R]
def clear: F[Unit]
}But a more flexible implementation would be:
sealed trait Hotswap[F[_]] {
def swap[R](next: Resource[F, R]): F[R]
def clear: F[Unit]
}That would allow you to swap in different types of resources.
We could make that change if we wanted. It would be bin-compatible, but source-breaking.
Alternatively, we could consider making the type parameter actually useful. e.g.
sealed trait Hotswap[F[_], R] {
def get: F[Option[R]]
def swap(next: Resource[F, R]): F[R]
def clear: F[Unit]
}