@@ -9,7 +9,7 @@ module Data.String.CodePoints
99 , codePointFromInt
1010 , codePointToInt
1111 , codePointFromChar
12- , count
12+ , countPrefix
1313 , drop
1414 , dropWhile
1515 , fromCodePointArray
@@ -168,14 +168,14 @@ codePointAtFallback n s = case uncons s of
168168-- | time linear to the length of the string.
169169-- |
170170-- | ```purescript
171- -- | >>> count (\c -> codePointToInt c == 0x1D400) "𝐀𝐀 b c 𝐀"
171+ -- | >>> countPrefix (\c -> codePointToInt c == 0x1D400) "𝐀𝐀 b c 𝐀"
172172-- | 2
173173-- | ```
174174-- |
175- count :: (CodePoint -> Boolean ) -> String -> Int
176- count = _count countFallback unsafeCodePointAt0
175+ countPrefix :: (CodePoint -> Boolean ) -> String -> Int
176+ countPrefix = _countPrefix countFallback unsafeCodePointAt0
177177
178- foreign import _count
178+ foreign import _countPrefix
179179 :: ((CodePoint -> Boolean ) -> String -> Int )
180180 -> (String -> CodePoint )
181181 -> (CodePoint -> Boolean )
@@ -217,7 +217,7 @@ drop n s = String.drop (String.length (take n s)) s
217217-- | ```
218218-- |
219219dropWhile :: (CodePoint -> Boolean ) -> String -> String
220- dropWhile p s = drop (count p s) s
220+ dropWhile p s = drop (countPrefix p s) s
221221
222222
223223-- | Creates a string from an array of code points. Operates in space and time
@@ -402,7 +402,7 @@ takeFallback n s = case uncons s of
402402-- | ```
403403-- |
404404takeWhile :: (CodePoint -> Boolean ) -> String -> String
405- takeWhile p s = take (count p s) s
405+ takeWhile p s = take (countPrefix p s) s
406406
407407
408408-- | Creates an array of code points from a string. Operates in space and time
0 commit comments