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

io.github.arainko.ducktape.internal.FieldValue.scala Maven / Gradle / Ivy

There is a newer version: 0.2.5
Show newest version
package io.github.arainko.ducktape.internal

import scala.quoted.*

private[ducktape] enum FieldValue {
  def index: Int
  def tpe: Type[?]

  case Wrapped[F[+x]](index: Int, tpe: Type[?], value: Expr[F[Any]])
  case Unwrapped(index: Int, tpe: Type[?], value: Expr[Any])
}

private[ducktape] object FieldValue {

  given Ordering[FieldValue] = Ordering.by(_.index)

  extension [F[+x]](wrapped: FieldValue.Wrapped[F]) {
    def unwrapped(value: Expr[Any]): FieldValue.Unwrapped = FieldValue.Unwrapped(wrapped.index, wrapped.tpe, value)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy