File tree Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -66,46 +66,42 @@ type Char = Char -- NOTE: The compiler provides the real implementation.
6666-- CLASSIFICATION
6767
6868
69- {- | Detect upper case ASCII characters.
69+ {- | Detect upper case Unicode characters.
7070
7171 isUpper 'A' == True
7272 isUpper 'B' == True
7373 ...
7474 isUpper 'Z' == True
75+
76+ isUpper 'Σ' == True
7577
7678 isUpper '0' == False
7779 isUpper 'a' == False
7880 isUpper '-' == False
79- isUpper 'Σ' == False
8081-}
8182isUpper : Char -> Bool
8283isUpper char =
83- let
84- code =
85- toCode char
86- in
87- code <= 0x5A && 0x41 <= code
84+ ( char == Char . toUpper char)
85+ && ( char /= Char . toLower char)
8886
8987
90- {- | Detect lower case ASCII characters.
88+ {- | Detect lower case Unicode characters.
9189
9290 isLower 'a' == True
9391 isLower 'b' == True
9492 ...
9593 isLower 'z' == True
94+
95+ isLower 'π' == True
9696
9797 isLower '0' == False
9898 isLower 'A' == False
9999 isLower '-' == False
100- isLower 'π' == False
101100-}
102101isLower : Char -> Bool
103102isLower char =
104- let
105- code =
106- toCode char
107- in
108- 0x61 <= code && code <= 0x7A
103+ ( char == Char . toLower char)
104+ && ( char /= Char . toUpper char)
109105
110106
111107{- | Detect upper case and lower case ASCII characters.
You can’t perform that action at this time.
0 commit comments