New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify isUpper and isLower use ASCII #385

Merged
merged 1 commit into from Jan 18, 2016

Conversation

Projects
None yet
4 participants
@ianbollinger
Contributor

ianbollinger commented Sep 1, 2015

Clarify that Char.isUpper and Char.isLower only recognize ASCII letters.

Clarify isUpper and isLower use ASCII
Clarify that `Char.isUpper` and `Char.isLower` only recognize ASCII
letters.
@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Nov 19, 2015

Member

What do you think of using this approach instead? Looks like we could capture unicode stuff as well, but honestly, I'm not 100% sure what that means in practice.

Member

evancz commented Nov 19, 2015

What do you think of using this approach instead? Looks like we could capture unicode stuff as well, but honestly, I'm not 100% sure what that means in practice.

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender Jan 18, 2016

Contributor

I'm going to merge the documentation change here. It is a fact that the current implementations of isUpper and isLower work only for ASCII characters. Making them work for unicode characters would be a separate issue. Right now, the documentation should state the correct thing, which this PR achieves.

Contributor

jvoigtlaender commented Jan 18, 2016

I'm going to merge the documentation change here. It is a fact that the current implementations of isUpper and isLower work only for ASCII characters. Making them work for unicode characters would be a separate issue. Right now, the documentation should state the correct thing, which this PR achieves.

jvoigtlaender added a commit that referenced this pull request Jan 18, 2016

Merge pull request #385 from ianbollinger/clarify-char-docs
Clarify isUpper and isLower use ASCII

@jvoigtlaender jvoigtlaender merged commit d791918 into elm:master Jan 18, 2016

1 check failed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
@rofrol

This comment has been minimized.

Show comment
Hide comment
@rofrol

rofrol May 27, 2016

@evancz I like this approach better http://stackoverflow.com/questions/1027224/how-can-i-test-if-a-letter-in-a-string-is-uppercase-or-lowercase-using-javascrip/9728437#9728437

And here is a quick workaround in elm:

isUpper: Char -> Bool
isUpper c =
  let
    s = String.fromChar c
  in
    s == String.toUpper s && s /= String.toLower s

isLower: Char -> Bool
isLower c =
  let
    s = String.fromChar c
  in
    s /= String.toUpper s && s == String.toLower s

rofrol commented May 27, 2016

@evancz I like this approach better http://stackoverflow.com/questions/1027224/how-can-i-test-if-a-letter-in-a-string-is-uppercase-or-lowercase-using-javascrip/9728437#9728437

And here is a quick workaround in elm:

isUpper: Char -> Bool
isUpper c =
  let
    s = String.fromChar c
  in
    s == String.toUpper s && s /= String.toLower s

isLower: Char -> Bool
isLower c =
  let
    s = String.fromChar c
  in
    s /= String.toUpper s && s == String.toLower s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment