Polymorphic Classes

Polymorphic classes are defined using withTypeParams(...):

import treehugger.forest._, definitions._, treehuggerDSL._

val tree = (CLASSDEF("Queue") withTypeParams(TYPEVAR("A"))
  withParams(VAL("leading", "A"), VAL("trailing", "A")): Tree)
treeToString(tree)
// res0: String = "class Queue[A](val leading: A, val trailing: A)"