-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
As it stands (v1), a Filter accepts a function [SearchTerms] -> Ui. A defunctionalized alternative might look like
predicateA ∧ (predicateB ∨ predicateC)
We cannot use the Api of https://package.elm-lang.org/packages/red-g/filter/latest/Filter because it immediately applies the filter, and it checks for a Bool, not for a list.
In Filter, we are working with SearchTerms (Strings) assigned to a given Category.
type alias Filter
= List (Predicate, Ui)
type Predicate
= And Predicate Predicate
| Or Predicate Predicate
| IsSimilarTo { deviation : Int, compareTo : String }
| Contains String
| Equals String
apply : Filter -> List SearchTerm -> Ui
and : Filter -> Filter -> Filter
or : Filter -> Filter -> FilterMetadata
Metadata
Assignees
Labels
No labels