mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
X.P.FuzzyMatch: Use isSubsequenceOf
The implementation is exactly the same, just that this function is now in base, so there should be no change in behaviour.
This commit is contained in:
parent
56cc296754
commit
c36a888a59
@ -68,10 +68,7 @@ import qualified Data.List.NonEmpty as NE
|
||||
-- | Returns True if the first argument is a subsequence of the second argument,
|
||||
-- that is, it can be obtained from the second sequence by deleting elements.
|
||||
fuzzyMatch :: String -> String -> Bool
|
||||
fuzzyMatch [] _ = True
|
||||
fuzzyMatch _ [] = False
|
||||
fuzzyMatch xxs@(x:xs) (y:ys) | toLower x == toLower y = fuzzyMatch xs ys
|
||||
| otherwise = fuzzyMatch xxs ys
|
||||
fuzzyMatch a b = isSubsequenceOf (map toLower a) (map toLower b)
|
||||
|
||||
-- | Sort the given set of strings by how well they match. Match quality is
|
||||
-- measured first by the length of the substring containing the match and second
|
||||
|
Loading…
x
Reference in New Issue
Block a user