Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module contains the basic types used by the library and their typeclass instances.
Synopsis
- data RichEnv = RichEnv {}
- defaultRichEnv :: RichEnv
- type Environment = [(Text, Text)]
- newtype Mappings = Mappings {}
- newtype Values = Values {}
- newtype Prefixes = Prefixes {
- unPrefixes :: HashMap Text [Text]
- toEnvironment :: [(String, String)] -> Environment
- fromEnvironment :: Environment -> [(String, String)]
Types
Type that represents a set of rules that generate environment variables. A value of this type can be retrieved from a configuration file (e.g. YAML) due to its FromJSON
instance, or persisted into one with ToJSON
.
Instances
FromJSON RichEnv Source # | |
ToJSON RichEnv Source # | |
Defined in RichEnv.Types | |
Monoid RichEnv Source # | |
Semigroup RichEnv Source # | |
Generic RichEnv Source # | |
Show RichEnv Source # | |
Eq RichEnv Source # | |
type Rep RichEnv Source # | |
Defined in RichEnv.Types type Rep RichEnv = D1 ('MetaData "RichEnv" "RichEnv.Types" "richenv-0.1.0.0-KNQ9gi9XpkMBNNgyRGREMU" 'False) (C1 ('MetaCons "RichEnv" 'PrefixI 'True) (S1 ('MetaSel ('Just "values") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Values) :*: (S1 ('MetaSel ('Just "mappings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Mappings) :*: S1 ('MetaSel ('Just "prefixes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Prefixes)))) |
defaultRichEnv :: RichEnv Source #
Default RichEnv
value. With everything empty.
type Environment = [(Text, Text)] Source #
A list of key-value pairs representing environment variables.
A list of key-value pairs representing environment variable name mappings. The internal representation is a 'HashMap Text Text', where the key is the final variable name and the value is the current one which will be replaced.
A list of key-value pairs representing environment variables. The internal representation is a 'HashMap Text Text', where the key is the variable name and the value is the variable value.
A list of key-value pairs representing environment variable name prefix mappings. The internal representation is a 'HashMap Text [Text]', where the key is the final prefix and the value is the list of prefixes that will be replaced.
Prefixes | |
|
Environment transformations
toEnvironment :: [(String, String)] -> Environment Source #
Transform the type returned from getEnvironment
([(String, String)]
) to use Text
instead.
fromEnvironment :: Environment -> [(String, String)] Source #
Get back a [(String, String)]
from an Environment
.