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

fly4s.implicits.scala Maven / Gradle / Ivy

The newest version!
package fly4s

import cats.{MonadThrow, Show}
import fly4s.data.{MigrateResult, ValidateOutput, ValidateOutputInstances, ValidatedMigrateResult}

object implicits extends AllInstances with AllSyntax

object instances extends AllInstances
private[fly4s] trait AllInstances extends ValidateOutputInstances

object syntax extends AllSyntax
private[fly4s] trait AllSyntax {

  import cats.implicits.*

  implicit class ValidatedMigrateResultOps(result: ValidatedMigrateResult) {
    def liftTo[F[_]: MonadThrow](implicit show: Show[Iterable[ValidateOutput]]): F[MigrateResult] =
      ValidatedMigrateResult.liftTo[F](result)
  }

  implicit class ValidatedMigrateResultMonadThrowOps[F[_]: MonadThrow](
    r: F[ValidatedMigrateResult]
  ) {
    def result(implicit show: Show[Iterable[ValidateOutput]]): F[MigrateResult] =
      r.flatMap(_.liftTo[F])
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy