{-# OPTIONS_HADDOCK hide #-}
module Unicode.Internal.Char.UnicodeData.DecomposableK
(isDecomposable)
where
import Data.Bits (Bits(..))
import Data.Char (ord)
import Data.Int (Int8)
import Data.Word (Word16, Word8)
import GHC.Exts (Ptr(..))
import Unicode.Internal.Bits (lookupBit, lookupWord16AsInt, lookupWord8AsInt)
{-# INLINE isDecomposable #-}
isDecomposable :: Char -> Bool
isDecomposable :: Char -> Bool
isDecomposable Char
c = Char
c Char -> Char -> Bool
forall a. Ord a => a -> a -> Bool
>= Char
'\x00A0' Bool -> Bool -> Bool
&& Char
c Char -> Char -> Bool
forall a. Ord a => a -> a -> Bool
<= Char
'\x2FA1D' Bool -> Bool -> Bool
&& Int -> Bool
lookupIsDecomposableBitMap (Char -> Int
ord Char
c)
{-# INLINE lookupIsDecomposableBitMap #-}
lookupIsDecomposableBitMap :: Int -> Bool
lookupIsDecomposableBitMap :: Int -> Bool
lookupIsDecomposableBitMap Int
n =
Addr# -> Int -> Int -> Bool
lookupBit Addr#
data# (
Addr# -> Int -> Int
lookupWord16AsInt Addr#
offsets1# (
Addr# -> Int -> Int
lookupWord8AsInt Addr#
offsets2# (
Int
n Int -> Int -> Int
forall a. Bits a => a -> Int -> a
`shiftR` Int
12
) Int -> Int -> Int
forall a. Num a => a -> a -> a
+ ((Int
n Int -> Int -> Int
forall a. Bits a => a -> Int -> a
`shiftR` Int
9) Int -> Int -> Int
forall a. Bits a => a -> a -> a
.&. Int
maskOffsets)
) Int -> Int -> Int
forall a. Num a => a -> a -> a
+ ((Int
n Int -> Int -> Int
forall a. Bits a => a -> Int -> a
`shiftR` Int
3) Int -> Int -> Int
forall a. Bits a => a -> a -> a
.&. Int
maskData)
) (Int
n Int -> Int -> Int
forall a. Bits a => a -> a -> a
.&. Int
7)
where
maskData :: Int
maskData = (Int
1 Int -> Int -> Int
forall a. Bits a => a -> Int -> a
`shiftL` Int
6) Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
1
maskOffsets :: Int
maskOffsets = (Int
1 Int -> Int -> Int
forall a. Bits a => a -> Int -> a
`shiftL` Int
3) Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
1
!(Ptr Addr#
data#) = Ptr Int8
isDecomposableDataBitMap
!(Ptr Addr#
offsets1#) = Ptr Word16
isDecomposableOffsets1BitMap
!(Ptr Addr#
offsets2#) = Ptr Word8
isDecomposableOffsets2BitMap
isDecomposableDataBitMap :: Ptr Int8
isDecomposableDataBitMap :: Ptr Int8
isDecomposableDataBitMap = Addr# -> Ptr Int8
forall a. Addr# -> Ptr a
Ptr
Addr#
"\1\0\0\0\0\0\64\7\0\80\85\85\165\2\219\54\0\0\16\216\0\80\85\85\165\2\219\54\0\0\144\199\0\0\0\0\0\0\254\255\255\255\255\255\255\255\255\255\255\127\
\\252\255\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\128\0\0\0\0\0\0\0\0\0\0\8\0\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\\255\255\255\255\255\255\255\255\255\255\63\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\48\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\\0\0\0\0\0\0\128\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\128\0\0\0\0\0\0\0\0\0\0\8\0\255\255\255\255\255\255\255\255\255\255\255\
\\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\63\0\0\0\0\0\64\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\16\0\
\\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\8\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\8\0\0\
\\0\0\48\0\0\0\0\0\16\0\0\0\0\0\0\8\32\132\16\0\2\232\3\2\0\8\32\132\16\0\2\0\0\0\0\0\0\0\0\72\0\0\0\0\78\0\0\0\0\0\
\\0\0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0\0\0\
\\0\0\0\0\0\0\0\0\0\0\0\0\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\\255\63\0\0\255\255\255\255\255\255\255\255\252\255\255\255\255\255\255\0\0\0\0\0\255\31\239\255\255\255\150\254\247\10\132\234\150\170\150\247\247\94\255\251\255\15\238\251\255\15\
\\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\255\7\255\255\255\127\255\255\255\255\
\\0\0\0\28\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\8\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\192\0\0\0\
\\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\0\0\0\0\0\0\40\64\2\0\0\
\\0\0\0\160\1\0\0\0\0\0\0\7\0\255\255\255\255\255\15\255\1\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\255\7\255\255\255\127\255\255\255\255\0\0\0\28\0\0\0\0\1\0\0\0\0\0\0\
\\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\8\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\192\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\190\255\255\255\255\255\253\7\0\0\0\0\0\0\0\0\7\0\255\255\
\\255\255\255\15\255\1\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\255\3\0\0\255\255\159\255\247\255\127\15\215\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\31\254\
\\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\127\252\252\252\28\127\127\0\0\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\7\130\0\112\128\
\\216\80\128\3\128\128\0\0\243\255\255\127\255\31\0\1\0\0\0\0\0\0\0\0\0\0\239\254\111\62\87\189\251\251\225\3\255\255\255\255\255\255\0\2\0\12\0\64\0\0\
\\0\224\0\0\0\0\0\0\255\255\255\255\255\255\255\63\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\64\85\4\0\0\0\0\40\11\0\0\0\0\0\0\0\0\0\0\0\
\\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\0\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\\0\0\0\0\0\1\133\60\119\191\255\126\62\191\255\126\190\255\255\252\255\63\255\253\254\249\243\243\255\63\255\255\255\0\0\0\0\3\128\1\0\240\255\255\223\207\255\63\255\255\
\\255\207\192\255\15\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\255\1\0\0\0\63\31\0\0\0\0\0\0\0\0\0\0\0\27\0\0\0\0\0\16\68\240\215\1\0\
\\0\252\1\0\0\124\127\0\0\0\55\2\16\18\0\0\80\176\1\0\146\2\0\0\5\224\51\3\51\3\0\0\0\240\0\0\0\0\0\0\15\60\0\0\0\0\0\0\0\6\
\\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\192\255\255\255\255\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\48\0\0\
\\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\30\3\255\63\229\127\101\252\255\255\
\\255\255\255\255\255\63\255\255\255\255\255\255\255\255\255\255\255\255\255\3\0\0\0\0\127\0\248\160\255\255\127\95\219\255\255\255\255\255\255\255\255\255\255\255\255\255\3\0\0\0\
\\248\255\255\255\255\255\127\255\255\255\255\255\0\255\255\255\255\255\127\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\223\255\255\255\255\255\255\255\255\223\100\222\255\235\239\255\255\255\255\255\255\255\191\231\223\223\255\255\255\123\95\252\253\
\\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\63\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\\255\255\255\255\255\255\255\255\207\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\15\255\255\255\255\255\255\255\255\255\255\255\3\255\255\63\63\255\255\255\255\63\
\\63\255\170\255\255\255\63\255\255\255\255\255\255\223\255\223\255\207\239\255\255\220\127\0\0\0\0\0\0\72\0\0\0\0\78\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\\0\0\0\0\0\0\0\0\0\0\0\0\0\0\25\0\48\0\0\0\0\0\0\16\0\0\0\0\0\0\28\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2\18\0\0\0\0\255\0\0\0\0\0\0\0\0\0\0\0\0\0\24\0\176\0\0\0\0"#
isDecomposableOffsets1BitMap :: Ptr Word16
isDecomposableOffsets1BitMap :: Ptr Word16
isDecomposableOffsets1BitMap = Addr# -> Ptr Word16
forall a. Addr# -> Ptr a
Ptr
Addr#
"\229\5\108\3\52\3\58\2\11\3\58\2\58\2\58\2\65\2\196\6\58\2\58\2\58\2\58\2\50\5\188\9\82\5\75\7\210\2\58\2\47\10\91\10\58\2\58\2\58\2\58\2\58\2\58\2\58\2\58\2\124\9\58\2\91\8\58\2\58\2\58\2\58\2\50\5\188\9\82\5\75\7\0\0\249\9\58\2\58\2\58\2\58\2\58\2\58\2\58\2\
\\58\2\178\2\58\2\178\5\75\6\58\2\58\2\58\2\15\7\58\2\58\2\58\2\58\2\139\7\107\0\137\8\200\8\129\2\195\1\222\1\77\1\135\1\19\1\217\0\58\2\58\2\58\2\58\2\50\8\136\4\149\10\202\7\8\9\192\4\58\2\58\2\30\4\111\0\52\0\58\4\58\2\58\2\58\2\58\2\58\2\4\5\58\2\4\8\58\2\58\2\
\\58\2\58\2\58\2\58\2\146\5"#
isDecomposableOffsets2BitMap :: Ptr Word8
isDecomposableOffsets2BitMap :: Ptr Word8
isDecomposableOffsets2BitMap = Addr# -> Ptr Word8
forall a. Addr# -> Ptr a
Ptr
Addr#
"\65\73\81\41\22\22\22\22\22\22\27\22\22\22\22\10\6\0\22\22\22\22\89\22\22\22\22\22\45\18\97\53\22\22\22\22\22\22\22\22\22\22\22\22\22\22\22\59"#