New Issue: [Feature Request]: Allow passing a function to list.find/list.contains instead of element

28191, "jabraham17", "[Feature Request]: Allow passing a function to list.find/list.contains instead of element", "2025-12-11T17:03:32Z"

Summary of Feature

Description:
While writing code to search for something in a list, I want to be able to search for custom things in a list, not necessarily using ==. Otherwise, you end up being forced to write a manual for loop.

Is this issue currently blocking your progress?
no

Code Sample

use List;
record R {
  var name: string;
  var data: ....;
}
var l = new list(R);
l.pushBack(new R("A", ...));
l.pushBack(new R("B", ...));

l.find("A"); // does't work, the `find` argument needs to be of `eltType`
l.find(proc(x: R): bool { return x.name == "A"; });
l.contains(....);

// OR

record myFinder: finderInterface {}
proc myFinder.this(x) { return x.name == "A"; }
l.find(new finder());