    {-# LANGUAGE DeriveDataTypeable #-}
    {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
    -----------------------------------------------------------------------------
    -- |
    -- Module      :  Data.CharSet.Unicode.Block
    -- Copyright   :  (c) Edward Kmett 2010-2011
    -- License     :  BSD3
    -- Maintainer  :  ekmett@gmail.com
    -- Stability   :  experimental
    -- Portability :  portable
    --
    -- Provides unicode general categories, which are typically connoted by
    -- @\p{InBasicLatin}@ or @\p{InIPA_Extensions}@. Lookups can be constructed using 'categories'
    -- or individual character sets can be used directly.
    -------------------------------------------------------------------------------

    module Data.CharSet.Unicode.Block
        (
        -- * Unicode General Category
          Block(..)
        -- * Lookup
        , blocks
        , lookupBlock
        , lookupBlockCharSet
        -- * CharSets by Block
        , basicLatin
        , latin1Supplement
        , latinExtendedA
        , latinExtendedB
        , ipaExtensions
        , spacingModifierLetters
        , combiningDiacriticalMarks
        , greekAndCoptic
        , cyrillic
        , cyrillicSupplementary
        , armenian
        , hebrew
        , arabic
        , syriac
        , thaana
        , devanagari
        , bengali
        , gurmukhi
        , gujarati
        , oriya
        , tamil
        , telugu
        , kannada
        , malayalam
        , sinhala
        , thai
        , lao
        , tibetan
        , myanmar
        , georgian
        , hangulJamo
        , ethiopic
        , cherokee
        , unifiedCanadianAboriginalSyllabics
        , ogham
        , runic
        , tagalog
        , hanunoo
        , buhid
        , tagbanwa
        , khmer
        , mongolian
        , limbu
        , taiLe
        , khmerSymbols
        , phoneticExtensions
        , latinExtendedAdditional
        , greekExtended
        , generalPunctuation
        , superscriptsAndSubscripts
        , currencySymbols
        , combiningDiacriticalMarksForSymbols
        , letterlikeSymbols
        , numberForms
        , arrows
        , mathematicalOperators
        , miscellaneousTechnical
        , controlPictures
        , opticalCharacterRecognition
        , enclosedAlphanumerics
        , boxDrawing
        , blockElements
        , geometricShapes
        , miscellaneousSymbols
        , dingbats
        , miscellaneousMathematicalSymbolsA
        , supplementalArrowsA
        , braillePatterns
        , supplementalArrowsB
        , miscellaneousMathematicalSymbolsB
        , supplementalMathematicalOperators
        , miscellaneousSymbolsAndArrows
        , cjkRadicalsSupplement
        , kangxiRadicals
        , ideographicDescriptionCharacters
        , cjkSymbolsAndPunctuation
        , hiragana
        , katakana
        , bopomofo
        , hangulCompatibilityJamo
        , kanbun
        , bopomofoExtended
        , katakanaPhoneticExtensions
        , enclosedCjkLettersAndMonths
        , cjkCompatibility
        , cjkUnifiedIdeographsExtensionA
        , yijingHexagramSymbols
        , cjkUnifiedIdeographs
        , yiSyllables
        , yiRadicals
        , hangulSyllables
        , highSurrogates
        , highPrivateUseSurrogates
        , lowSurrogates
        , privateUseArea
        , cjkCompatibilityIdeographs
        , alphabeticPresentationForms
        , arabicPresentationFormsA
        , variationSelectors
        , combiningHalfMarks
        , cjkCompatibilityForms
        , smallFormVariants
        , arabicPresentationFormsB
        , halfwidthAndFullwidthForms
        , specials
        ) where

    import Data.Char
    import Data.CharSet
    import Data.Data
    import Data.HashMap.Lazy (HashMap)
    import qualified Data.HashMap.Lazy as HashMap

    data Block = Block
        { Block -> String
    blockName :: String
        , Block -> CharSet
    blockCharSet :: CharSet
        } deriving (Int -> Block -> ShowS
    [Block] -> ShowS
    Block -> String
    (Int -> Block -> ShowS)
    -> (Block -> String) -> ([Block] -> ShowS) -> Show Block
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Block -> ShowS
    showsPrec :: Int -> Block -> ShowS
    $cshow :: Block -> String
    show :: Block -> String
    $cshowList :: [Block] -> ShowS
    showList :: [Block] -> ShowS
    Show, Typeable Block
    Typeable Block =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> Block -> c Block)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c Block)
    -> (Block -> Constr)
    -> (Block -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c Block))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Block))
    -> ((forall b. Data b => b -> b) -> Block -> Block)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Block -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Block -> r)
    -> (forall u. (forall d. Data d => d -> u) -> Block -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> Block -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> Block -> m Block)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> Block -> m Block)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> Block -> m Block)
    -> Data Block
    Block -> Constr
    Block -> DataType
    (forall b. Data b => b -> b) -> Block -> Block
    forall a.
    Typeable a =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u. Int -> (forall d. Data d => d -> u) -> Block -> u
    forall u. (forall d. Data d => d -> u) -> Block -> [u]
    forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Block -> r
    forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Block -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Block -> m Block
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Block -> m Block
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Block
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Block -> c Block
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Block)
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Block)
    $cgfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Block -> c Block
    gfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Block -> c Block
    $cgunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Block
    gunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Block
    $ctoConstr :: Block -> Constr
    toConstr :: Block -> Constr
    $cdataTypeOf :: Block -> DataType
    dataTypeOf :: Block -> DataType
    $cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Block)
    dataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Block)
    $cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Block)
    dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Block)
    $cgmapT :: (forall b. Data b => b -> b) -> Block -> Block
    gmapT :: (forall b. Data b => b -> b) -> Block -> Block
    $cgmapQl :: forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Block -> r
    gmapQl :: forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Block -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Block -> r
    gmapQr :: forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Block -> r
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> Block -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> Block -> [u]
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Block -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Block -> u
    $cgmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Block -> m Block
    gmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Block -> m Block
    $cgmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Block -> m Block
    gmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Block -> m Block
    $cgmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Block -> m Block
    gmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Block -> m Block
    Data, Typeable)

    blocks :: [Block]
    blocks :: [Block]
    blocks =
        [ String -> CharSet -> Block
    Block String
    "Basic_Latin" CharSet
    basicLatin
        , String -> CharSet -> Block
    Block String
    "Latin-1_Supplement" CharSet
    latin1Supplement
        , String -> CharSet -> Block
    Block String
    "Latin_Extended-A" CharSet
    latinExtendedA
        , String -> CharSet -> Block
    Block String
    "Latin_Extended-B" CharSet
    latinExtendedB
        , String -> CharSet -> Block
    Block String
    "IPA_Extensions" CharSet
    ipaExtensions
        , String -> CharSet -> Block
    Block String
    "Spacing_Modifier_Letters" CharSet
    spacingModifierLetters
        , String -> CharSet -> Block
    Block String
    "Combining_Diacritical_Marks" CharSet
    combiningDiacriticalMarks
        , String -> CharSet -> Block
    Block String
    "Greek_and_Coptic" CharSet
    greekAndCoptic
        , String -> CharSet -> Block
    Block String
    "Cyrillic" CharSet
    cyrillic
        , String -> CharSet -> Block
    Block String
    "Cyrillic_Supplementary" CharSet
    cyrillicSupplementary
        , String -> CharSet -> Block
    Block String
    "Armenian" CharSet
    armenian
        , String -> CharSet -> Block
    Block String
    "Hebrew" CharSet
    hebrew
        , String -> CharSet -> Block
    Block String
    "Arabic" CharSet
    arabic
        , String -> CharSet -> Block
    Block String
    "Syriac" CharSet
    syriac
        , String -> CharSet -> Block
    Block String
    "Thaana" CharSet
    thaana
        , String -> CharSet -> Block
    Block String
    "Devanagari" CharSet
    devanagari
        , String -> CharSet -> Block
    Block String
    "Bengali" CharSet
    bengali
        , String -> CharSet -> Block
    Block String
    "Gurmukhi" CharSet
    gurmukhi
        , String -> CharSet -> Block
    Block String
    "Gujarati" CharSet
    gujarati
        , String -> CharSet -> Block
    Block String
    "Oriya" CharSet
    oriya
        , String -> CharSet -> Block
    Block String
    "Tamil" CharSet
    tamil
        , String -> CharSet -> Block
    Block String
    "Telugu" CharSet
    telugu
        , String -> CharSet -> Block
    Block String
    "Kannada" CharSet
    kannada
        , String -> CharSet -> Block
    Block String
    "Malayalam" CharSet
    malayalam
        , String -> CharSet -> Block
    Block String
    "Sinhala" CharSet
    sinhala
        , String -> CharSet -> Block
    Block String
    "Thai" CharSet
    thai
        , String -> CharSet -> Block
    Block String
    "Lao" CharSet
    lao
        , String -> CharSet -> Block
    Block String
    "Tibetan" CharSet
    tibetan
        , String -> CharSet -> Block
    Block String
    "Myanmar" CharSet
    myanmar
        , String -> CharSet -> Block
    Block String
    "Georgian" CharSet
    georgian
        , String -> CharSet -> Block
    Block String
    "Hangul_Jamo" CharSet
    hangulJamo
        , String -> CharSet -> Block
    Block String
    "Ethiopic" CharSet
    ethiopic
        , String -> CharSet -> Block
    Block String
    "Cherokee" CharSet
    cherokee
        , String -> CharSet -> Block
    Block String
    "Unified_Canadian_Aboriginal_Syllabics" CharSet
    unifiedCanadianAboriginalSyllabics
        , String -> CharSet -> Block
    Block String
    "Ogham" CharSet
    ogham
        , String -> CharSet -> Block
    Block String
    "Runic" CharSet
    runic
        , String -> CharSet -> Block
    Block String
    "Tagalog" CharSet
    tagalog
        , String -> CharSet -> Block
    Block String
    "Hanunoo" CharSet
    hanunoo
        , String -> CharSet -> Block
    Block String
    "Buhid" CharSet
    buhid
        , String -> CharSet -> Block
    Block String
    "Tagbanwa" CharSet
    tagbanwa
        , String -> CharSet -> Block
    Block String
    "Khmer" CharSet
    khmer
        , String -> CharSet -> Block
    Block String
    "Mongolian" CharSet
    mongolian
        , String -> CharSet -> Block
    Block String
    "Limbu" CharSet
    limbu
        , String -> CharSet -> Block
    Block String
    "Tai_Le" CharSet
    taiLe
        , String -> CharSet -> Block
    Block String
    "Khmer_Symbols" CharSet
    khmerSymbols
        , String -> CharSet -> Block
    Block String
    "Phonetic_Extensions" CharSet
    phoneticExtensions
        , String -> CharSet -> Block
    Block String
    "Latin_Extended_Additional" CharSet
    latinExtendedAdditional
        , String -> CharSet -> Block
    Block String
    "Greek_Extended" CharSet
    greekExtended
        , String -> CharSet -> Block
    Block String
    "General_Punctuation" CharSet
    generalPunctuation
        , String -> CharSet -> Block
    Block String
    "Superscripts_and_Subscripts" CharSet
    superscriptsAndSubscripts
        , String -> CharSet -> Block
    Block String
    "Currency_Symbols" CharSet
    currencySymbols
        , String -> CharSet -> Block
    Block String
    "Combining_Diacritical_Marks_for_Symbols" CharSet
    combiningDiacriticalMarksForSymbols
        , String -> CharSet -> Block
    Block String
    "Letterlike_Symbols" CharSet
    letterlikeSymbols
        , String -> CharSet -> Block
    Block String
    "Number_Forms" CharSet
    numberForms
        , String -> CharSet -> Block
    Block String
    "Arrows" CharSet
    arrows
        , String -> CharSet -> Block
    Block String
    "Mathematical_Operators" CharSet
    mathematicalOperators
        , String -> CharSet -> Block
    Block String
    "Miscellaneous_Technical" CharSet
    miscellaneousTechnical
        , String -> CharSet -> Block
    Block String
    "Control_Pictures" CharSet
    controlPictures
        , String -> CharSet -> Block
    Block String
    "Optical_Character_Recognition" CharSet
    opticalCharacterRecognition
        , String -> CharSet -> Block
    Block String
    "Enclosed_Alphanumerics" CharSet
    enclosedAlphanumerics
        , String -> CharSet -> Block
    Block String
    "Box_Drawing" CharSet
    boxDrawing
        , String -> CharSet -> Block
    Block String
    "Block_Elements" CharSet
    blockElements
        , String -> CharSet -> Block
    Block String
    "Geometric_Shapes" CharSet
    geometricShapes
        , String -> CharSet -> Block
    Block String
    "Miscellaneous_Symbols" CharSet
    miscellaneousSymbols
        , String -> CharSet -> Block
    Block String
    "Dingbats" CharSet
    dingbats
        , String -> CharSet -> Block
    Block String
    "Miscellaneous_Mathematical_Symbols-A" CharSet
    miscellaneousMathematicalSymbolsA
        , String -> CharSet -> Block
    Block String
    "Supplemental_Arrows-A" CharSet
    supplementalArrowsA
        , String -> CharSet -> Block
    Block String
    "Braille_Patterns" CharSet
    braillePatterns
        , String -> CharSet -> Block
    Block String
    "Supplemental_Arrows-B" CharSet
    supplementalArrowsB
        , String -> CharSet -> Block
    Block String
    "Miscellaneous_Mathematical_Symbols-B" CharSet
    miscellaneousMathematicalSymbolsB
        , String -> CharSet -> Block
    Block String
    "Supplemental_Mathematical_Operators" CharSet
    supplementalMathematicalOperators
        , String -> CharSet -> Block
    Block String
    "Miscellaneous_Symbols_and_Arrows" CharSet
    miscellaneousSymbolsAndArrows
        , String -> CharSet -> Block
    Block String
    "CJK_Radicals_Supplement" CharSet
    cjkRadicalsSupplement
        , String -> CharSet -> Block
    Block String
    "Kangxi_Radicals" CharSet
    kangxiRadicals
        , String -> CharSet -> Block
    Block String
    "Ideographic_Description_Characters" CharSet
    ideographicDescriptionCharacters
        , String -> CharSet -> Block
    Block String
    "CJK_Symbols_and_Punctuation" CharSet
    cjkSymbolsAndPunctuation
        , String -> CharSet -> Block
    Block String
    "Hiragana" CharSet
    hiragana
        , String -> CharSet -> Block
    Block String
    "Katakana" CharSet
    katakana
        , String -> CharSet -> Block
    Block String
    "Bopomofo" CharSet
    bopomofo
        , String -> CharSet -> Block
    Block String
    "Hangul_Compatibility_Jamo" CharSet
    hangulCompatibilityJamo
        , String -> CharSet -> Block
    Block String
    "Kanbun" CharSet
    kanbun
        , String -> CharSet -> Block
    Block String
    "Bopomofo_Extended" CharSet
    bopomofoExtended
        , String -> CharSet -> Block
    Block String
    "Katakana_Phonetic_Extensions" CharSet
    katakanaPhoneticExtensions
        , String -> CharSet -> Block
    Block String
    "Enclosed_CJK_Letters_and_Months" CharSet
    enclosedCjkLettersAndMonths
        , String -> CharSet -> Block
    Block String
    "CJK_Compatibility" CharSet
    cjkCompatibility
        , String -> CharSet -> Block
    Block String
    "CJK_Unified_Ideographs_Extension_A" CharSet
    cjkUnifiedIdeographsExtensionA
        , String -> CharSet -> Block
    Block String
    "Yijing_Hexagram_Symbols" CharSet
    yijingHexagramSymbols
        , String -> CharSet -> Block
    Block String
    "CJK_Unified_Ideographs" CharSet
    cjkUnifiedIdeographs
        , String -> CharSet -> Block
    Block String
    "Yi_Syllables" CharSet
    yiSyllables
        , String -> CharSet -> Block
    Block String
    "Yi_Radicals" CharSet
    yiRadicals
        , String -> CharSet -> Block
    Block String
    "Hangul_Syllables" CharSet
    hangulSyllables
        , String -> CharSet -> Block
    Block String
    "High_Surrogates" CharSet
    highSurrogates
        , String -> CharSet -> Block
    Block String
    "High_Private_Use_Surrogates" CharSet
    highPrivateUseSurrogates
        , String -> CharSet -> Block
    Block String
    "Low_Surrogates" CharSet
    lowSurrogates
        , String -> CharSet -> Block
    Block String
    "Private_Use_Area" CharSet
    privateUseArea
        , String -> CharSet -> Block
    Block String
    "CJK_Compatibility_Ideographs" CharSet
    cjkCompatibilityIdeographs
        , String -> CharSet -> Block
    Block String
    "Alphabetic_Presentation_Forms" CharSet
    alphabeticPresentationForms
        , String -> CharSet -> Block
    Block String
    "Arabic_Presentation_Forms-A" CharSet
    arabicPresentationFormsA
        , String -> CharSet -> Block
    Block String
    "Variation_Selectors" CharSet
    variationSelectors
        , String -> CharSet -> Block
    Block String
    "Combining_Half_Marks" CharSet
    combiningHalfMarks
        , String -> CharSet -> Block
    Block String
    "CJK_Compatibility_Forms" CharSet
    cjkCompatibilityForms
        , String -> CharSet -> Block
    Block String
    "Small_Form_Variants" CharSet
    smallFormVariants
        , String -> CharSet -> Block
    Block String
    "Arabic_Presentation_Forms-B" CharSet
    arabicPresentationFormsB
        , String -> CharSet -> Block
    Block String
    "Halfwidth_and_Fullwidth_Forms" CharSet
    halfwidthAndFullwidthForms
        , String -> CharSet -> Block
    Block String
    "Specials" CharSet
    specials ]

    lookupTable :: HashMap String Block
    lookupTable :: HashMap String Block
    lookupTable = [(String, Block)] -> HashMap String Block
    forall k v. (Eq k, Hashable k) => [(k, v)] -> HashMap k v
    HashMap.fromList ([(String, Block)] -> HashMap String Block)
    -> [(String, Block)] -> HashMap String Block
    forall a b. (a -> b) -> a -> b
    $
                  (Block -> (String, Block)) -> [Block] -> [(String, Block)]
    forall a b. (a -> b) -> [a] -> [b]
    Prelude.map (\y :: Block
    y@(Block String
    x CharSet
    _) -> (ShowS
    canonicalize String
    x, Block
    y))
                  [Block]
    blocks

    canonicalize :: String -> String
    canonicalize :: ShowS
    canonicalize String
    s = case (Char -> Char) -> ShowS
    forall a b. (a -> b) -> [a] -> [b]
    Prelude.map Char -> Char
    toLower String
    s of
        Char
    'i': Char
    'n' : String
    xs -> ShowS
    go String
    xs
        String
    xs -> ShowS
    go String
    xs
        where
            go :: ShowS
    go (Char
    '-':String
    xs) = ShowS
    go String
    xs
            go (Char
    '_':String
    xs) = ShowS
    go String
    xs
            go (Char
    ' ':String
    xs) = ShowS
    go String
    xs
            go (Char
    x:String
    xs) = Char
    x Char -> ShowS
    forall a. a -> [a] -> [a]
    : ShowS
    go String
    xs
            go [] = []

    lookupBlock :: String -> Maybe Block
    lookupBlock :: String -> Maybe Block
    lookupBlock String
    s = String -> HashMap String Block -> Maybe Block
    forall k v. (Eq k, Hashable k) => k -> HashMap k v -> Maybe v
    HashMap.lookup (ShowS
    canonicalize String
    s) HashMap String Block
    lookupTable

    lookupBlockCharSet :: String -> Maybe CharSet
    lookupBlockCharSet :: String -> Maybe CharSet
    lookupBlockCharSet = (Block -> CharSet) -> Maybe Block -> Maybe CharSet
    forall a b. (a -> b) -> Maybe a -> Maybe b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap Block -> CharSet
    blockCharSet (Maybe Block -> Maybe CharSet)
    -> (String -> Maybe Block) -> String -> Maybe CharSet
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . String -> Maybe Block
    lookupBlock

    basicLatin :: CharSet
    basicLatin = Char -> Char -> CharSet
    range Char
    '\x0000' Char
    '\x007f'
    latin1Supplement :: CharSet
    latin1Supplement = Char -> Char -> CharSet
    range Char
    '\x0080' Char
    '\x00ff'
    latinExtendedA :: CharSet
    latinExtendedA = Char -> Char -> CharSet
    range Char
    '\x0100' Char
    '\x017F'
    latinExtendedB :: CharSet
    latinExtendedB = Char -> Char -> CharSet
    range Char
    '\x0180' Char
    '\x024F'
    ipaExtensions :: CharSet
    ipaExtensions = Char -> Char -> CharSet
    range Char
    '\x0250' Char
    '\x02AF'
    spacingModifierLetters :: CharSet
    spacingModifierLetters = Char -> Char -> CharSet
    range Char
    '\x02B0' Char
    '\x02FF'
    combiningDiacriticalMarks :: CharSet
    combiningDiacriticalMarks = Char -> Char -> CharSet
    range Char
    '\x0300' Char
    '\x036F'
    greekAndCoptic :: CharSet
    greekAndCoptic = Char -> Char -> CharSet
    range Char
    '\x0370' Char
    '\x03FF'
    cyrillic :: CharSet
    cyrillic = Char -> Char -> CharSet
    range Char
    '\x0400' Char
    '\x04FF'
    cyrillicSupplementary :: CharSet
    cyrillicSupplementary = Char -> Char -> CharSet
    range Char
    '\x0500' Char
    '\x052F'
    armenian :: CharSet
    armenian = Char -> Char -> CharSet
    range Char
    '\x0530' Char
    '\x058F'
    hebrew :: CharSet
    hebrew = Char -> Char -> CharSet
    range Char
    '\x0590' Char
    '\x05FF'
    arabic :: CharSet
    arabic = Char -> Char -> CharSet
    range Char
    '\x0600' Char
    '\x06FF'
    syriac :: CharSet
    syriac = Char -> Char -> CharSet
    range Char
    '\x0700' Char
    '\x074F'
    thaana :: CharSet
    thaana = Char -> Char -> CharSet
    range Char
    '\x0780' Char
    '\x07BF'
    devanagari :: CharSet
    devanagari = Char -> Char -> CharSet
    range Char
    '\x0900' Char
    '\x097F'
    bengali :: CharSet
    bengali = Char -> Char -> CharSet
    range Char
    '\x0980' Char
    '\x09FF'
    gurmukhi :: CharSet
    gurmukhi = Char -> Char -> CharSet
    range Char
    '\x0A00' Char
    '\x0A7F'
    gujarati :: CharSet
    gujarati = Char -> Char -> CharSet
    range Char
    '\x0A80' Char
    '\x0AFF'
    oriya :: CharSet
    oriya = Char -> Char -> CharSet
    range Char
    '\x0B00' Char
    '\x0B7F'
    tamil :: CharSet
    tamil = Char -> Char -> CharSet
    range Char
    '\x0B80' Char
    '\x0BFF'
    telugu :: CharSet
    telugu = Char -> Char -> CharSet
    range Char
    '\x0C00' Char
    '\x0C7F'
    kannada :: CharSet
    kannada = Char -> Char -> CharSet
    range Char
    '\x0C80' Char
    '\x0CFF'
    malayalam :: CharSet
    malayalam = Char -> Char -> CharSet
    range Char
    '\x0D00' Char
    '\x0D7F'
    sinhala :: CharSet
    sinhala = Char -> Char -> CharSet
    range Char
    '\x0D80' Char
    '\x0DFF'
    thai :: CharSet
    thai = Char -> Char -> CharSet
    range Char
    '\x0E00' Char
    '\x0E7F'
    lao :: CharSet
    lao = Char -> Char -> CharSet
    range Char
    '\x0E80' Char
    '\x0EFF'
    tibetan :: CharSet
    tibetan = Char -> Char -> CharSet
    range Char
    '\x0F00' Char
    '\x0FFF'
    myanmar :: CharSet
    myanmar = Char -> Char -> CharSet
    range Char
    '\x1000' Char
    '\x109F'
    georgian :: CharSet
    georgian = Char -> Char -> CharSet
    range Char
    '\x10A0' Char
    '\x10FF'
    hangulJamo :: CharSet
    hangulJamo = Char -> Char -> CharSet
    range Char
    '\x1100' Char
    '\x11FF'
    ethiopic :: CharSet
    ethiopic = Char -> Char -> CharSet
    range Char
    '\x1200' Char
    '\x137F'
    cherokee :: CharSet
    cherokee = Char -> Char -> CharSet
    range Char
    '\x13A0' Char
    '\x13FF'
    unifiedCanadianAboriginalSyllabics :: CharSet
    unifiedCanadianAboriginalSyllabics = Char -> Char -> CharSet
    range Char
    '\x1400' Char
    '\x167F'
    ogham :: CharSet
    ogham = Char -> Char -> CharSet
    range Char
    '\x1680' Char
    '\x169F'
    runic :: CharSet
    runic = Char -> Char -> CharSet
    range Char
    '\x16A0' Char
    '\x16FF'
    tagalog :: CharSet
    tagalog = Char -> Char -> CharSet
    range Char
    '\x1700' Char
    '\x171F'
    hanunoo :: CharSet
    hanunoo = Char -> Char -> CharSet
    range Char
    '\x1720' Char
    '\x173F'
    buhid :: CharSet
    buhid = Char -> Char -> CharSet
    range Char
    '\x1740' Char
    '\x175F'
    tagbanwa :: CharSet
    tagbanwa = Char -> Char -> CharSet
    range Char
    '\x1760' Char
    '\x177F'
    khmer :: CharSet
    khmer = Char -> Char -> CharSet
    range Char
    '\x1780' Char
    '\x17FF'
    mongolian :: CharSet
    mongolian = Char -> Char -> CharSet
    range Char
    '\x1800' Char
    '\x18AF'
    limbu :: CharSet
    limbu = Char -> Char -> CharSet
    range Char
    '\x1900' Char
    '\x194F'
    taiLe :: CharSet
    taiLe = Char -> Char -> CharSet
    range Char
    '\x1950' Char
    '\x197F'
    khmerSymbols :: CharSet
    khmerSymbols = Char -> Char -> CharSet
    range Char
    '\x19E0' Char
    '\x19FF'
    phoneticExtensions :: CharSet
    phoneticExtensions = Char -> Char -> CharSet
    range Char
    '\x1D00' Char
    '\x1D7F'
    latinExtendedAdditional :: CharSet
    latinExtendedAdditional = Char -> Char -> CharSet
    range Char
    '\x1E00' Char
    '\x1EFF'
    greekExtended :: CharSet
    greekExtended = Char -> Char -> CharSet
    range Char
    '\x1F00' Char
    '\x1FFF'
    generalPunctuation :: CharSet
    generalPunctuation = Char -> Char -> CharSet
    range Char
    '\x2000' Char
    '\x206F'
    superscriptsAndSubscripts :: CharSet
    superscriptsAndSubscripts = Char -> Char -> CharSet
    range Char
    '\x2070' Char
    '\x209F'
    currencySymbols :: CharSet
    currencySymbols = Char -> Char -> CharSet
    range Char
    '\x20A0' Char
    '\x20CF'
    combiningDiacriticalMarksForSymbols :: CharSet
    combiningDiacriticalMarksForSymbols = Char -> Char -> CharSet
    range Char
    '\x20D0' Char
    '\x20FF'
    letterlikeSymbols :: CharSet
    letterlikeSymbols = Char -> Char -> CharSet
    range Char
    '\x2100' Char
    '\x214F'
    numberForms :: CharSet
    numberForms = Char -> Char -> CharSet
    range Char
    '\x2150' Char
    '\x218F'
    arrows :: CharSet
    arrows = Char -> Char -> CharSet
    range Char
    '\x2190' Char
    '\x21FF'
    mathematicalOperators :: CharSet
    mathematicalOperators = Char -> Char -> CharSet
    range Char
    '\x2200' Char
    '\x22FF'
    miscellaneousTechnical :: CharSet
    miscellaneousTechnical = Char -> Char -> CharSet
    range Char
    '\x2300' Char
    '\x23FF'
    controlPictures :: CharSet
    controlPictures = Char -> Char -> CharSet
    range Char
    '\x2400' Char
    '\x243F'
    opticalCharacterRecognition :: CharSet
    opticalCharacterRecognition = Char -> Char -> CharSet
    range Char
    '\x2440' Char
    '\x245F'
    enclosedAlphanumerics :: CharSet
    enclosedAlphanumerics = Char -> Char -> CharSet
    range Char
    '\x2460' Char
    '\x24FF'
    boxDrawing :: CharSet
    boxDrawing = Char -> Char -> CharSet
    range Char
    '\x2500' Char
    '\x257F'
    blockElements :: CharSet
    blockElements = Char -> Char -> CharSet
    range Char
    '\x2580' Char
    '\x259F'
    geometricShapes :: CharSet
    geometricShapes = Char -> Char -> CharSet
    range Char
    '\x25A0' Char
    '\x25FF'
    miscellaneousSymbols :: CharSet
    miscellaneousSymbols = Char -> Char -> CharSet
    range Char
    '\x2600' Char
    '\x26FF'
    dingbats :: CharSet
    dingbats = Char -> Char -> CharSet
    range Char
    '\x2700' Char
    '\x27BF'
    miscellaneousMathematicalSymbolsA :: CharSet
    miscellaneousMathematicalSymbolsA = Char -> Char -> CharSet
    range Char
    '\x27C0' Char
    '\x27EF'
    supplementalArrowsA :: CharSet
    supplementalArrowsA = Char -> Char -> CharSet
    range Char
    '\x27F0' Char
    '\x27FF'
    braillePatterns :: CharSet
    braillePatterns = Char -> Char -> CharSet
    range Char
    '\x2800' Char
    '\x28FF'
    supplementalArrowsB :: CharSet
    supplementalArrowsB = Char -> Char -> CharSet
    range Char
    '\x2900' Char
    '\x297F'
    miscellaneousMathematicalSymbolsB :: CharSet
    miscellaneousMathematicalSymbolsB = Char -> Char -> CharSet
    range Char
    '\x2980' Char
    '\x29FF'
    supplementalMathematicalOperators :: CharSet
    supplementalMathematicalOperators = Char -> Char -> CharSet
    range Char
    '\x2A00' Char
    '\x2AFF'
    miscellaneousSymbolsAndArrows :: CharSet
    miscellaneousSymbolsAndArrows = Char -> Char -> CharSet
    range Char
    '\x2B00' Char
    '\x2BFF'
    cjkRadicalsSupplement :: CharSet
    cjkRadicalsSupplement = Char -> Char -> CharSet
    range Char
    '\x2E80' Char
    '\x2EFF'
    kangxiRadicals :: CharSet
    kangxiRadicals = Char -> Char -> CharSet
    range Char
    '\x2F00' Char
    '\x2FDF'
    ideographicDescriptionCharacters :: CharSet
    ideographicDescriptionCharacters = Char -> Char -> CharSet
    range Char
    '\x2FF0' Char
    '\x2FFF'
    cjkSymbolsAndPunctuation :: CharSet
    cjkSymbolsAndPunctuation = Char -> Char -> CharSet
    range Char
    '\x3000' Char
    '\x303F'
    hiragana :: CharSet
    hiragana = Char -> Char -> CharSet
    range Char
    '\x3040' Char
    '\x309F'
    katakana :: CharSet
    katakana = Char -> Char -> CharSet
    range Char
    '\x30A0' Char
    '\x30FF'
    bopomofo :: CharSet
    bopomofo = Char -> Char -> CharSet
    range Char
    '\x3100' Char
    '\x312F'
    hangulCompatibilityJamo :: CharSet
    hangulCompatibilityJamo = Char -> Char -> CharSet
    range Char
    '\x3130' Char
    '\x318F'
    kanbun :: CharSet
    kanbun = Char -> Char -> CharSet
    range Char
    '\x3190' Char
    '\x319F'
    bopomofoExtended :: CharSet
    bopomofoExtended = Char -> Char -> CharSet
    range Char
    '\x31A0' Char
    '\x31BF'
    katakanaPhoneticExtensions :: CharSet
    katakanaPhoneticExtensions = Char -> Char -> CharSet
    range Char
    '\x31F0' Char
    '\x31FF'
    enclosedCjkLettersAndMonths :: CharSet
    enclosedCjkLettersAndMonths = Char -> Char -> CharSet
    range Char
    '\x3200' Char
    '\x32FF'
    cjkCompatibility :: CharSet
    cjkCompatibility = Char -> Char -> CharSet
    range Char
    '\x3300' Char
    '\x33FF'
    cjkUnifiedIdeographsExtensionA :: CharSet
    cjkUnifiedIdeographsExtensionA = Char -> Char -> CharSet
    range Char
    '\x3400' Char
    '\x4DBF'
    yijingHexagramSymbols :: CharSet
    yijingHexagramSymbols = Char -> Char -> CharSet
    range Char
    '\x4DC0' Char
    '\x4DFF'
    cjkUnifiedIdeographs :: CharSet
    cjkUnifiedIdeographs = Char -> Char -> CharSet
    range Char
    '\x4E00' Char
    '\x9FFF'
    yiSyllables :: CharSet
    yiSyllables = Char -> Char -> CharSet
    range Char
    '\xA000' Char
    '\xA48F'
    yiRadicals :: CharSet
    yiRadicals = Char -> Char -> CharSet
    range Char
    '\xA490' Char
    '\xA4CF'
    hangulSyllables :: CharSet
    hangulSyllables = Char -> Char -> CharSet
    range Char
    '\xAC00' Char
    '\xD7AF'
    highSurrogates :: CharSet
    highSurrogates = Char -> Char -> CharSet
    range Char
    '\xD800' Char
    '\xDB7F'
    highPrivateUseSurrogates :: CharSet
    highPrivateUseSurrogates = Char -> Char -> CharSet
    range Char
    '\xDB80' Char
    '\xDBFF'
    lowSurrogates :: CharSet
    lowSurrogates = Char -> Char -> CharSet
    range Char
    '\xDC00' Char
    '\xDFFF'
    privateUseArea :: CharSet
    privateUseArea = Char -> Char -> CharSet
    range Char
    '\xE000' Char
    '\xF8FF'
    cjkCompatibilityIdeographs :: CharSet
    cjkCompatibilityIdeographs = Char -> Char -> CharSet
    range Char
    '\xF900' Char
    '\xFAFF'
    alphabeticPresentationForms :: CharSet
    alphabeticPresentationForms = Char -> Char -> CharSet
    range Char
    '\xFB00' Char
    '\xFB4F'
    arabicPresentationFormsA :: CharSet
    arabicPresentationFormsA = Char -> Char -> CharSet
    range Char
    '\xFB50' Char
    '\xFDFF'
    variationSelectors :: CharSet
    variationSelectors = Char -> Char -> CharSet
    range Char
    '\xFE00' Char
    '\xFE0F'
    combiningHalfMarks :: CharSet
    combiningHalfMarks = Char -> Char -> CharSet
    range Char
    '\xFE20' Char
    '\xFE2F'
    cjkCompatibilityForms :: CharSet
    cjkCompatibilityForms = Char -> Char -> CharSet
    range Char
    '\xFE30' Char
    '\xFE4F'
    smallFormVariants :: CharSet
    smallFormVariants = Char -> Char -> CharSet
    range Char
    '\xFE50' Char
    '\xFE6F'
    arabicPresentationFormsB :: CharSet
    arabicPresentationFormsB = Char -> Char -> CharSet
    range Char
    '\xFE70' Char
    '\xFEFF'
    halfwidthAndFullwidthForms :: CharSet
    halfwidthAndFullwidthForms = Char -> Char -> CharSet
    range Char
    '\xFF00' Char
    '\xFFEF'
    specials :: CharSet
    specials = Char -> Char -> CharSet
    range Char
    '\xFFF0' Char
    '\xFFFF'