Array search
Array search functions.
Installation
spago install array-search
Documentation
Documentation and more detailed examples are hosted on Github Pages.
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-arrays
providesfind
,findLast
,findIndex
andfindLastIndex
findEach
is synonymous withfilter
Tooling
Tests
To run tests:
spago test
Documentation
To generate the documentation locally:
spago docs
Linters
To run linters:
npm run lint
Formatters
To run formatters:
npm run 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!