settei
Safe HaskellNone
LanguageGHC2024

Settei.Key

Description

 
Synopsis

Documentation

data Key Source #

A validated, hierarchical configuration key.

Instances

Instances details
Generic Key Source # 
Instance details

Defined in Settei.Key

Associated Types

type Rep Key 
Instance details

Defined in Settei.Key

type Rep Key = D1 ('MetaData "Key" "Settei.Key" "settei-0.2.0.0-inplace" 'True) (C1 ('MetaCons "ValidatedKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "segments") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty Text))))

Methods

from :: Key -> Rep Key x #

to :: Rep Key x -> Key #

Show Key Source # 
Instance details

Defined in Settei.Key

Methods

showsPrec :: Int -> Key -> ShowS #

show :: Key -> String #

showList :: [Key] -> ShowS #

Eq Key Source # 
Instance details

Defined in Settei.Key

Methods

(==) :: Key -> Key -> Bool #

(/=) :: Key -> Key -> Bool #

Ord Key Source # 
Instance details

Defined in Settei.Key

Methods

compare :: Key -> Key -> Ordering #

(<) :: Key -> Key -> Bool #

(<=) :: Key -> Key -> Bool #

(>) :: Key -> Key -> Bool #

(>=) :: Key -> Key -> Bool #

max :: Key -> Key -> Key #

min :: Key -> Key -> Key #

type Rep Key Source # 
Instance details

Defined in Settei.Key

type Rep Key = D1 ('MetaData "Key" "Settei.Key" "settei-0.2.0.0-inplace" 'True) (C1 ('MetaCons "ValidatedKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "segments") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty Text))))

data KeyError Source #

Why textual input could not be represented as a Key.

Instances

Instances details
Generic KeyError Source # 
Instance details

Defined in Settei.Key

Associated Types

type Rep KeyError 
Instance details

Defined in Settei.Key

type Rep KeyError = D1 ('MetaData "KeyError" "Settei.Key" "settei-0.2.0.0-inplace" 'False) (C1 ('MetaCons "KeyIsEmpty" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "KeySegmentIsEmpty" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "KeySegmentContainsDot" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text))))

Methods

from :: KeyError -> Rep KeyError x #

to :: Rep KeyError x -> KeyError #

Show KeyError Source # 
Instance details

Defined in Settei.Key

Eq KeyError Source # 
Instance details

Defined in Settei.Key

type Rep KeyError Source # 
Instance details

Defined in Settei.Key

type Rep KeyError = D1 ('MetaData "KeyError" "Settei.Key" "settei-0.2.0.0-inplace" 'False) (C1 ('MetaCons "KeyIsEmpty" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "KeySegmentIsEmpty" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "KeySegmentContainsDot" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text))))

mkKey :: NonEmpty Text -> Either KeyError Key Source #

Validate structural key segments.

parseKey :: Text -> Either KeyError Key Source #

Parse dot-separated text into a non-empty structural key.

renderKey :: Key -> Text Source #

Render a key using its canonical dot-separated spelling.

keySegments :: Key -> NonEmpty Text Source #

Return the structural segments of a key.