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
-- Gives:
-- [ { name = "Elm" }
-- , { name = "Haskell"}
-- , { name = "English"}
-- ]root strips a word down to just the lower case version of itself
without any punctuation or spacing.
root "Wow, I'm excited!!!!" --> "wowimexcited"
matchallows you to see if the letters of your query match within a bigger string.