It should be possible to use undecidable generics types in function definitions.
e.g.
sealed trait WeirdGADT[+A]
case class IntValue(value: Int) extends WeirdGADT[Int]
case class SomeValue[+A](value: A) extends WeirdGADT[A]
case class SomeOtherValue[+A, +B](value: A, value2: B) extends WeirdGADT[A]
// This fails on unknown type params
def printsWeirdGADT(g: WeirdGADT[String]): String = g match
case SomeValue(value) => s"SomeValue($value)"
case SomeOtherValue(value, value2) => s"SomeOtherValue($value, $value2)"
This fails, because SomeOtherValue cannot be fully constructed based on parent's type params.
Either some default will have to be used or a new type of form element introduced - one that lets the user pick any supported type.
It should also be possible to use generic functions with GUInep.
e.g.
def showMaybe[A](maybe: Option[A]): String = maybe match
case None => "None"
case Some(v) => s"Some(${v.toString})"
This might require similar mechanisms. Plus the support for this kind of input.
It should be possible to use undecidable generics types in function definitions.
e.g.
This fails, because
SomeOtherValue
cannot be fully constructed based on parent's type params.Either some default will have to be used or a new type of form element introduced - one that lets the user pick any supported type.
It should also be possible to use generic functions with GUInep.
e.g.
This might require similar mechanisms. Plus the support for this kind of input.