fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

group_map_reduce

Sequence.group_map_reduce

group elements using key_f and
reduce elements within a group by first applying f and then using reduce_f to reduce

example: count occurrences of letters, numbers and other characters


=> {(digit => 2), (letter => 3), (other => 1)}

Type Parameters

K:property.orderable[src]
type of the keys
B:Any[src]
type of the values in the result
M:container.Map K B[src]
the type of the map to create

Arguments

key_f Unary K T[src]
function to generate the keys
f Unary B T[src]
function applied to elements before they are reduce
reduce_f Binary B B B[src]
function to reduce elements
0.099dev (GIT hash e2d5298d8107bb5fe79600fdb06a49bc75756344)
last changed: 2026-11-23