@@ -100,11 +100,12 @@ import Control.Exception (assert)
100100import Data.Bits ((.&.) )
101101import Data.Char (isAscii , isLatin1 , isAsciiUpper , isAsciiLower , ord )
102102import Data.Ix (Ix )
103- import Unicode.Internal.Division (quotRem28 )
104103
104+ import qualified Unicode.Char.General.Compat as Compat
105105import qualified Unicode.Internal.Char.DerivedCoreProperties as P
106106import qualified Unicode.Internal.Char.PropList as P
107107import qualified Unicode.Internal.Char.UnicodeData.GeneralCategory as UC
108+ import Unicode.Internal.Division (quotRem28 )
108109
109110--------------------------------------------------------------------------------
110111-- General Category
@@ -381,20 +382,19 @@ following 'GeneralCategory's, or 'False' otherwise:
381382
382383prop> isAlphaNum c == Data.Char.isAlphaNum c
383384
385+ __Note:__ this function is incompatible with 'isAlphabetic':
386+
387+ >>> isAlphabetic '\x345'
388+ True
389+ >>> isAlphaNum '\x345'
390+ False
391+
384392@since 0.3.0
385393-}
394+ {-# INLINE isAlphaNum #-}
395+ {-# DEPRECATED isAlphaNum "Use Unicode.Char.General.Compat.isAlphaNum instead." #-}
386396isAlphaNum :: Char -> Bool
387- isAlphaNum c =
388- let ! cp = ord c
389- -- NOTE: The guard constant is updated at each Unicode revision.
390- -- It must be < 0x40000 to be accepted by generalCategoryPlanes0To3.
391- in cp <= UC. MaxIsAlphaNum &&
392- let ! gc = UC. generalCategoryPlanes0To3 cp
393- in gc <= UC. OtherLetter ||
394- (UC. DecimalNumber <= gc && gc <= UC. OtherNumber )
395- -- Use the following in case the previous code is not valid anymore:
396- -- gc <= UC.OtherLetter || (UC.DecimalNumber <= gc && gc <= UC.OtherNumber)
397- -- where !gc = UC.generalCategory c
397+ isAlphaNum = Compat. isAlphaNum
398398
399399{-| Selects control characters, which are the non-printing characters
400400of the Latin-1 subset of Unicode.
0 commit comments