codegen.boilerplate.api.expression._ExprSeqOpt.scala Maven / Gradle / Ivy
The newest version!
package codegen.boilerplate.api.expression
import codegen.BoilerplateGenBase
object _ExprSeqOpt extends BoilerplateGenBase( "ExprSeqOpt", "/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 _exprSeqOpt(op: Op, optSeq: Option[Seq[t]]): Ns1[${`A..V`}, t] = ???
|}
|
|trait $fileName_$arity[${`A..V`}, t, Ns1[${`_, _`}], Ns2[${`_, _, _`}]]
| extends ${fileName}Ops_$arity[${`A..V`}, t, Ns1, Ns2]{
| def apply(optSeq: Option[Seq[t]]): Ns1[${`A..V`}, t] = _exprSeqOpt(Eq, optSeq)
|}""".stripMargin
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy