Skip to content

Instantly share code, notes, and snippets.

View joan38's full-sized avatar

Joan Goyeau joan38

View GitHub Profile
implicitly[Encoder[Int]].apply(2)
implicitly[Encoder[Int]].explicitly(Encoder.intEncoder)(2)
trait Creatable[Resource: Encoder] {
def create(resource: Resource): Unit = ...
}
trait Creatable[Resource](implicit resourceEncoder: Encoder[Resource]) {
def create(resource: Resource): Unit = ...
}
trait Creatable[Resource] {
implicit protected val resourceEncoder: Encoder[Resource]
def create(resource: Resource): Unit = ...
}
case class PodsOperations() extends Creatable[Pod]
case class PodsOperations() extends Creatable[Pod] {
implicit protected val resourceEncoder: Encoder[Pod] = implicitly[Encoder[Int]]
}
case class HCon[+H, +T <: HList](head: H, tail: T) extends HList
case object HNil extends HList
// No Params
def apply(): CronTrigger[HNil] = ...
// One param
def apply[ParamValue](value: ParamValue): CronTrigger[ParamValue :: HNil] = ...
// Multi param
def apply[TupledValues <: Product, ParamValues <: HList](paramValues: TupledValues)(
implicit tupleToHList: Generic.Aux[TupledValues, ParamValues]
): CronTrigger[ParamValues] = ...