Copyright | (c) 2022 Composewell Technologies and Contributors |
---|---|
License | Apache-2.0 |
Maintainer | streamly@composewell.com |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Unicode.Char.General.Names
Description
Unicode character names and name aliases with String
API.
See Unicode standard 15.0.0, section 4.8.
There are also two optional APIs:
ByteString
API, which requires using the package flaghas-bytestring
.Text
API, which requires using the package flaghas-text
.
Since: 0.1.0
Synopsis
- unicodeVersion :: Version
- name :: Char -> Maybe String
- nameOrAlias :: Char -> Maybe String
- nameOrLabel :: Char -> String
- correctedName :: Char -> Maybe String
- data NameAliasType
- nameAliases :: Char -> [String]
- nameAliasesByType :: NameAliasType -> Char -> [String]
- nameAliasesWithTypes :: Char -> [(NameAliasType, [String])]
- label :: Char -> String
Unicode version
unicodeVersion :: Version Source #
Version of the Unicode standard used by this package: 15.1.0.
Since: 0.3.0
Name
nameOrAlias :: Char -> Maybe String Source #
Returns a character’s name
if defined,
otherwise returns its first name alias if defined.
Since: 0.1.0
nameOrLabel :: Char -> String Source #
Returns a character’s name
if defined,
otherwise returns its label between angle brackets.
Since: 0.4.0
correctedName :: Char -> Maybe String Source #
Returns corrected name of a character (see Correction
),
if defined, otherwise returns its original name
if defined.
Since: 0.1.0
Name Aliases
data NameAliasType Source #
Type of name alias. See Unicode Standard 15.0.0, section 4.8.
Since: 0.1.0
Constructors
Correction | Corrections for serious problems in the character names. |
Control | ISO 6429 names for |
Alternate | A few widely used alternate names for format characters. |
Figment | Several documented labels for |
Abbreviation | Commonly occurring abbreviations (or acronyms) for control codes, format characters, spaces, and variation selectors. |
Instances
nameAliases :: Char -> [String] Source #
All name aliases of a character, if defined. The names are listed in the original order of the UCD.
See nameAliasesWithTypes
for the detailed list by alias type.
Since: 0.1.0
nameAliasesByType :: NameAliasType -> Char -> [String] Source #
Name aliases of a character for a specific name alias type.
Since: 0.1.0
nameAliasesWithTypes :: Char -> [(NameAliasType, [String])] Source #
Detailed character names aliases. The names are listed in the original order of the UCD.
See nameAliases
if the alias type is not required.
Since: 0.1.0
Label
label :: Char -> String Source #
Returns the label of a code point if it has no character name, otherwise
returns "UNDEFINED"
.
See subsection “Code Point Labels” in section 4.8 “Name” of the Unicode Standard.
>>>
label '\0'
"control-0000">>>
label 'a'
"UNDEFINED">>>
label '\xffff'
"noncharacter-FFFF"
Since: 0.4.0