@@ -138,14 +138,14 @@ countTail p s accum = case uncons s of
138138
139139-- | Drops the given number of code points from the beginning of the string. If
140140-- | the string does not have that many code points, returns the empty string.
141- -- | Operates in space and time linear to the length of the string .
141+ -- | Operates in constant space and in time linear to the given number .
142142drop :: Int -> String -> String
143143drop n s = String .drop (String .length (take n s)) s
144144
145145
146146-- | Drops the leading sequence of code points which all match the given
147- -- | predicate from the string. Operates in space and time linear to the
148- -- | length of the string.
147+ -- | predicate from the string. Operates in constant space and in time linear
148+ -- | to the length of the string.
149149dropWhile :: (CodePoint -> Boolean ) -> String -> String
150150dropWhile p s = drop (count p s) s
151151
@@ -230,8 +230,8 @@ splitAt i s =
230230
231231-- | Returns a string containing the given number of code points from the
232232-- | beginning of the given string. If the string does not have that many code
233- -- | points, returns the empty string. Operates in space and time linear to the
234- -- | given number.
233+ -- | points, returns the empty string. Operates in constant space and in time
234+ -- | linear to the given number.
235235take :: Int -> String -> String
236236take = _take takeFallback
237237
@@ -245,8 +245,8 @@ takeFallback n s = case uncons s of
245245
246246
247247-- | Returns a string containing the leading sequence of code points which all
248- -- | match the given predicate from the string. Operates in space and time
249- -- | linear to the length of the string.
248+ -- | match the given predicate from the string. Operates in constant space and
249+ -- | in time linear to the length of the string.
250250takeWhile :: (CodePoint -> Boolean ) -> String -> String
251251takeWhile p s = take (count p s) s
252252
0 commit comments