buzz icon indicating copy to clipboard operation
buzz copied to clipboard

Merge functional helpers behind a common iterator interface

Open giann opened this issue 2 years ago • 0 comments

Right now lists and maps have their own version of map, filter, reduce, etc.

We could imagine a common iterator interface supported by fibers that both could implement. This way any user defined object could also implement that interface.

var filtered = [1, 2, 3]
    .iter()
    .filter(
        fun (int i, int element) -> element % 2 == 0
    );

giann avatar Oct 17 '23 16:10 giann