Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
newtype Char


### Type Class Instances

instance eqChar :: Eq Char

instance ordChar :: Ord Char

instance showChar :: Show Char


### Values

charString :: Char -> String
Expand Down
10 changes: 10 additions & 0 deletions src/Data/Char/Char.purs
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,13 @@ module Data.Char
\ return String.fromCharCode(c);\
\}" :: Number -> Char

instance eqChar :: Eq Char where
(==) (Char a) (Char b) = a == b

(/=) a b = not (a == b)

instance ordChar :: Ord Char where
compare (Char a) (Char b) = a `compare` b

instance showChar :: Show Char where
show (Char s) = "Char " ++ show s