Skip to content

GlobalWebIndex/quantify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quantify

Build Status

Allows you to quantify List, Set, Dict or a single value according to a predicate, by returning a Quantifier:

type Quantifier
    = None
    | Some
    | All

Example usage

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