unicode-general-category-0.1.0.0: Unicode General Category Database
Safe HaskellNone
LanguageHaskell2010

Data.Char.GeneralCategory.Database

Synopsis

Documentation

genCatLitTable :: Map Text GeneralCategory Source #

General category abbreviations

mkDatabaseFromUnicodeData :: ByteString -> Either String GenCatDatabase Source #

Parses a lazy ByteString from a UnicodeData.txt. For example, content of UnicodeData.txt

data GenCatDatabase Source #

General category database. Conceptually this is a sorted array of ascending, non-overlapping inclusive codepoint ranges, with a GeneralCategory attached to each of them. Note that NotAssigned should not be present in this array.

Internally every element is packed into Word64, for the least significant bits:

  • 0-23 bits represent the low codepoint range (inclusive)
  • 24-47 bits represent the high codepoint range (inclusive)
  • 47-63 bits represent general category values consistent to GeneralCategory's Enum instance.

Instances

Instances details
Binary GenCatDatabase Source # 
Instance details

Defined in Data.Char.GeneralCategory.Database

query :: GenCatDatabase -> Char -> GeneralCategory Source #

Queries database. query db should be a function equivalent to generalCategory, but queries the argument database instead.

checkDatabase :: UArray Int Word64 -> Either String GenCatDatabase Source #

Verifies that all properties of a GenCatDatabase holds, and turns an UArray into a database if all requirements are met.

checkDatabase' :: GenCatDatabase -> Either String GenCatDatabase Source #

Verifies that all properties of a GenCatDatabase holds.