com.evolutiongaming.kafka.journal.util.EitherHelper.scala Maven / Gradle / Ivy
The newest version!
package com.evolutiongaming.kafka.journal.util
import cats.syntax.all._
import scala.util.Either
object EitherHelper {
private val RightUnit = ().asRight
private val LeftUnit = ().asLeft
implicit class LeftOpsEitherHelper(val self: Left.type) extends AnyVal {
def unit[A]: Either[Unit, A] = LeftUnit
}
implicit class RightOpsEitherHelper(val self: Right.type) extends AnyVal {
def unit[A]: Either[A, Unit] = RightUnit
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy