unicode-data-parser-0.1.0.1: Parsers for Unicode Character Database (UCD) files
Copyright(c) 2024 Pierre Le Marre
Maintainerdev@wismill.eu
Stabilityexperimental
Safe HaskellNone
LanguageGHC2021

UCD.Parser.Common

Description

Miscellaneous bits common to various parsers

Synopsis

Documentation

readCodePoint :: ByteString -> Char Source #

Parse a code point formatted as hexadecimal

Warning: raise an error on invalid input.

>>> readCodePoint "0061"
'a'

Since: 0.1.0

readCodePointM :: ByteString -> Maybe Char Source #

Parse a code point formatted as hexadecimal, or return Nothing on an empty string.

Warning: raise an error on invalid input.

>>> readCodePointM "0061"
Just 'a'
>>> readCodePointM ""
Nothing

See also: readCodePoint.

Since: 0.1.0

data UnicodeRange a Source #

A Unicode code point range

Since: 0.1.0

Constructors

SingleChar 

Fields

CharRange 

Fields

Instances

Instances details
Show a => Show (UnicodeRange a) Source # 
Instance details

Defined in UCD.Parser.Common

Methods

showsPrec :: Int -> UnicodeRange a -> ShowS

show :: UnicodeRange a -> String

showList :: [UnicodeRange a] -> ShowS

Eq a => Eq (UnicodeRange a) Source # 
Instance details

Defined in UCD.Parser.Common

Methods

(==) :: UnicodeRange a -> UnicodeRange a -> Bool

(/=) :: UnicodeRange a -> UnicodeRange a -> Bool

parseRange :: ByteString -> UnicodeRange () Source #

Parse AAAA..BBBB range

Since: 0.1.0

pattern Comma :: Word8 Source #

,

pattern HashTag :: Word8 Source #

#

pattern NewLine :: Word8 Source #

'\n'

pattern Period :: Word8 Source #

.

pattern SemiColon :: Word8 Source #

;

pattern Slash :: Word8 Source #

/