Array search functions.
spago install array-search
Documentation and more detailed examples are hosted on Pursuit.
> 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-arrays
providesfind
,findLast
,findIndex
andfindLastIndex
findEach
is synonymous withfilter
To install dependencies:
yarn install
yarn spago install
To run tests:
yarn spago test
To generate the documentation locally:
yarn spago docs
To run linters:
yarn lint
To run formatters:
yarn format
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
- Joel Lefkowitz - Initial work
Lots of love to the open source community!