def find[A](list: List[A], elem: A) { eq: (A, A) => Bool }: Bool = list match {
case Nil() => false
case Cons(head, _) and head.eq(elem) => true
// ^~~
// Cannot resolve function eq, called on a value receiver.
case _ => false
}
but if you just write eq(head, elem), it Just Works :tm:
I think this should be somewhat unambiguous as patterns can only be values as of right now, right?
In this example, UFCS throws an error:
but if you just write
eq(head, elem)
, it Just Works :tm:I think this should be somewhat unambiguous as patterns can only be values as of right now, right?