Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 2 months 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 (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-12T02:39:54.000Z (over 1 year ago)
- Last Synced: 2024-04-14T11:54:14.973Z (9 months ago)
- Language: Elm
- Homepage: http://package.elm-lang.org/packages/GlobalWebIndex/quantify/1.0.0/Quantify
- Size: 157 KB
- Stars: 3
- Watchers: 37
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Quantify
[![Build Status](https://travis-ci.org/GlobalWebIndex/quantify.svg?branch=master)](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 == 0Quantify.list isEven [1,3,5,7]
--> NoneQuantify.list isEven [1,2,3,4]
--> SomeQuantify.list isEven [2,4,6,8]
--> All
```Feedback and contributions to both code and documentation are very welcome.
## Installation
```
$ elm install GlobalWebIndex/quantify
```