All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tofu.internal.instances.GuaranteeInstance.scala Maven / Gradle / Ivy

package tofu.internal
package instances

import cats.MonadError
import tofu.Finally
import tofu.internal.carriers.{FinallyCarrier2, FinallyCarrier3}

import scala.compiletime.summonFrom

private[tofu] trait GuaranteeInstance:
  inline given [F[_], E, Exit[_]](using inline m: MonadError[F, E]): Finally[F, Exit] = summonFrom {
    case carrier: FinallyCarrier3.Aux[F, E, Exit] => carrier.content
    case carrier: FinallyCarrier2.Aux[F, E, Exit] => carrier.content
  }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy