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

harness.deriving.MaybeGiven.scala Maven / Gradle / Ivy

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