| Copyright | ©2020 James Alexander Feldman-Crough |
|---|---|
| License | MPL-2.0 |
| Maintainer | alex@fldcr.com |
| Safe Haskell | None |
| Language | Haskell2010 |
Prosidy.Types.Key
Description
Synopsis
- data Key
- makeKey :: Text -> Either KeyError Key
- rawKey :: Key -> Text
- unsafeMakeKey :: Text -> Key
- isValidKeyHead :: Char -> Bool
- isValidKeyTail :: Char -> Bool
- data KeyError
- data InvalidCharacter = InvalidCharacter {}
The Key type.
A Key is an identifier used in tags, properties, and setting names.
Instances
| Eq Key Source # | |
| Ord Key Source # | |
| Show Key Source # | |
| IsString Key Source # |
|
Defined in Prosidy.Types.Key Methods fromString :: String -> Key # | |
| Generic Key Source # | |
| Hashable Key Source # | |
Defined in Prosidy.Types.Key | |
| ToJSON Key Source # | |
Defined in Prosidy.Types.Key | |
| ToJSONKey Key Source # | |
Defined in Prosidy.Types.Key | |
| FromJSON Key Source # | |
| FromJSONKey Key Source # | |
Defined in Prosidy.Types.Key | |
| Binary Key Source # | |
| NFData Key Source # | |
Defined in Prosidy.Types.Key | |
| type Rep Key Source # | |
Defined in Prosidy.Types.Key | |
Creating Keys and unwrapping them
Checking validity of raw text.
isValidKeyHead :: Char -> Bool Source #
Check if a character is suitable for use as the first character in a
Key.
isValidKeyTail :: Char -> Bool Source #
Check if a character is suitable for use as any character except the
first character in a Key.
Errors
Errors returned when creating invalid keys.
Constructors
| InvalidCharacterError InvalidCharacter | A character provided as a |
| EmptyKeyError | A string of length 0 was provided as a |
Instances
| Eq KeyError Source # | |
| Show KeyError Source # | |
| Exception KeyError Source # | |
Defined in Prosidy.Types.Key Methods toException :: KeyError -> SomeException # fromException :: SomeException -> Maybe KeyError # displayException :: KeyError -> String # | |
data InvalidCharacter Source #
Details for errors thrown when creating Keys with one or more invalid
characters.
Constructors
| InvalidCharacter | |
Fields
| |
Instances
| Eq InvalidCharacter Source # | |
Defined in Prosidy.Types.Key Methods (==) :: InvalidCharacter -> InvalidCharacter -> Bool # (/=) :: InvalidCharacter -> InvalidCharacter -> Bool # | |
| Show InvalidCharacter Source # | |
Defined in Prosidy.Types.Key Methods showsPrec :: Int -> InvalidCharacter -> ShowS # show :: InvalidCharacter -> String # showList :: [InvalidCharacter] -> ShowS # | |