Skip to content

Commit 2a8e3d9

Browse files
committed
WIP: Text: isSubsequenceOf: flip local fun
This way may have more stack reuse.
1 parent f477ba6 commit 2a8e3d9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Data/Text.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,14 +1895,14 @@ isSubsequenceOf tf sf
18951895
where
18961896
subseqOf :: Text -> Text -> Bool
18971897
subseqOf t s =
1898-
on f uncons s t
1898+
on f uncons t s
18991899
where
19001900
f :: Maybe (Char, Text) -> Maybe (Char, Text) -> Bool
1901-
f Nothing _ = True
1902-
f _ Nothing = False
1903-
f (Just (sc,ss)) (Just (tc,ts)) =
1901+
f _ Nothing = True
1902+
f Nothing _ = False
1903+
f (Just (tc,ts)) (Just (sc,ss)) =
19041904
subseqOf ts $
1905-
if sc == tc
1905+
if tc == sc
19061906
then s
19071907
else ss
19081908

0 commit comments

Comments
 (0)