Skip to content

Commit 0903ec7

Browse files
committed
resurrect toCharCode and fromCharCode
1 parent 765e1df commit 0903ec7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Data/Char.purs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
-- | A type and functions for single characters.
2+
module Data.Char
3+
( toCharCode
4+
, fromCharCode
5+
) where
6+
7+
-- | Returns the numeric Unicode value of the character.
8+
toCharCode :: Char -> Int
9+
toCharCode = fromEnum
10+
11+
-- | Constructs a character from the given Unicode numeric value.
12+
fromCharCode :: Int -> Maybe Char
13+
fromCharCode = toEnum

0 commit comments

Comments
 (0)