dev
Download
37 lines 707 BGroffModified 2025-11-29 raw
12345678910111213141516171819202122232425262728293031323334353637
'\" t
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
.TH List.find 3 2025-11-29 "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
l l l.
Name	Type	Description
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
assert [10, 20, 30, 40, 50].find(20) == 2
assert [10, 20, 30, 40, 50].find(9999) == none
.EE
.SH SEE ALSO
.BR Tomo-List (3)