Skip to content

Commit 86fec35

Browse files
committed
Revert "fixes elm#970"
This reverts commit ae7faa7. This patch was not correct and was causing a compiler error due to not explicitly import == and /= in Char.elm
1 parent 084fa2b commit 86fec35

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

src/Char.elm

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,42 +66,46 @@ type Char = Char -- NOTE: The compiler provides the real implementation.
6666
-- CLASSIFICATION
6767

6868

69-
{-| Detect upper case Unicode characters.
69+
{-| Detect upper case ASCII characters.
7070
7171
isUpper 'A' == True
7272
isUpper 'B' == True
7373
...
7474
isUpper 'Z' == True
75-
76-
isUpper 'Σ' == True
7775
7876
isUpper '0' == False
7977
isUpper 'a' == False
8078
isUpper '-' == False
79+
isUpper 'Σ' == False
8180
-}
8281
isUpper : Char -> Bool
8382
isUpper char =
84-
(char == Char.toUpper char)
85-
&& (char /= Char.toLower char)
83+
let
84+
code =
85+
toCode char
86+
in
87+
code <= 0x5A && 0x41 <= code
8688

8789

88-
{-| Detect lower case Unicode characters.
90+
{-| Detect lower case ASCII characters.
8991
9092
isLower 'a' == True
9193
isLower 'b' == True
9294
...
9395
isLower 'z' == True
94-
95-
isLower 'π' == True
9696
9797
isLower '0' == False
9898
isLower 'A' == False
9999
isLower '-' == False
100+
isLower 'π' == False
100101
-}
101102
isLower : Char -> Bool
102103
isLower char =
103-
(char == Char.toLower char)
104-
&& (char /= Char.toUpper char)
104+
let
105+
code =
106+
toCode char
107+
in
108+
0x61 <= code && code <= 0x7A
105109

106110

107111
{-| Detect upper case and lower case ASCII characters.

0 commit comments

Comments
 (0)