File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -129,11 +129,11 @@ foreign import _count
129
129
130
130
countFallback :: (CodePoint -> Boolean ) -> String -> Int
131
131
countFallback p s = countTail p s 0
132
- where
133
- countTail :: (CodePoint -> Boolean ) -> String -> Int -> Int
134
- countTail p' s' accum = case uncons s' of
135
- Just { head, tail } -> if p' head then countTail p' tail (accum + 1 ) else accum
136
- _ -> accum
132
+
133
+ countTail :: (CodePoint -> Boolean ) -> String -> Int -> Int
134
+ countTail p s accum = case uncons s of
135
+ Just { head, tail } -> if p head then countTail p tail (accum + 1 ) else accum
136
+ _ -> accum
137
137
138
138
139
139
-- | Drops the given number of code points from the beginning of the string. If
@@ -263,10 +263,10 @@ foreign import _toCodePointArray
263
263
-> Array CodePoint
264
264
265
265
toCodePointArrayFallback :: String -> Array CodePoint
266
- toCodePointArrayFallback s = unfoldr decode s
267
- where
268
- decode :: String -> Maybe (Tuple CodePoint String )
269
- decode s' = (\{ head, tail } -> Tuple head tail) <$> uncons s'
266
+ toCodePointArrayFallback s = unfoldr unconsButWithTuple s
267
+
268
+ unconsButWithTuple :: String -> Maybe (Tuple CodePoint String )
269
+ unconsButWithTuple s' = (\{ head, tail } -> Tuple head tail) <$> uncons s'
270
270
271
271
272
272
-- | Returns a record with the first code point and the remaining code points
You can’t perform that action at this time.
0 commit comments