File tree 1 file changed +19
-5
lines changed 1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -1879,11 +1879,25 @@ isInfixOf needle haystack
1879
1879
| otherwise = not . L. null . indices needle $ haystack
1880
1880
{-# INLINE [1] isInfixOf #-}
1881
1881
1882
- -- | The 'isSubsequenceOf' function takes two 'Text's and returns
1883
- -- 'True' iff the second is a subsequence of the first.
1884
- -- (characters of the second argument appear in same sequential order in
1885
- -- the first, to say if second argument can be derived by deleting some
1886
- -- or no elements from the first).
1882
+ -- 2021-09-29: NOTE:
1883
+ -- * after the implementation - determine & mention the big O
1884
+ -- | The 'isSubsequenceOf' function takes the main text and the subsequnce
1885
+ -- to find and returns 'True' iff the second argument is a subsequence
1886
+ -- of the first.
1887
+ --
1888
+ -- "Subsequence" used in the meaning of: characters of the second argument
1889
+ -- appear in same sequential order in the main data, to say second argument can
1890
+ -- be derived by deleting some (any) or no elements from the first.
1891
+ --
1892
+ -- Examples:
1893
+ --
1894
+ -- >>> isSubsequenceOf "1234567" "1356"
1895
+ -- True
1896
+ --
1897
+ -- >>> isSubsequenceOf "1234567" "21"
1898
+ -- False
1899
+ --
1900
+ -- `isSubsequenceOf` is the base case & implementation of fuzzy search.
1887
1901
isSubsequenceOf :: Text -> Text -> Bool
1888
1902
isSubsequenceOf tf sf
1889
1903
| length sf > length tf = False
You can’t perform that action at this time.
0 commit comments