Skip to content

Commit

Permalink
Revert "fixes elm#970"
Browse files Browse the repository at this point in the history
This reverts commit ae7faa7.
This patch was not correct and was causing a compiler error due to not explicitly import == and /= in Char.elm
  • Loading branch information
rupertlssmith committed May 23, 2023
1 parent 084fa2b commit 86fec35
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/Char.elm
Original file line number Diff line number Diff line change
Expand Up @@ -66,42 +66,46 @@ type Char = Char -- NOTE: The compiler provides the real implementation.
-- CLASSIFICATION


{-| Detect upper case Unicode characters.
{-| Detect upper case ASCII characters.
isUpper 'A' == True
isUpper 'B' == True
...
isUpper 'Z' == True
isUpper 'Σ' == True
isUpper '0' == False
isUpper 'a' == False
isUpper '-' == False
isUpper 'Σ' == False
-}
isUpper : Char -> Bool
isUpper char =
(char == Char.toUpper char)
&& (char /= Char.toLower char)
let
code =
toCode char
in
code <= 0x5A && 0x41 <= code


{-| Detect lower case Unicode characters.
{-| Detect lower case ASCII characters.
isLower 'a' == True
isLower 'b' == True
...
isLower 'z' == True
isLower 'π' == True
isLower '0' == False
isLower 'A' == False
isLower '-' == False
isLower 'π' == False
-}
isLower : Char -> Bool
isLower char =
(char == Char.toLower char)
&& (char /= Char.toUpper char)
let
code =
toCode char
in
0x61 <= code && code <= 0x7A


{-| Detect upper case and lower case ASCII characters.
Expand Down

0 comments on commit 86fec35

Please sign in to comment.