simulacrum
simulacrum copied to clipboard
varargs does not works
Hi, how can define function with varargs ?
b can not be A*, does works with List[A]. Any idea how to make it works? Thanks
@typeclass trait CanTruthy[A] { self =>
/** Return true, if a is truthy. /
def truthy(a: A, b: A): Boolean
}
object CanTruthy {
def fromTruthy[A](f: A => Boolean): CanTruthy[A] = new CanTruthy[A] {
def truthy(a: A, b: A*): Boolean = f(a)
}
}
@clives raising a PR
Raised https://github.com/typelevel/simulacrum/pull/236