Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aviate-labs/array.mo
Extended Array Package for Motoko
https://github.com/aviate-labs/array.mo
Last synced: 21 days ago
JSON representation
Extended Array Package for Motoko
- Host: GitHub
- URL: https://github.com/aviate-labs/array.mo
- Owner: aviate-labs
- License: apache-2.0
- Created: 2021-10-06T06:47:05.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-15T21:04:50.000Z (about 2 years ago)
- Last Synced: 2024-11-14T06:34:49.215Z (about 1 month ago)
- Language: Motoko
- Homepage:
- Size: 9.77 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-motoko - array - Extended Array Package for Motoko. (Libraries / Data structures)
README
# Array
Contains some (complementing) functions in addition to `mo:base/Array`.
## Usage
### Contains
Checks whether an array contains a given value.
```motoko
contains : (xs : [T], y : T, equal : (T, T) -> Bool) -> Bool
```### Drop
Drops the first 'n' elements of an array, returns the remainder of that array.
```motoko
drop : (xs : [T], n : Nat) -> [T]
```### Split
Splits an array in two parts, based on the given element index.
```motoko
split : (xs : [T], n : Nat) -> ([T], [T])
```### Take
Returns the first 'n' elements of an array.
```motoko
take : (xs : [T], n : Nat) -> [T]
```