group_map_reduce
Sequence.group_map_reduce
(K
type
:
Type, B type
:
Type, key_f Unary K T, f Unary B T, reduce_f Binary B B B) =>
container.Map K B¶Type Parameters
0.095dev (2025-08-15 12:02:22 GIT hash 301b5b75e77076d091b38f555473f9f0e31e5b5c built by fridi@fzen)
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)}