Open upsiflu opened 10 months ago
As it stands (v1), a Filter accepts a function [SearchTerms] -> Ui. A defunctionalized alternative might look like
Filter
[SearchTerms] -> Ui
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 -> Filter
As it stands (v1), a
Filter
accepts a function[SearchTerms] -> Ui
. A defunctionalized alternative might look likepredicateA ∧ (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.