Array search functions.
Installing
spago install array-search
Documentation
Documentation and more detailed examples are hosted on Pursuit.
Usage
> some (\x -> x > 1) [ 1, 2, 3, 4 ] true > some (\x -> x > 5) [ 1, 2, 3, 4 ] false
> every (\x -> x > 0) [ 1, 2, 3, 4 ] true > every (\x -> x > 1) [ 1, 2, 3, 4 ] false
> findEachIndex (\x -> x > 1) [ 1, 2, 3, 4 ] [1, 2, 3]
> smallest [ 1, 2, 3, 4 ] 1 > largest [ 1, 2, 3, 4 ] 4
> smallestWhere (\x -> x > 1) [ 1, 2, 3, 4 ] 2 > largestWhere (\x -> x > 1) [ 1, 2, 3, 4 ] 4
> smallestAbove 1 [ 1, 2, 3, 4 ] 2 > largestBelow 2 [ 1, 2, 3, 4 ] 1
Why provide findEachIndex only?
What about find, findLast, findIndex, findLastIndex and findEach?
purescript-arraysprovidesfind,findLast,findIndexandfindLastIndexfindEachis synonymous withfilter
Tooling
Dependencies
To install dependencies:
yarn install yarn spago install
Tests
To run tests:
yarn spago testDocumentation
To generate the documentation locally:
yarn spago docs
Linters
To run linters:
yarn lint
Formatters
To run formatters:
yarn format
Contributing
Please read this repository's Code of Conduct which outlines our collaboration standards and the Changelog for details on breaking changes that have been made.
This repository adheres to semantic versioning standards. For more information on semantic versioning visit SemVer.
Bump2version is used to version and tag changes. For example:
bump2version patch
Contributors
- Joel Lefkowitz - Initial work
Remarks
Lots of love to the open source community!