packages feed

idna2008-1.0.0.0: internal/Text/IDNA2008/Internal/Width/Data.hs

-- |
-- Module      : Text.IDNA2008.Internal.Width.Data
-- Description : Compact codepoint mapping table for the Unicode
--               wide \/ narrow decompositions consumed by the
--               RFC 5895 section 2.2 (fullwidth\/halfwidth) mapping.
-- Copyright   : (c) Viktor Dukhovni, 2026
-- License     : BSD-3-Clause
--
-- Maintainer  : ietf-dane@dukhovni.org
-- Stability   : unstable
--
-- AUTOMATICALLY GENERATED.  Do not edit by hand.  Regenerate with:
--
--   python3 internal/tools/genIdnaWidth.py <unicode-version> \\
--           <UnicodeData.txt>
--
-- Source: https://www.unicode.org/Public/17.0.0/ucd/UnicodeData.txt
-- Aligned with: Unicode 17.0.0
-- Width-mapping entries: 226
--
-- Each entry is a single-codepoint decomposition: a fullwidth or
-- halfwidth codepoint that maps to a single canonical-width target.
-- Stored as two parallel sorted arrays -- 'widthSources' (source
-- codepoints, sorted ascending) and 'widthTargets' (the targets, in
-- the same order).  Lookup is binary search over 'widthSources'.
module Text.IDNA2008.Internal.Width.Data
    ( widthRangeCount
    , widthSources
    , widthTargets
    ) where

import Data.Array.Byte (ByteArray)
import Data.Word (Word32)
import qualified Data.Primitive.ByteArray as PBA

-- | Number of (source, target) entries.
widthRangeCount :: Int
widthRangeCount = 226

-- | Source codepoints, sorted ascending.
widthSources :: ByteArray
widthSources = PBA.byteArrayFromList
    [ (0x003000 :: Word32)
    , 0x00FF01
    , 0x00FF02
    , 0x00FF03
    , 0x00FF04
    , 0x00FF05
    , 0x00FF06
    , 0x00FF07
    , 0x00FF08
    , 0x00FF09
    , 0x00FF0A
    , 0x00FF0B
    , 0x00FF0C
    , 0x00FF0D
    , 0x00FF0E
    , 0x00FF0F
    , 0x00FF10
    , 0x00FF11
    , 0x00FF12
    , 0x00FF13
    , 0x00FF14
    , 0x00FF15
    , 0x00FF16
    , 0x00FF17
    , 0x00FF18
    , 0x00FF19
    , 0x00FF1A
    , 0x00FF1B
    , 0x00FF1C
    , 0x00FF1D
    , 0x00FF1E
    , 0x00FF1F
    , 0x00FF20
    , 0x00FF21
    , 0x00FF22
    , 0x00FF23
    , 0x00FF24
    , 0x00FF25
    , 0x00FF26
    , 0x00FF27
    , 0x00FF28
    , 0x00FF29
    , 0x00FF2A
    , 0x00FF2B
    , 0x00FF2C
    , 0x00FF2D
    , 0x00FF2E
    , 0x00FF2F
    , 0x00FF30
    , 0x00FF31
    , 0x00FF32
    , 0x00FF33
    , 0x00FF34
    , 0x00FF35
    , 0x00FF36
    , 0x00FF37
    , 0x00FF38
    , 0x00FF39
    , 0x00FF3A
    , 0x00FF3B
    , 0x00FF3C
    , 0x00FF3D
    , 0x00FF3E
    , 0x00FF3F
    , 0x00FF40
    , 0x00FF41
    , 0x00FF42
    , 0x00FF43
    , 0x00FF44
    , 0x00FF45
    , 0x00FF46
    , 0x00FF47
    , 0x00FF48
    , 0x00FF49
    , 0x00FF4A
    , 0x00FF4B
    , 0x00FF4C
    , 0x00FF4D
    , 0x00FF4E
    , 0x00FF4F
    , 0x00FF50
    , 0x00FF51
    , 0x00FF52
    , 0x00FF53
    , 0x00FF54
    , 0x00FF55
    , 0x00FF56
    , 0x00FF57
    , 0x00FF58
    , 0x00FF59
    , 0x00FF5A
    , 0x00FF5B
    , 0x00FF5C
    , 0x00FF5D
    , 0x00FF5E
    , 0x00FF5F
    , 0x00FF60
    , 0x00FF61
    , 0x00FF62
    , 0x00FF63
    , 0x00FF64
    , 0x00FF65
    , 0x00FF66
    , 0x00FF67
    , 0x00FF68
    , 0x00FF69
    , 0x00FF6A
    , 0x00FF6B
    , 0x00FF6C
    , 0x00FF6D
    , 0x00FF6E
    , 0x00FF6F
    , 0x00FF70
    , 0x00FF71
    , 0x00FF72
    , 0x00FF73
    , 0x00FF74
    , 0x00FF75
    , 0x00FF76
    , 0x00FF77
    , 0x00FF78
    , 0x00FF79
    , 0x00FF7A
    , 0x00FF7B
    , 0x00FF7C
    , 0x00FF7D
    , 0x00FF7E
    , 0x00FF7F
    , 0x00FF80
    , 0x00FF81
    , 0x00FF82
    , 0x00FF83
    , 0x00FF84
    , 0x00FF85
    , 0x00FF86
    , 0x00FF87
    , 0x00FF88
    , 0x00FF89
    , 0x00FF8A
    , 0x00FF8B
    , 0x00FF8C
    , 0x00FF8D
    , 0x00FF8E
    , 0x00FF8F
    , 0x00FF90
    , 0x00FF91
    , 0x00FF92
    , 0x00FF93
    , 0x00FF94
    , 0x00FF95
    , 0x00FF96
    , 0x00FF97
    , 0x00FF98
    , 0x00FF99
    , 0x00FF9A
    , 0x00FF9B
    , 0x00FF9C
    , 0x00FF9D
    , 0x00FF9E
    , 0x00FF9F
    , 0x00FFA0
    , 0x00FFA1
    , 0x00FFA2
    , 0x00FFA3
    , 0x00FFA4
    , 0x00FFA5
    , 0x00FFA6
    , 0x00FFA7
    , 0x00FFA8
    , 0x00FFA9
    , 0x00FFAA
    , 0x00FFAB
    , 0x00FFAC
    , 0x00FFAD
    , 0x00FFAE
    , 0x00FFAF
    , 0x00FFB0
    , 0x00FFB1
    , 0x00FFB2
    , 0x00FFB3
    , 0x00FFB4
    , 0x00FFB5
    , 0x00FFB6
    , 0x00FFB7
    , 0x00FFB8
    , 0x00FFB9
    , 0x00FFBA
    , 0x00FFBB
    , 0x00FFBC
    , 0x00FFBD
    , 0x00FFBE
    , 0x00FFC2
    , 0x00FFC3
    , 0x00FFC4
    , 0x00FFC5
    , 0x00FFC6
    , 0x00FFC7
    , 0x00FFCA
    , 0x00FFCB
    , 0x00FFCC
    , 0x00FFCD
    , 0x00FFCE
    , 0x00FFCF
    , 0x00FFD2
    , 0x00FFD3
    , 0x00FFD4
    , 0x00FFD5
    , 0x00FFD6
    , 0x00FFD7
    , 0x00FFDA
    , 0x00FFDB
    , 0x00FFDC
    , 0x00FFE0
    , 0x00FFE1
    , 0x00FFE2
    , 0x00FFE3
    , 0x00FFE4
    , 0x00FFE5
    , 0x00FFE6
    , 0x00FFE8
    , 0x00FFE9
    , 0x00FFEA
    , 0x00FFEB
    , 0x00FFEC
    , 0x00FFED
    , 0x00FFEE
    ]

-- | Target codepoints; parallel to 'widthSources'.
widthTargets :: ByteArray
widthTargets = PBA.byteArrayFromList
    [ (0x000020 :: Word32)
    , 0x000021
    , 0x000022
    , 0x000023
    , 0x000024
    , 0x000025
    , 0x000026
    , 0x000027
    , 0x000028
    , 0x000029
    , 0x00002A
    , 0x00002B
    , 0x00002C
    , 0x00002D
    , 0x00002E
    , 0x00002F
    , 0x000030
    , 0x000031
    , 0x000032
    , 0x000033
    , 0x000034
    , 0x000035
    , 0x000036
    , 0x000037
    , 0x000038
    , 0x000039
    , 0x00003A
    , 0x00003B
    , 0x00003C
    , 0x00003D
    , 0x00003E
    , 0x00003F
    , 0x000040
    , 0x000041
    , 0x000042
    , 0x000043
    , 0x000044
    , 0x000045
    , 0x000046
    , 0x000047
    , 0x000048
    , 0x000049
    , 0x00004A
    , 0x00004B
    , 0x00004C
    , 0x00004D
    , 0x00004E
    , 0x00004F
    , 0x000050
    , 0x000051
    , 0x000052
    , 0x000053
    , 0x000054
    , 0x000055
    , 0x000056
    , 0x000057
    , 0x000058
    , 0x000059
    , 0x00005A
    , 0x00005B
    , 0x00005C
    , 0x00005D
    , 0x00005E
    , 0x00005F
    , 0x000060
    , 0x000061
    , 0x000062
    , 0x000063
    , 0x000064
    , 0x000065
    , 0x000066
    , 0x000067
    , 0x000068
    , 0x000069
    , 0x00006A
    , 0x00006B
    , 0x00006C
    , 0x00006D
    , 0x00006E
    , 0x00006F
    , 0x000070
    , 0x000071
    , 0x000072
    , 0x000073
    , 0x000074
    , 0x000075
    , 0x000076
    , 0x000077
    , 0x000078
    , 0x000079
    , 0x00007A
    , 0x00007B
    , 0x00007C
    , 0x00007D
    , 0x00007E
    , 0x002985
    , 0x002986
    , 0x003002
    , 0x00300C
    , 0x00300D
    , 0x003001
    , 0x0030FB
    , 0x0030F2
    , 0x0030A1
    , 0x0030A3
    , 0x0030A5
    , 0x0030A7
    , 0x0030A9
    , 0x0030E3
    , 0x0030E5
    , 0x0030E7
    , 0x0030C3
    , 0x0030FC
    , 0x0030A2
    , 0x0030A4
    , 0x0030A6
    , 0x0030A8
    , 0x0030AA
    , 0x0030AB
    , 0x0030AD
    , 0x0030AF
    , 0x0030B1
    , 0x0030B3
    , 0x0030B5
    , 0x0030B7
    , 0x0030B9
    , 0x0030BB
    , 0x0030BD
    , 0x0030BF
    , 0x0030C1
    , 0x0030C4
    , 0x0030C6
    , 0x0030C8
    , 0x0030CA
    , 0x0030CB
    , 0x0030CC
    , 0x0030CD
    , 0x0030CE
    , 0x0030CF
    , 0x0030D2
    , 0x0030D5
    , 0x0030D8
    , 0x0030DB
    , 0x0030DE
    , 0x0030DF
    , 0x0030E0
    , 0x0030E1
    , 0x0030E2
    , 0x0030E4
    , 0x0030E6
    , 0x0030E8
    , 0x0030E9
    , 0x0030EA
    , 0x0030EB
    , 0x0030EC
    , 0x0030ED
    , 0x0030EF
    , 0x0030F3
    , 0x003099
    , 0x00309A
    , 0x003164
    , 0x003131
    , 0x003132
    , 0x003133
    , 0x003134
    , 0x003135
    , 0x003136
    , 0x003137
    , 0x003138
    , 0x003139
    , 0x00313A
    , 0x00313B
    , 0x00313C
    , 0x00313D
    , 0x00313E
    , 0x00313F
    , 0x003140
    , 0x003141
    , 0x003142
    , 0x003143
    , 0x003144
    , 0x003145
    , 0x003146
    , 0x003147
    , 0x003148
    , 0x003149
    , 0x00314A
    , 0x00314B
    , 0x00314C
    , 0x00314D
    , 0x00314E
    , 0x00314F
    , 0x003150
    , 0x003151
    , 0x003152
    , 0x003153
    , 0x003154
    , 0x003155
    , 0x003156
    , 0x003157
    , 0x003158
    , 0x003159
    , 0x00315A
    , 0x00315B
    , 0x00315C
    , 0x00315D
    , 0x00315E
    , 0x00315F
    , 0x003160
    , 0x003161
    , 0x003162
    , 0x003163
    , 0x0000A2
    , 0x0000A3
    , 0x0000AC
    , 0x0000AF
    , 0x0000A6
    , 0x0000A5
    , 0x0020A9
    , 0x002502
    , 0x002190
    , 0x002191
    , 0x002192
    , 0x002193
    , 0x0025A0
    , 0x0025CB
    ]