blob: 271ce04f5025517950fbbf843ae9af3f4a6f7872 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
'\" t
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
.TH List.counts 3 2025-09-06 "Tomo man-pages"
.SH NAME
List.counts \- count occurrences
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI List.counts\ :\ func(list:\ [T]\ ->\ {T=Int})
.fi
.SH DESCRIPTION
Counts the occurrences of each element in the list.
.SH ARGUMENTS
.TS
allbox;
lb lb lbx lb
l l l l.
Name Type Description Default
list [T] The list to count elements in. -
.TE
.SH RETURN
A table mapping each element to its count.
.SH EXAMPLES
.EX
>> [10, 20, 30, 30, 30].counts()
= {10=1, 20=1, 30=3}
.EE
|