You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
}
}
The text was updated successfully, but these errors were encountered:
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)
}
}
The text was updated successfully, but these errors were encountered: