unicode-data-names-0.4.0: Unicode characters names and aliases
Copyright(c) 2022 Composewell Technologies and Contributors
LicenseApache-2.0
Maintainerstreamly@composewell.com
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

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 flag has-bytestring.
  • Text API, which requires using the package flag has-text.

Since: 0.1.0

Synopsis

Unicode version

unicodeVersion :: Version Source #

Version of the Unicode standard used by this package: 15.1.0.

Since: 0.3.0

Name

name :: Char -> Maybe String Source #

Name of a character, if defined.

Since: 0.1.0

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 C0 and C1 control functions, and other commonly occurring names for control codes.

Alternate

A few widely used alternate names for format characters.

Figment

Several documented labels for C1 control code points which were never actually approved in any standard.

Abbreviation

Commonly occurring abbreviations (or acronyms) for control codes, format characters, spaces, and variation selectors.

Instances

Instances details
Bounded NameAliasType Source # 
Instance details

Defined in Unicode.Internal.Char.UnicodeData.NameAliases

Enum NameAliasType Source # 
Instance details

Defined in Unicode.Internal.Char.UnicodeData.NameAliases

Generic NameAliasType Source # 
Instance details

Defined in Unicode.Internal.Char.UnicodeData.NameAliases

Associated Types

type Rep NameAliasType :: Type -> Type #

Ix NameAliasType Source # 
Instance details

Defined in Unicode.Internal.Char.UnicodeData.NameAliases

Show NameAliasType Source # 
Instance details

Defined in Unicode.Internal.Char.UnicodeData.NameAliases

Eq NameAliasType Source # 
Instance details

Defined in Unicode.Internal.Char.UnicodeData.NameAliases

Ord NameAliasType Source # 
Instance details

Defined in Unicode.Internal.Char.UnicodeData.NameAliases

type Rep NameAliasType Source # 
Instance details

Defined in Unicode.Internal.Char.UnicodeData.NameAliases

type Rep NameAliasType = D1 ('MetaData "NameAliasType" "Unicode.Internal.Char.UnicodeData.NameAliases" "unicode-data-names-0.4.0-ETIVw38SDJC3ZuU0wIINH4" 'False) ((C1 ('MetaCons "Correction" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Control" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Alternate" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Figment" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Abbreviation" 'PrefixI 'False) (U1 :: Type -> Type))))

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