Skip to content

Hotswap type parameter isn't really used #3473

@armanbilge

Description

@armanbilge

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]
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions