harness.deriving.MaybeGiven.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of harness-deriving_3 Show documentation
Show all versions of harness-deriving_3 Show documentation
Miscellaneous libraries/utilities for Scala.
The newest version!
package harness.deriving
import cats.syntax.option.*
final case class MaybeGiven[+T](toOption: Option[T])
object MaybeGiven {
inline def apply[T](implicit maybeGiven: MaybeGiven[T]): MaybeGiven[T] = maybeGiven
inline given inst[T]: MaybeGiven[T] =
compiletime.summonFrom {
case t: T => MaybeGiven(t.some)
case _ => MaybeGiven(None)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy