Skip to content

Commit

Permalink
WIP: Text: isSubsequenceOf: flip local fun
Browse files Browse the repository at this point in the history
This way may have more stack reuse.
  • Loading branch information
Anton-Latukha committed Sep 28, 2021
1 parent d4397a7 commit 505ffd3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Data/Text.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1891,14 +1891,14 @@ isSubsequenceOf tf sf
where
subseqOf :: Text -> Text -> Bool
subseqOf t s =
on f uncons s t
on f uncons t s
where
f :: Maybe (Char, Text) -> Maybe (Char, Text) -> Bool
f Nothing _ = True
f _ Nothing = False
f (Just (sc,ss)) (Just (tc,ts)) =
f _ Nothing = True
f Nothing _ = False
f (Just (tc,ts)) (Just (sc,ss)) =
subseqOf ts $
if sc == tc
if tc == sc
then s
else ss

Expand Down

0 comments on commit 505ffd3

Please sign in to comment.