Stream: Beginner Questions

Topic: Predicate get element from set


view this post on Zulip Robert Soeldner (May 12 2021 at 19:38):

I'm looking for a function which checks the presence of an set element by a predicated, and if available, returns it, e.g. 'a set => ('a => bool) => 'a option Is there something similar available?

view this post on Zulip Manuel Eberl (May 12 2021 at 20:24):

What if there is more than one?

view this post on Zulip Manuel Eberl (May 12 2021 at 20:24):

Do you want to just get a hold of any element then?

view this post on Zulip Robert Soeldner (May 13 2021 at 17:21):

Rethinking this one, the current representation is a set of elements where each element has an id attached to it. I guess, I might be better of using a Map directly.


Last updated: Apr 20 2024 at 01:05 UTC