Skip to content

Instantly share code, notes, and snippets.

@eed3si9n
Forked from xuwei-k/Main.scala
Created February 14, 2012 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eed3si9n/1825396 to your computer and use it in GitHub Desktop.
Save eed3si9n/1825396 to your computer and use it in GitHub Desktop.
generate specs2 DataTables using treehugger
libraryDependencies ++= Seq(
"com.eed3si9n" %% "treehugger" % "0.1.1"
)
resolvers ++= Seq(
"sonatype" at "https://oss.sonatype.org/content/groups/public"
)
object Main extends App {
import treehugger.forest._
import definitions._
import treehuggerDSL._
val n = 10
object sym {
val nList = (1 to n).toList
val TableHeader = RootClass.newClass("TableHeader")
val TableHeader_titles = TableHeader.newValue("titles")
lazy val TableHeader_pipe = precalcSymbols(i => TableHeader.newMethod("|"))
lazy val TableHeader_pipeParams =
precalc(i => (1 to i).toList map { k =>
TableHeader_pipe(i).newTypeParameter(("T" + k).toString)
})
lazy val TableHeader_piper = precalcSymbols(i => TableHeader.newMethod("|>"))
lazy val TableHeader_piperParams =
precalc(i => (1 to i).toList map { k =>
TableHeader_piper(i).newTypeParameter(("T" + k).toString)
})
val Table = RootClass.newClass("Table")
lazy val Table_collect = Table.newMethod("collect")
lazy val TableN = precalcSymbols(i => RootClass.newClass("Table" + i.toString))
lazy val TableNParams =
precalc(i => (1 to i).toList map { k => TableN(i).newTypeParameter("T" + k.toString) })
lazy val TableN_titles = precalcSymbols(i => TableN(i).newValue("titles"))
lazy val TableN_rows = precalcSymbols(i => TableN(i).newValue("rows"))
lazy val TableN_execute = precalcSymbols(i => TableN(i).newValue("execute"))
lazy val TableN_pipe = precalcSymbols(i => TableN(i).newMethod("|"))
lazy val T_pipe_R = precalcSymbols(i => TableN_pipe(i).newTypeParameter("R"))
lazy val TableN_piper = precalcSymbols(i => TableN(i).newMethod("|>"))
lazy val T_piper_R = precalcSymbols(i => TableN_piper(i).newTypeParameter("R"))
lazy val TableN_executeRow = precalcSymbols(i => TableN(i).newMethod("executeRow"))
lazy val T_executeRow_R = precalcSymbols(i => TableN_executeRow(i).newTypeParameter("R"))
val DataRow = RootClass.newClass("DataRow")
val DataRowParams = nList map { k => DataRow.newTypeParameter("T" + k.toString) }
lazy val DataRowN = precalcSymbols(i => RootClass.newClass("DataRow" + i.toString))
lazy val DataRowNParams =
precalc(i => nList.splitAt(i) match {
case (xs, ys) =>
(xs map { k => DataRowN(i).newTypeParameter("T" + k.toString) }) :::
(ys map { k => AnyClass })
})
val Result = RootClass.newClass("Result")
val DecoratedResult = RootClass.newClass(("DecoratedResult"))
val DataTable = RootClass.newClass("DataTable")
val Success = RootClass.newClass("Success")
val precalcSymbols = precalc[Symbol] _
def precalc[T](mk: Int => T) = Map(nList map {i => i -> mk(i)}: _*)
}
lazy val tableHeaderTree: Tree =
(CASECLASSDEF(sym.TableHeader)
withParams(PARAM(sym.TableHeader_titles, TYPE_LIST(StringClass))) := BLOCK({
val pipeBody = REF("copy") APPLY (sym.TableHeader_titles := (THIS DOT sym.TableHeader_titles) INFIX(":+") APPLY REF("title"))
val pipepipe = DEF("||") withParams(VAL("title", StringClass)) := pipeBody
val pipe = DEF("|") withParams(VAL("title", StringClass)) := pipeBody
var trees: List[Tree] =
sym.nList flatMap { i =>
((DEF(sym.TableHeader_pipe(i))
withTypeParams(sym.TableHeader_pipeParams(i) map {TYPEVAR(_)})
withParams(PARAM("row", sym.DataRowN(i) TYPE_OF(sym.TableHeader_pipeParams(i))))) :=
NEW(sym.TableN(i), REF(sym.TableHeader_titles), LIST(REF("row")))) ::
((DEF(sym.TableHeader_piper(i))
withTypeParams(sym.TableHeader_piperParams(i) map {TYPEVAR(_)})
withParams(PARAM("row", sym.DataRowN(i) TYPE_OF(sym.TableHeader_piperParams(i))))) :=
NEW(sym.TableN(i), REF(sym.TableHeader_titles), LIST(REF("row")), REF("execute") := TRUE)) ::
Nil
}
pipepipe :: pipe :: trees
}))
lazy val tableClassTrees: List[Tree] = sym.nList map { i =>
val tpToRType = TYPE_FUNCTION((sym.TableNParams(i) map {_.toType}) ::: List("R": Type))
val DataRowNType = sym.DataRowN(i) TYPE_OF(sym.TableNParams(i))
val pipeBody =
sym.TableN(i) APPLY (REF(sym.TableN_titles(i)),
(REF("outer") DOT "rows") INFIX(":+") APPLY REF("row"), REF(sym.TableN_execute(i)))
(CASECLASSDEF(sym.TableN(i))
withParams(VAL(sym.TableN_titles(i), TYPE_LIST(StringClass)) withFlags(Flags.OVERRIDE),
PARAM(sym.TableN_rows(i), TYPE_LIST(DataRowNType)),
VAL(sym.TableN_execute(i), BooleanClass) withFlags(Flags.OVERRIDE) := TRUE)
withParents(sym.Table APPLY (REF(sym.TableN_titles(i)), REF(sym.TableN_execute(i))))) := BLOCK(
if (i == 1) (DEF(sym.TableN_pipe(i)) withParams(VAL("row", DataRowNType))) := pipeBody
else (DEF(sym.TableN_pipe(i))
withTypeParams((1 to i) map { j => (TYPEVAR("S" + j) LOWER(sym.TableNParams(i)(j - 1))) })
withParams(VAL("row", DataRowNType))) := pipeBody,
(DEF(sym.TableN_pipe(i))
withTypeParams(TYPEVAR(sym.T_pipe_R(i)) VIEWBOUNDS (sym.Result))
withParams(PARAM("f", tpToRType))) :=
(sym.TableN_executeRow(i) APPLY (REF("f"), REF(sym.TableN_execute(i)))),
(DEF(sym.TableN_piper(i))
withTypeParams(TYPEVAR(sym.T_piper_R(i)) VIEWBOUNDS (sym.Result))
withParams(PARAM("f", tpToRType))) :=
(sym.TableN_executeRow(i) APPLY(REF("f"), TRUE)),
(DEF(sym.TableN_executeRow(i), sym.DecoratedResult TYPE_OF sym.DataTable)
withTypeParams(TYPEVAR(sym.T_executeRow_R(i)) VIEWBOUNDS (sym.Result))
withParams(
PARAM("f", tpToRType),
PARAM("exec", BooleanClass))) := BLOCK(
IF(REF("exec")) THEN(
sym.Table_collect APPLY (
REF("rows") MAP LAMBDA(PARAM("d", DataRowNType)) ==> BLOCK(
TUPLE(REF("d") DOT "showCells",
(Predef_implicitly APPLYTYPE(sym.T_executeRow_R(i) TYPE_=> sym.Result) DOT "apply")(
REF("f") APPLY ((1 to i).toList map { k => (REF("d") DOT ("t" + k)) })
) DOT "execute"
) // TUPLE
)
)
) ELSE (sym.DecoratedResult APPLY (
sym.DataTable APPLY (REF(sym.TableN_titles(i)), SEQ(), sym.Success APPLY LIT("ok")))) // ELSE
) // BLOCK
) // BLOCK
}
lazy val dataRowTree: Tree =
(CLASSDEF(sym.DataRow)
withFlags(Flags.ABSTRACT)
withTypeParams(sym.DataRowParams map { x => TYPEVAR(COVARIANT(x)) })
withParents("Product")) := BLOCK(
DEF("show") := (REF("productIterator") DOT "mkString")(LIT("|"), LIT("|"), LIT("|")),
DEF("showCells") := REF("productIterator") MAP (WILDCARD TOSTRING) DOT "toSeq"
)
lazy val dataRowTrees: List[Tree] = sym.nList map { i =>
(CASECLASSDEF(sym.DataRowN(i))
withTypeParams(sym.DataRowNParams(i) map {TYPEVAR(_)})) := BLOCK(
(if (i == 10) Nil
else {
val plusOne = i + 1
val body = sym.DataRowN(i + 1) APPLY((1 to i + 1).toList map { k => REF("t" + k.toString)})
((DEF("!")
withTypeParams(TYPEVAR("S" + plusOne.toString))
withParams(PARAM("t" + plusOne.toString, "S" + plusOne.toString))) := body) ::
((DEF("!!")
withTypeParams(TYPEVAR("S" + plusOne.toString))
withParams(PARAM("t" + plusOne.toString, "S" + plusOne.toString))) := body) ::
Nil
}))
}
println {
treeToString(List(tableHeaderTree) :::
tableClassTrees :::
List(dataRowTree) :::
dataRowTrees: _*)
}
}
case class TableHeader(titles: List[String]) {
def ||(title: String) = copy(titles = this.titles :+ title)
def |(title: String) = copy(titles = this.titles :+ title)
def |[T1](row: DataRow1[T1]) = new Table1(titles, List(row))
def |>[T1](row: DataRow1[T1]) = new Table1(titles, List(row), execute = true)
def |[T1, T2](row: DataRow2[T1,T2]) = new Table2(titles, List(row))
def |>[T1, T2](row: DataRow2[T1,T2]) = new Table2(titles, List(row), execute = true)
def |[T1, T2, T3](row: DataRow3[T1,T2,T3]) = new Table3(titles, List(row))
def |>[T1, T2, T3](row: DataRow3[T1,T2,T3]) = new Table3(titles, List(row), execute = true)
def |[T1, T2, T3, T4](row: DataRow4[T1,T2,T3,T4]) = new Table4(titles, List(row))
def |>[T1, T2, T3, T4](row: DataRow4[T1,T2,T3,T4]) = new Table4(titles, List(row), execute = true)
def |[T1, T2, T3, T4, T5](row: DataRow5[T1,T2,T3,T4,T5]) = new Table5(titles, List(row))
def |>[T1, T2, T3, T4, T5](row: DataRow5[T1,T2,T3,T4,T5]) = new Table5(titles, List(row), execute = true)
def |[T1, T2, T3, T4, T5, T6](row: DataRow6[T1,T2,T3,T4,T5,T6]) = new Table6(titles, List(row))
def |>[T1, T2, T3, T4, T5, T6](row: DataRow6[T1,T2,T3,T4,T5,T6]) = new Table6(titles, List(row), execute = true)
def |[T1, T2, T3, T4, T5, T6, T7](row: DataRow7[T1,T2,T3,T4,T5,T6,T7]) = new Table7(titles, List(row))
def |>[T1, T2, T3, T4, T5, T6, T7](row: DataRow7[T1,T2,T3,T4,T5,T6,T7]) = new Table7(titles, List(row), execute = true)
def |[T1, T2, T3, T4, T5, T6, T7, T8](row: DataRow8[T1,T2,T3,T4,T5,T6,T7,T8]) = new Table8(titles, List(row))
def |>[T1, T2, T3, T4, T5, T6, T7, T8](row: DataRow8[T1,T2,T3,T4,T5,T6,T7,T8]) = new Table8(titles, List(row), execute = true)
def |[T1, T2, T3, T4, T5, T6, T7, T8, T9](row: DataRow9[T1,T2,T3,T4,T5,T6,T7,T8,T9]) = new Table9(titles, List(row))
def |>[T1, T2, T3, T4, T5, T6, T7, T8, T9](row: DataRow9[T1,T2,T3,T4,T5,T6,T7,T8,T9]) = new Table9(titles, List(row), execute = true)
def |[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10](row: DataRow10[T1,T2,T3,T4,T5,T6,T7,T8,T9,T10]) = new Table10(titles, List(row))
def |>[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10](row: DataRow10[T1,T2,T3,T4,T5,T6,T7,T8,T9,T10]) = new Table10(titles, List(row), execute = true)
}
case class Table1(override val titles: List[String], rows: List[DataRow1[T1]], override val execute: Boolean = true) extends Table(titles, execute) {
def |(row: DataRow1[T1]) = Table1(titles, outer.rows :+ row, execute)
def |[R <% Result](f: T1 => R) = executeRow(f, execute)
def |>[R <% Result](f: T1 => R) = executeRow(f, true)
def executeRow[R <% Result](f: T1 => R, exec: Boolean): DecoratedResult[DataTable] = {
if (exec) collect(rows map { (d: DataRow1[T1]) =>
(d.showCells, implicitly[R => Result].apply(f(d.t1)).execute)
})
else DecoratedResult(DataTable(titles, Seq(), Success("ok")))
}
}
case class Table2(override val titles: List[String], rows: List[DataRow2[T1,T2]], override val execute: Boolean = true) extends Table(titles, execute) {
def |[S1 >: T1, S2 >: T2](row: DataRow2[T1,T2]) = Table2(titles, outer.rows :+ row, execute)
def |[R <% Result](f: (T1, T2) => R) = executeRow(f, execute)
def |>[R <% Result](f: (T1, T2) => R) = executeRow(f, true)
def executeRow[R <% Result](f: (T1, T2) => R, exec: Boolean): DecoratedResult[DataTable] = {
if (exec) collect(rows map { (d: DataRow2[T1,T2]) =>
(d.showCells, implicitly[R => Result].apply(f(d.t1, d.t2)).execute)
})
else DecoratedResult(DataTable(titles, Seq(), Success("ok")))
}
}
case class Table3(override val titles: List[String], rows: List[DataRow3[T1,T2,T3]], override val execute: Boolean = true) extends Table(titles, execute) {
def |[S1 >: T1, S2 >: T2, S3 >: T3](row: DataRow3[T1,T2,T3]) = Table3(titles, outer.rows :+ row, execute)
def |[R <% Result](f: (T1, T2, T3) => R) = executeRow(f, execute)
def |>[R <% Result](f: (T1, T2, T3) => R) = executeRow(f, true)
def executeRow[R <% Result](f: (T1, T2, T3) => R, exec: Boolean): DecoratedResult[DataTable] = {
if (exec) collect(rows map { (d: DataRow3[T1,T2,T3]) =>
(d.showCells, implicitly[R => Result].apply(f(d.t1, d.t2, d.t3)).execute)
})
else DecoratedResult(DataTable(titles, Seq(), Success("ok")))
}
}
case class Table4(override val titles: List[String], rows: List[DataRow4[T1,T2,T3,T4]], override val execute: Boolean = true) extends Table(titles, execute) {
def |[S1 >: T1, S2 >: T2, S3 >: T3, S4 >: T4](row: DataRow4[T1,T2,T3,T4]) = Table4(titles, outer.rows :+ row, execute)
def |[R <% Result](f: (T1, T2, T3, T4) => R) = executeRow(f, execute)
def |>[R <% Result](f: (T1, T2, T3, T4) => R) = executeRow(f, true)
def executeRow[R <% Result](f: (T1, T2, T3, T4) => R, exec: Boolean): DecoratedResult[DataTable] = {
if (exec) collect(rows map { (d: DataRow4[T1,T2,T3,T4]) =>
(d.showCells, implicitly[R => Result].apply(f(d.t1, d.t2, d.t3, d.t4)).execute)
})
else DecoratedResult(DataTable(titles, Seq(), Success("ok")))
}
}
case class Table5(override val titles: List[String], rows: List[DataRow5[T1,T2,T3,T4,T5]], override val execute: Boolean = true) extends Table(titles, execute) {
def |[S1 >: T1, S2 >: T2, S3 >: T3, S4 >: T4, S5 >: T5](row: DataRow5[T1,T2,T3,T4,T5]) = Table5(titles, outer.rows :+ row, execute)
def |[R <% Result](f: (T1, T2, T3, T4, T5) => R) = executeRow(f, execute)
def |>[R <% Result](f: (T1, T2, T3, T4, T5) => R) = executeRow(f, true)
def executeRow[R <% Result](f: (T1, T2, T3, T4, T5) => R, exec: Boolean): DecoratedResult[DataTable] = {
if (exec) collect(rows map { (d: DataRow5[T1,T2,T3,T4,T5]) =>
(d.showCells, implicitly[R => Result].apply(f(d.t1, d.t2, d.t3, d.t4, d.t5)).execute)
})
else DecoratedResult(DataTable(titles, Seq(), Success("ok")))
}
}
case class Table6(override val titles: List[String], rows: List[DataRow6[T1,T2,T3,T4,T5,T6]], override val execute: Boolean = true) extends Table(titles, execute) {
def |[S1 >: T1, S2 >: T2, S3 >: T3, S4 >: T4, S5 >: T5, S6 >: T6](row: DataRow6[T1,T2,T3,T4,T5,T6]) = Table6(titles, outer.rows :+ row, execute)
def |[R <% Result](f: (T1, T2, T3, T4, T5, T6) => R) = executeRow(f, execute)
def |>[R <% Result](f: (T1, T2, T3, T4, T5, T6) => R) = executeRow(f, true)
def executeRow[R <% Result](f: (T1, T2, T3, T4, T5, T6) => R, exec: Boolean): DecoratedResult[DataTable] = {
if (exec) collect(rows map { (d: DataRow6[T1,T2,T3,T4,T5,T6]) =>
(d.showCells, implicitly[R => Result].apply(f(d.t1, d.t2, d.t3, d.t4, d.t5, d.t6)).execute)
})
else DecoratedResult(DataTable(titles, Seq(), Success("ok")))
}
}
case class Table7(override val titles: List[String], rows: List[DataRow7[T1,T2,T3,T4,T5,T6,T7]], override val execute: Boolean = true) extends Table(titles, execute) {
def |[S1 >: T1, S2 >: T2, S3 >: T3, S4 >: T4, S5 >: T5, S6 >: T6, S7 >: T7](row: DataRow7[T1,T2,T3,T4,T5,T6,T7]) = Table7(titles, outer.rows :+ row, execute)
def |[R <% Result](f: (T1, T2, T3, T4, T5, T6, T7) => R) = executeRow(f, execute)
def |>[R <% Result](f: (T1, T2, T3, T4, T5, T6, T7) => R) = executeRow(f, true)
def executeRow[R <% Result](f: (T1, T2, T3, T4, T5, T6, T7) => R, exec: Boolean): DecoratedResult[DataTable] = {
if (exec) collect(rows map { (d: DataRow7[T1,T2,T3,T4,T5,T6,T7]) =>
(d.showCells, implicitly[R => Result].apply(f(d.t1, d.t2, d.t3, d.t4, d.t5, d.t6, d.t7)).execute)
})
else DecoratedResult(DataTable(titles, Seq(), Success("ok")))
}
}
case class Table8(override val titles: List[String], rows: List[DataRow8[T1,T2,T3,T4,T5,T6,T7,T8]], override val execute: Boolean = true) extends Table(titles, execute) {
def |[S1 >: T1, S2 >: T2, S3 >: T3, S4 >: T4, S5 >: T5, S6 >: T6, S7 >: T7, S8 >: T8](row: DataRow8[T1,T2,T3,T4,T5,T6,T7,T8]) = Table8(titles, outer.rows :+ row, execute)
def |[R <% Result](f: (T1, T2, T3, T4, T5, T6, T7, T8) => R) = executeRow(f, execute)
def |>[R <% Result](f: (T1, T2, T3, T4, T5, T6, T7, T8) => R) = executeRow(f, true)
def executeRow[R <% Result](f: (T1, T2, T3, T4, T5, T6, T7, T8) => R, exec: Boolean): DecoratedResult[DataTable] = {
if (exec) collect(rows map { (d: DataRow8[T1,T2,T3,T4,T5,T6,T7,T8]) =>
(d.showCells, implicitly[R => Result].apply(f(d.t1, d.t2, d.t3, d.t4, d.t5, d.t6, d.t7, d.t8)).execute)
})
else DecoratedResult(DataTable(titles, Seq(), Success("ok")))
}
}
case class Table9(override val titles: List[String], rows: List[DataRow9[T1,T2,T3,T4,T5,T6,T7,T8,T9]], override val execute: Boolean = true) extends Table(titles, execute) {
def |[S1 >: T1, S2 >: T2, S3 >: T3, S4 >: T4, S5 >: T5, S6 >: T6, S7 >: T7, S8 >: T8, S9 >: T9](row: DataRow9[T1,T2,T3,T4,T5,T6,T7,T8,T9]) = Table9(titles, outer.rows :+ row, execute)
def |[R <% Result](f: (T1, T2, T3, T4, T5, T6, T7, T8, T9) => R) = executeRow(f, execute)
def |>[R <% Result](f: (T1, T2, T3, T4, T5, T6, T7, T8, T9) => R) = executeRow(f, true)
def executeRow[R <% Result](f: (T1, T2, T3, T4, T5, T6, T7, T8, T9) => R, exec: Boolean): DecoratedResult[DataTable] = {
if (exec) collect(rows map { (d: DataRow9[T1,T2,T3,T4,T5,T6,T7,T8,T9]) =>
(d.showCells, implicitly[R => Result].apply(f(d.t1, d.t2, d.t3, d.t4, d.t5, d.t6, d.t7, d.t8, d.t9)).execute)
})
else DecoratedResult(DataTable(titles, Seq(), Success("ok")))
}
}
case class Table10(override val titles: List[String], rows: List[DataRow10[T1,T2,T3,T4,T5,T6,T7,T8,T9,T10]], override val execute: Boolean = true) extends Table(titles, execute) {
def |[S1 >: T1, S2 >: T2, S3 >: T3, S4 >: T4, S5 >: T5, S6 >: T6, S7 >: T7, S8 >: T8, S9 >: T9, S10 >: T10](row: DataRow10[T1,T2,T3,T4,T5,T6,T7,T8,T9,T10]) = Table10(titles, outer.rows :+ row, execute)
def |[R <% Result](f: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) => R) = executeRow(f, execute)
def |>[R <% Result](f: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) => R) = executeRow(f, true)
def executeRow[R <% Result](f: (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) => R, exec: Boolean): DecoratedResult[DataTable] = {
if (exec) collect(rows map { (d: DataRow10[T1,T2,T3,T4,T5,T6,T7,T8,T9,T10]) =>
(d.showCells, implicitly[R => Result].apply(f(d.t1, d.t2, d.t3, d.t4, d.t5, d.t6, d.t7, d.t8, d.t9, d.t10)).execute)
})
else DecoratedResult(DataTable(titles, Seq(), Success("ok")))
}
}
abstract class DataRow[+T1, +T2, +T3, +T4, +T5, +T6, +T7, +T8, +T9, +T10] extends Product {
def show = productIterator.mkString("|", "|", "|")
def showCells = productIterator.map(_.toString).toSeq
}
case class DataRow1[T1, Any, Any, Any, Any, Any, Any, Any, Any, Any] {
def ![S2](t2: S2) = DataRow2(t1, t2)
def !![S2](t2: S2) = DataRow2(t1, t2)
}
case class DataRow2[T1, T2, Any, Any, Any, Any, Any, Any, Any, Any] {
def ![S3](t3: S3) = DataRow3(t1, t2, t3)
def !![S3](t3: S3) = DataRow3(t1, t2, t3)
}
case class DataRow3[T1, T2, T3, Any, Any, Any, Any, Any, Any, Any] {
def ![S4](t4: S4) = DataRow4(t1, t2, t3, t4)
def !![S4](t4: S4) = DataRow4(t1, t2, t3, t4)
}
case class DataRow4[T1, T2, T3, T4, Any, Any, Any, Any, Any, Any] {
def ![S5](t5: S5) = DataRow5(t1, t2, t3, t4, t5)
def !![S5](t5: S5) = DataRow5(t1, t2, t3, t4, t5)
}
case class DataRow5[T1, T2, T3, T4, T5, Any, Any, Any, Any, Any] {
def ![S6](t6: S6) = DataRow6(t1, t2, t3, t4, t5, t6)
def !![S6](t6: S6) = DataRow6(t1, t2, t3, t4, t5, t6)
}
case class DataRow6[T1, T2, T3, T4, T5, T6, Any, Any, Any, Any] {
def ![S7](t7: S7) = DataRow7(t1, t2, t3, t4, t5, t6, t7)
def !![S7](t7: S7) = DataRow7(t1, t2, t3, t4, t5, t6, t7)
}
case class DataRow7[T1, T2, T3, T4, T5, T6, T7, Any, Any, Any] {
def ![S8](t8: S8) = DataRow8(t1, t2, t3, t4, t5, t6, t7, t8)
def !![S8](t8: S8) = DataRow8(t1, t2, t3, t4, t5, t6, t7, t8)
}
case class DataRow8[T1, T2, T3, T4, T5, T6, T7, T8, Any, Any] {
def ![S9](t9: S9) = DataRow9(t1, t2, t3, t4, t5, t6, t7, t8, t9)
def !![S9](t9: S9) = DataRow9(t1, t2, t3, t4, t5, t6, t7, t8, t9)
}
case class DataRow9[T1, T2, T3, T4, T5, T6, T7, T8, T9, Any] {
def ![S10](t10: S10) = DataRow10(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10)
def !![S10](t10: S10) = DataRow10(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10)
}
case class DataRow10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10] {
()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment