codegen.boilerplate.api.expression._ExprSetOpt.scala Maven / Gradle / Ivy
The newest version!
package codegen.boilerplate.api.expression
import codegen.BoilerplateGenBase
object _ExprSetOpt extends BoilerplateGenBase( "ExprSetOpt", "/api/expression") {
val content = {
val traits = (1 to 22).map(arity => Trait(arity).body).mkString("\n")
s"""// GENERATED CODE ********************************
|package molecule.boilerplate.api.expression
|
|import molecule.boilerplate.ast.Model._
|import scala.language.higherKinds
|$traits
|""".stripMargin
}
case class Trait(arity: Int) extends TemplateVals(arity) {
val body =
s"""
|
|trait ${fileName}Ops_$arity[${`A..V`}, t, Ns1[${`_, _`}], Ns2[${`_, _, _`}]] extends ExprAttr_$arity[${`A..V, `}t, Ns1, Ns2] {
| protected def _exprSetOpt(op: Op, optSet: Option[Set[t]]): Ns1[${`A..V`}, t] = ???
|}
|
|trait $fileName_$arity[${`A..V`}, t, Ns1[${`_, _`}], Ns2[${`_, _, _`}]]
| extends ${fileName}Ops_$arity[${`A..V`}, t, Ns1, Ns2] {
| def apply(optSet: Option[Set[t]]): Ns1[${`A..V`}, t] = _exprSetOpt(Eq, optSet)
|}""".stripMargin
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy