aboutsummaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-10-11 15:50:19 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-10-11 15:50:19 -0400
commit436d2e02debe058e9968935e742e397c19de628a (patch)
treec51d08a586ead5c4f22d3f2d12695c4a7cf6cbca /api
parent7e8604daeb9239e1669c5414dd6caa37af30c4ff (diff)
Improvements to set support and updating docs
Diffstat (limited to 'api')
-rw-r--r--api/api.md8
-rw-r--r--api/lists.md8
-rw-r--r--api/lists.yaml8
3 files changed, 12 insertions, 12 deletions
diff --git a/api/api.md b/api/api.md
index 49ca6a5b..eaf8da17 100644
--- a/api/api.md
+++ b/api/api.md
@@ -1266,21 +1266,21 @@ assert [10, 20, 30, 40, 50].to(-2) == [10, 20, 30, 40]
## List.unique
```tomo
-List.unique : func(list: [T] -> [T])
+List.unique : func(list: [T] -> {T})
```
-Returns a list of the unique elements of the list.
+Returns a set of the unique elements of the list.
Argument | Type | Description | Default
---------|------|-------------|---------
list | `[T]` | The list to process. | -
-**Return:** A list of the unique elements from the list.
+**Return:** A set of the unique elements from the list.
**Example:**
```tomo
-assert [10, 20, 10, 10, 30].unique() == [10, 20, 30]
+assert [10, 20, 10, 10, 30].unique() == {10, 20, 30}
```
## List.where
diff --git a/api/lists.md b/api/lists.md
index 3ad61805..1c741989 100644
--- a/api/lists.md
+++ b/api/lists.md
@@ -569,21 +569,21 @@ assert [10, 20, 30, 40, 50].to(-2) == [10, 20, 30, 40]
## List.unique
```tomo
-List.unique : func(list: [T] -> [T])
+List.unique : func(list: [T] -> {T})
```
-Returns a list of the unique elements of the list.
+Returns a set of the unique elements of the list.
Argument | Type | Description | Default
---------|------|-------------|---------
list | `[T]` | The list to process. | -
-**Return:** A list of the unique elements from the list.
+**Return:** A set of the unique elements from the list.
**Example:**
```tomo
-assert [10, 20, 10, 10, 30].unique() == [10, 20, 30]
+assert [10, 20, 10, 10, 30].unique() == {10, 20, 30}
```
## List.where
diff --git a/api/lists.yaml b/api/lists.yaml
index 89769064..5a2bc2a1 100644
--- a/api/lists.yaml
+++ b/api/lists.yaml
@@ -607,18 +607,18 @@ List.to:
List.unique:
short: get the unique items in a list
description: >
- Returns a list of the unique elements of the list.
+ Returns a set of the unique elements of the list.
return:
- type: '[T]'
+ type: '{T}'
description: >
- A list of the unique elements from the list.
+ A set of the unique elements from the list.
args:
list:
type: '[T]'
description: >
The list to process.
example: |
- assert [10, 20, 10, 10, 30].unique() == [10, 20, 30]
+ assert [10, 20, 10, 10, 30].unique() == {10, 20, 30}
List.where:
short: find an index where a predicate matches