red-g/filter/2.0.1

NOTE: the latest version is 2.0.3

filter

Elm library for manipulating filters.

examples

Implementing a greater-than-or-equals Filter through composition:

gte : Int -> Filter Int
gte num =
  Filter.or Filter.eq (Filter.gt num)

Filter.test (gte 3) 3
-- Pass

Filter.test (gte 4) 5
-- Pass

Filter.test (gte 1) -1
-- Fail

Ensuring that one of a list of conditions is passed:

myLongFilter : Filter Thing
myLongFilter =
  Filter.any [ thingIsGreen, thingIsWide, thingIsHeavy ]

Filter.list myLongFilter [ greenThing, yellowThing, wideThing, lightThing, heavyThing ]
-- [ greenThing, wideThing, heavyThing ]