summaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorARJANEN Loïc Jean David <arjanen.loic@gmail.com>2018-04-19 20:48:28 -0400
committerBen Gamari <ben@smart-cactus.org>2018-04-19 20:48:44 -0400
commita26983a3aef25b3fa5f66b4d68ea7240a6dd1543 (patch)
treeb70e53c55424f1cc884bb0d566aae77dd7013339 /libraries
parent257c13d86db0a9ed540287127fd1c79abacf857e (diff)
downloadhaskell-a26983a3aef25b3fa5f66b4d68ea7240a6dd1543.tar.gz
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@gmail.com> Reviewers: hvr, ekmett, lelf, bgamari Reviewed By: bgamari Subscribers: thomie, carter GHC Trac Issues: #10412 Differential Revision: https://phabricator.haskell.org/D4593
Diffstat (limited to 'libraries')
-rw-r--r--libraries/base/GHC/Unicode.hs9
-rw-r--r--libraries/base/cbits/ubconfc2
2 files changed, 5 insertions, 6 deletions
diff --git a/libraries/base/GHC/Unicode.hs b/libraries/base/GHC/Unicode.hs
index 1b8cd0534a..df7c978904 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 509049d664..4d325866bb 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