File tree Expand file tree Collapse file tree 4 files changed +35
-6
lines changed Expand file tree Collapse file tree 4 files changed +35
-6
lines changed Original file line number Diff line number Diff line change @@ -26,4 +26,20 @@ fromCharCode :: Int -> Char
26
26
27
27
Constructs a character from the given Unicode numeric value.
28
28
29
+ #### ` toLowerChar `
30
+
31
+ ``` purescript
32
+ toLowerChar :: Char -> Char
33
+ ```
34
+
35
+ Converts a character to lowercase.
36
+
37
+ #### ` toUpperChar `
38
+
39
+ ``` purescript
40
+ toUpperChar :: Char -> Char
41
+ ```
42
+
43
+ Converts a character to uppercase.
44
+
29
45
Original file line number Diff line number Diff line change @@ -198,8 +198,9 @@ of the string for which the predicate holds.
198
198
split :: String -> String -> Array String
199
199
```
200
200
201
- Returns the substrings of the first string separated along occurences
202
- of the second string.
201
+ Returns the substrings of the second string separated along occurences
202
+ of the first string.
203
+ * ` split " " "hello world" == ["hello", "world"] `
203
204
204
205
#### ` toCharArray `
205
206
Original file line number Diff line number Diff line change @@ -14,3 +14,11 @@ exports.toCharCode = function (c) {
14
14
exports . fromCharCode = function ( c ) {
15
15
return String . fromCharCode ( c ) ;
16
16
} ;
17
+
18
+ exports . toLowerChar = function ( c ) {
19
+ return c . toLowerCase ( ) ;
20
+ } ;
21
+
22
+ exports . toUpperChar = function ( c ) {
23
+ return c . toUpperCase ( ) ;
24
+ } ;
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ module Data.Char
3
3
( toString
4
4
, fromCharCode
5
5
, toCharCode
6
+ , toLowerChar
7
+ , toUpperChar
6
8
) where
7
9
8
10
import Prelude
@@ -16,11 +18,13 @@ foreign import toCharCode :: Char -> Int
16
18
-- | Constructs a character from the given Unicode numeric value.
17
19
foreign import fromCharCode :: Int -> Char
18
20
21
+ -- | Converts a character to lowercase.
22
+ foreign import toLowerChar :: Char -> Char
23
+
24
+ -- | Converts a character to uppercase.
25
+ foreign import toUpperChar :: Char -> Char
26
+
19
27
-- | Characters fall within the Unicode range.
20
28
instance boundedChar :: Bounded Char where
21
29
top = fromCharCode zero
22
30
bottom = fromCharCode 65535
23
-
24
- -- | Characters can be rendered as a string with `show`.
25
- instance showChar :: Show Char where
26
- show c = " Char " ++ show (toString c)
You can’t perform that action at this time.
0 commit comments