https://github.com/globalwebindex/quantify
Allows you to quantify List, Set, Dict or a single value according to a predicate
https://github.com/globalwebindex/quantify
Last synced: about 1 year ago
JSON representation
Allows you to quantify List, Set, Dict or a single value according to a predicate
- Host: GitHub
- URL: https://github.com/globalwebindex/quantify
- Owner: GlobalWebIndex
- License: bsd-3-clause
- Created: 2018-10-30T15:29:26.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-12T02:39:54.000Z (almost 3 years ago)
- Last Synced: 2025-03-24T00:15:02.832Z (about 1 year ago)
- Language: Elm
- Homepage: http://package.elm-lang.org/packages/GlobalWebIndex/quantify/1.0.0/Quantify
- Size: 157 KB
- Stars: 3
- Watchers: 36
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Quantify
[](https://travis-ci.org/GlobalWebIndex/quantify)
Allows you to quantify List, Set, Dict or a single value according to a predicate, by returning a `Quantifier`:
```elm
type Quantifier
= None
| Some
| All
```
## Example usage
```elm
isEven : Int -> Bool
isEven number =
modBy 2 number == 0
Quantify.list isEven [1,3,5,7]
--> None
Quantify.list isEven [1,2,3,4]
--> Some
Quantify.list isEven [2,4,6,8]
--> All
```
Feedback and contributions to both code and documentation are very welcome.
## Installation
```
$ elm install GlobalWebIndex/quantify
```