| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Char.GeneralCategory.Database
Synopsis
- genCatLitTable :: Map Text GeneralCategory
- mkDatabaseFromUnicodeData :: ByteString -> Either String GenCatDatabase
- data GenCatDatabase
- query :: GenCatDatabase -> Char -> GeneralCategory
- checkDatabase :: UArray Int Word64 -> Either String GenCatDatabase
- checkDatabase' :: GenCatDatabase -> Either String GenCatDatabase
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-23bits represent the low codepoint range (inclusive)24-47bits represent the high codepoint range (inclusive)47-63bits represent general category values consistent toGeneralCategory'sEnuminstance.
Instances
| Binary GenCatDatabase Source # | |
Defined in Data.Char.GeneralCategory.Database Methods put :: GenCatDatabase -> Put # get :: Get GenCatDatabase # putList :: [GenCatDatabase] -> Put # | |
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.