X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FUnicode.hs;h=b34f677069d1f12fb6d6514192b0b33886747122;hb=5a984d7cfa6cc8d7d57c83d12e439d9015564761;hp=83e2a03cb5123d85838c20c94a59a4d7c92d99d5;hpb=06ffe41b5a1730c93f5e3add2d0f32fe6677d223;p=ghc-base.git diff --git a/GHC/Unicode.hs b/GHC/Unicode.hs index 83e2a03..b34f677 100644 --- a/GHC/Unicode.hs +++ b/GHC/Unicode.hs @@ -1,6 +1,7 @@ -{-# OPTIONS_GHC -XNoImplicitPrelude #-} +{-# LANGUAGE CPP, NoImplicitPrelude, ForeignFunctionInterface #-} {-# OPTIONS -#include "WCsubst.h" #-} {-# OPTIONS_HADDOCK hide #-} + ----------------------------------------------------------------------------- -- | -- Module : GHC.Unicode @@ -29,9 +30,8 @@ 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) #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