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
129129
130130countFallback :: (CodePoint -> Boolean ) -> String -> Int
131131countFallback 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
137137
138138
139139-- | Drops the given number of code points from the beginning of the string. If
@@ -263,10 +263,10 @@ foreign import _toCodePointArray
263263 -> Array CodePoint
264264
265265toCodePointArrayFallback :: 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'
270270
271271
272272-- | 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