blob: 9a2ff6096f5dfe3b93dcd67e86e1d3ad4d948856 (
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
35
36
37
38
|
'\" t
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
.TH List.find 3 2025-04-30 "Tomo man-pages"
.SH NAME
List.find \- find an element's index
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI List.find\ :\ func(list:\ [T],\ target:\ T\ ->\ Int?)
.fi
.SH DESCRIPTION
Finds the index of the first occurrence of an element (if any).
.SH ARGUMENTS
.TS
allbox;
lb lb lbx lb
l l l l.
Name Type Description Default
list [T] The list to search through. -
target T The item to search for. -
.TE
.SH RETURN
The index of the first occurrence or `none` if not found.
.SH EXAMPLES
.EX
>> [10, 20, 30, 40, 50].find(20)
= 2 : Int?
>> [10, 20, 30, 40, 50].find(9999)
= none : Int?
.EE
|