@@ -79,7 +79,7 @@ For details of the underlying implementation, see [String Reference at MDN](http
7979#### ` charAt `
8080
8181``` purescript
82- charAt :: Number -> String -> Maybe Char
82+ charAt :: Int -> String -> Maybe Char
8383```
8484
8585Returns the character at the given index, if the index is within bounds.
@@ -104,7 +104,7 @@ Same as `fromChar`.
104104#### ` charCodeAt `
105105
106106``` purescript
107- charCodeAt :: Number -> String -> Maybe Number
107+ charCodeAt :: Int -> String -> Maybe Int
108108```
109109
110110Returns the numeric Unicode value of the character at the given index,
@@ -152,29 +152,37 @@ fromCharArray :: [Char] -> String
152152
153153Converts an array of characters into a string.
154154
155+ #### ` contains `
156+
157+ ``` purescript
158+ contains :: String -> String -> Boolean
159+ ```
160+
161+ Checks whether the first string exists in the second string.
162+
155163#### ` indexOf `
156164
157165``` purescript
158- indexOf :: String -> String -> Number
166+ indexOf :: String -> String -> Maybe Int
159167```
160168
161169Returns the index of the first occurrence of the first string in the
162- second string. Returns ` -1 ` if there is no match.
170+ second string. Returns ` Nothing ` if there is no match.
163171
164172#### ` indexOf' `
165173
166174``` purescript
167- indexOf' :: String -> Number -> String -> Number
175+ indexOf' :: String -> Int -> String -> Maybe Int
168176```
169177
170178Returns the index of the first occurrence of the first string in the
171- second string, starting at the given index. Returns ` -1 ` if there is
179+ second string, starting at the given index. Returns ` Nothing ` if there is
172180no match.
173181
174182#### ` lastIndexOf `
175183
176184``` purescript
177- lastIndexOf :: String -> String -> Number
185+ lastIndexOf :: String -> String -> Maybe Int
178186```
179187
180188Returns the index of the last occurrence of the first string in the
@@ -183,31 +191,28 @@ second string. Returns `-1` if there is no match.
183191#### ` lastIndexOf' `
184192
185193``` purescript
186- lastIndexOf' :: String -> Number -> String -> Number
194+ lastIndexOf' :: String -> Int -> String -> Maybe Int
187195```
188196
189- Returns the index of the first occurrence of the last string in the
190- second string, starting at the given index. Returns ` -1 ` if there is
197+ Returns the index of the last occurrence of the first string in the
198+ second string, starting at the given index. Returns ` Nothing ` if there is
191199no match.
192200
193201#### ` length `
194202
195203``` purescript
196- length :: String -> Number
204+ length :: String -> Int
197205```
198206
199207Returns the number of characters the string is composed of.
200208
201209#### ` localeCompare `
202210
203211``` purescript
204- localeCompare :: String -> String -> Number
212+ localeCompare :: String -> String -> Ordering
205213```
206214
207- Locale-aware sort order comparison. Returns a negative number if the
208- first string occurs before the second in a sort, a positive number
209- if the first string occurs after the second, and ` 0 ` if their sort order
210- is equal.
215+ Locale-aware sort order comparison.
211216
212217#### ` replace `
213218
@@ -220,23 +225,23 @@ Replaces the first occurence of the first argument with the second argument.
220225#### ` take `
221226
222227``` purescript
223- take :: Number -> String -> String
228+ take :: Int -> String -> String
224229```
225230
226231Returns the first ` n ` characters of the string.
227232
228233#### ` drop `
229234
230235``` purescript
231- drop :: Number -> String -> String
236+ drop :: Int -> String -> String
232237```
233238
234239Returns the string without the first ` n ` characters.
235240
236241#### ` count `
237242
238243``` purescript
239- count :: (Char -> Boolean) -> String -> Number
244+ count :: (Char -> Boolean) -> String -> Int
240245```
241246
242247Returns the number of characters in the string for which the predicate holds.
@@ -413,7 +418,7 @@ See the [reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe
413418#### ` search `
414419
415420``` purescript
416- search :: Regex -> String -> Number
421+ search :: Regex -> String -> Int
417422```
418423
419424Returns the index of the first match of the ` Regex ` in the string, or
@@ -436,7 +441,7 @@ Unsafe string and character functions.
436441#### ` charCodeAt `
437442
438443``` purescript
439- charCodeAt :: Number -> String -> Number
444+ charCodeAt :: Int -> String -> Int
440445```
441446
442447Returns the numeric Unicode value of the character at the given index.
@@ -446,7 +451,7 @@ Returns the numeric Unicode value of the character at the given index.
446451#### ` charAt `
447452
448453``` purescript
449- charAt :: Number -> String -> Char
454+ charAt :: Int -> String -> Char
450455```
451456
452457Returns the character at the given index.
0 commit comments