Skip to content

Latest commit

 

History

History
139 lines (93 loc) · 2.58 KB

File metadata and controls

139 lines (93 loc) · 2.58 KB

Array search

Array search functions.

Review Version Quality

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-arrays provides find, findLast, findIndex and findLastIndex
  • findEach is synonymous with filter

Tooling

Dependencies

To install dependencies:

yarn install
yarn spago install

Tests

To run tests:

yarn spago test

Documentation

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

Remarks

Lots of love to the open source community!

Be kind to your mind Love each other It's ok to have a bad day