Fuzzy match through a list of strings
filter will filter an arbitrary list of objects given a function that
converts the object to value you want to match on
let
languages =
[ { name = "Elm" }
, { name = "Ruby" }
, { name = "Rust" }
, { name = "Haskell" }
, { name = "javascript" }
, { name = "English" }
]
in
filter .name "el" languages
--> [ { name = "Elm" }
--> , { name = "Haskell"}
--> , { name = "English"}
--> ]root strips a word down to just the lower case version of itself
without any punctuation or spacing. Digits are retained.
root "Wow, I'm excited!!!!" --> "wowimexcited"
root "I'm excited 2!" --> "imexcited2"
matchallows you to see if the letters of your query match within a bigger string.