Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
- entityCodePoints :: Text -> Maybe [Int]
- entityChars :: Text -> Maybe Text
- isValidEntity :: Text -> Bool
- entityNameCodePoints :: Text -> Maybe [Int]
- entityNameChars :: Text -> Maybe Text
- isValidEntityName :: Text -> Bool
Entity lookup
entityCodePoints :: Text -> Maybe [Int] Source
Given an entity looks up unicode code points that represent it.
>>>
entityCodePoints "μ"
Just [966]
>>>
entityCodePoints "&nano;"
Nothing
entityChars :: Text -> Maybe Text Source
Given an entity returns it's textual representation (if any).
>>>
entityChars "μ"
Just "μ"
>>>
entityChars "&nano;"
Nothing
Entity validation
isValidEntity :: Text -> Bool Source
Check if entity is valid (if such entity exists).
>>>
isValidEntity "μ"
True
>>>
isValidEntity "&nano;"
False
Entity lookup by name
entityNameCodePoints :: Text -> Maybe [Int] Source
Given a name of entity looks up code points that represent it.
>>>
entityNameCodePoints "mu"
Just [966]
>>>
entityNameCodePoints "nano"
Nothing
entityNameChars :: Text -> Maybe Text Source
Given a name of entity returns it's textual representation (if any).
>>>
entityNameChars "mu"
Just "μ"
>>>
entityNameChars "nano"
Nothing
Entity name validation
isValidEntityName :: Text -> Bool Source
Check if entity name is valid (if corresponding entity exists).
>>>
isValidEntityName "mu"
True
>>>
isValidEntityName "nano"
False