[commit: ghc] master: Fixes isAlphaNum re. isAlpha/isNumber and doc fix (trac issue #10412) (a26983a)
git at git.haskell.org
git at git.haskell.org
Fri Apr 20 03:00:53 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/a26983a3aef25b3fa5f66b4d68ea7240a6dd1543/ghc
>---------------------------------------------------------------
commit a26983a3aef25b3fa5f66b4d68ea7240a6dd1543
Author: ARJANEN Loïc Jean David <arjanen.loic at gmail.com>
Date: Thu Apr 19 20:48:28 2018 -0400
Fixes isAlphaNum re. isAlpha/isNumber and doc fix (trac issue #10412)
Corrects the inconsistency between Data.Char.isAlphaNum,
Data.Char.isAlpha and Data.Char.isNumber. Indeed, isAlphaNum was
returning True not only when isAlpha or isNumber returned True but
also when isMark did. The selectors for the Mn, Mc and Me general
categories where removed from the macro generating u_iswalnum in
ubconfc.
Also, Data.Char.isAlphaNum's documentation was changed to state that
isAlphaNum returns true not only for Unicode number digits but for
Unicode numbers in general in Unicode.hs.
Signed-off-by: ARJANEN Loïc Jean David <arjanen.loic at gmail.com>
Reviewers: hvr, ekmett, lelf, bgamari
Reviewed By: bgamari
Subscribers: thomie, carter
GHC Trac Issues: #10412
Differential Revision: https://phabricator.haskell.org/D4593
>---------------------------------------------------------------
a26983a3aef25b3fa5f66b4d68ea7240a6dd1543
libraries/base/GHC/Unicode.hs | 9 +++++----
libraries/base/cbits/ubconfc | 2 --
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/libraries/base/GHC/Unicode.hs b/libraries/base/GHC/Unicode.hs
index 1b8cd05..df7c978 100644
--- a/libraries/base/GHC/Unicode.hs
+++ b/libraries/base/GHC/Unicode.hs
@@ -220,11 +220,12 @@ isLower :: Char -> Bool
-- This function is equivalent to 'Data.Char.isLetter'.
isAlpha :: Char -> Bool
--- | Selects alphabetic or numeric digit Unicode characters.
+-- | Selects alphabetic or numeric Unicode characters.
--
--- Note that numeric digits outside the ASCII range are selected by this
--- function but not by 'isDigit'. Such digits may be part of identifiers
--- but are not used by the printer and reader to represent numbers.
+-- Note that numeric digits outside the ASCII range, as well as numeric
+-- characters which aren't digits, are selected by this function but not by
+-- 'isDigit'. Such characters may be part of identifiers but are not used by
+-- the printer and reader to represent numbers.
isAlphaNum :: Char -> Bool
-- | Selects ASCII digits, i.e. @\'0\'@..@\'9\'@.
diff --git a/libraries/base/cbits/ubconfc b/libraries/base/cbits/ubconfc
index 509049d..4d32586 100644
--- a/libraries/base/cbits/ubconfc
+++ b/libraries/base/cbits/ubconfc
@@ -322,7 +322,6 @@ unipred(u_iswalpha,(GENCAT_LL|GENCAT_LU|GENCAT_LT|GENCAT_LM|GENCAT_LO))
unipred(u_iswdigit,GENCAT_ND)
unipred(u_iswalnum,(GENCAT_LT|GENCAT_LU|GENCAT_LL|GENCAT_LM|GENCAT_LO|
- GENCAT_MC|GENCAT_ME|GENCAT_MN|
GENCAT_NO|GENCAT_ND|GENCAT_NL))
#define caseconv(p,to) \\
@@ -341,5 +340,4 @@ HsInt u_gencat(HsInt c)
{
return getrule(allchars,NUM_BLOCKS,c)->catnumber;
}
-
EOF
More information about the ghc-commits
mailing list