Copyright | ©2020 James Alexander Feldman-Crough |
---|---|
License | MPL-2.0 |
Maintainer | alex@fldcr.com |
Safe Haskell | Safe |
Language | Haskell2010 |
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 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.Internal.JSON | |
Binary Key Source # | |
NFData Key Source # | |
Defined in Prosidy.Types.Key | |
Pretty Key Source # | |
Defined in Prosidy.Types.Key | |
type Rep Key Source # | |
Defined in Prosidy.Types.Key |
Creating Key
s 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.
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 toException :: KeyError -> SomeException # fromException :: SomeException -> Maybe KeyError # displayException :: KeyError -> String # |
data InvalidCharacter Source #
Details for errors thrown when creating Key
s with one or more invalid
characters.
InvalidCharacter | |
|
Instances
Eq InvalidCharacter Source # | |
Defined in Prosidy.Types.Key (==) :: InvalidCharacter -> InvalidCharacter -> Bool # (/=) :: InvalidCharacter -> InvalidCharacter -> Bool # | |
Show InvalidCharacter Source # | |
Defined in Prosidy.Types.Key showsPrec :: Int -> InvalidCharacter -> ShowS # show :: InvalidCharacter -> String # showList :: [InvalidCharacter] -> ShowS # |