import Util ( maybePrefixMatch, readRational )
import DATA_BITS
-import Data.Char
+import Data.Char ( chr )
import Ratio
--import TRACE
#if __GLASGOW_HASKELL__ >= 605
-import Data.Char ( GeneralCategory(..), generalCategory )
+import Data.Char ( GeneralCategory(..), generalCategory, isPrint, isUpper )
#else
-import Compat.Unicode ( GeneralCategory(..), generalCategory )
+import Compat.Unicode ( GeneralCategory(..), generalCategory, isPrint, isUpper )
#endif
}
{-# OPTIONS -cpp #-}
module Compat.Unicode (
- GeneralCategory(..), generalCategory,
+ GeneralCategory(..), generalCategory, isPrint, isUpper
) where
#if __GLASGOW_HASKELL__ > 604
foreign import ccall unsafe "u_gencat"
wgencat :: CInt -> Int
+
+isPrint c = iswprint (fromIntegral (ord c)) /= 0
+isUpper c = iswupper (fromIntegral (ord c)) /= 0
+
+foreign import ccall unsafe "u_iswprint"
+ iswprint :: CInt -> CInt
+
+foreign import ccall unsafe "u_iswupper"
+ iswupper :: CInt -> CInt
#endif