@@ -138,14 +138,14 @@ countTail p s accum = case uncons s of
138
138
139
139
-- | Drops the given number of code points from the beginning of the string. If
140
140
-- | 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 .
142
142
drop :: Int -> String -> String
143
143
drop n s = String .drop (String .length (take n s)) s
144
144
145
145
146
146
-- | 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.
149
149
dropWhile :: (CodePoint -> Boolean ) -> String -> String
150
150
dropWhile p s = drop (count p s) s
151
151
@@ -230,8 +230,8 @@ splitAt i s =
230
230
231
231
-- | Returns a string containing the given number of code points from the
232
232
-- | 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.
235
235
take :: Int -> String -> String
236
236
take = _take takeFallback
237
237
@@ -245,8 +245,8 @@ takeFallback n s = case uncons s of
245
245
246
246
247
247
-- | 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.
250
250
takeWhile :: (CodePoint -> Boolean ) -> String -> String
251
251
takeWhile p s = take (count p s) s
252
252
0 commit comments