X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FUnicode.hs;h=73e453a117a0a728f96688247fb808a872478035;hb=0058f13e35b873d61929a75118a8b38e78ca4e7e;hp=ceb3c910a84ab55a7d1ca7d7e2fdbc417340921f;hpb=fb80d56c0b7617261c93a808e9001bbb25a7562e;p=ghc-base.git diff --git a/GHC/Unicode.hs b/GHC/Unicode.hs index ceb3c91..73e453a 100644 --- a/GHC/Unicode.hs +++ b/GHC/Unicode.hs @@ -29,9 +29,9 @@ module GHC.Unicode ( ) where import GHC.Base -import GHC.Real (fromIntegral) -import GHC.Int -import GHC.Num (fromInteger) +import GHC.Real (fromIntegral) +import Foreign.C.Types (CInt) +import GHC.Num (fromInteger) #include "HsBaseConfig.h" @@ -63,8 +63,8 @@ isControl :: Char -> Bool -- (letters, numbers, marks, punctuation, symbols and spaces). isPrint :: Char -> Bool --- | Selects white-space characters in the Latin-1 range. --- (In Unicode terms, this includes spaces and some control characters.) +-- | Returns 'True' for any Unicode space character, and the control +-- characters @\t@, @\\n@, @\\r@, @\\f@, @\\v@. isSpace :: Char -> Bool -- isSpace includes non-breaking space -- Done with explicit equalities both for efficiency, and to avoid a tiresome @@ -134,8 +134,6 @@ toTitle :: Char -> Char -- Regardless of the O/S and Library, use the functions contained in WCsubst.c -type CInt = HTYPE_INT - isAlpha c = iswalpha (fromIntegral (ord c)) /= 0 isAlphaNum c = iswalnum (fromIntegral (ord c)) /= 0 --isSpace c = iswspace (fromIntegral (ord c)) /= 0 @@ -148,9 +146,6 @@ toLower c = chr (fromIntegral (towlower (fromIntegral (ord c)))) toUpper c = chr (fromIntegral (towupper (fromIntegral (ord c)))) toTitle c = chr (fromIntegral (towtitle (fromIntegral (ord c)))) -foreign import ccall unsafe "u_iswdigit" - iswdigit :: CInt -> CInt - foreign import ccall unsafe "u_iswalpha" iswalpha :: CInt -> CInt