Safe Haskell | None |
---|---|
Language | Haskell2010 |
RichEnv.Types
Contents
Description
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
.
Constructors
RichEnv | |
Instances
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.
Constructors
Mappings | |
Fields |
Instances
FromJSON Mappings Source # | |||||
Defined in RichEnv.Types.Mappings | |||||
ToJSON Mappings Source # | |||||
Monoid Mappings Source # | |||||
Semigroup Mappings Source # | |||||
Generic Mappings Source # | |||||
Defined in RichEnv.Types.Mappings Associated Types
| |||||
Show Mappings Source # | |||||
Eq Mappings Source # | |||||
type Rep Mappings Source # | |||||
Defined in RichEnv.Types.Mappings |
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.
Instances
FromJSON Values Source # | |||||
Defined in RichEnv.Types.Values | |||||
ToJSON Values Source # | |||||
Monoid Values Source # | |||||
Semigroup Values Source # | |||||
Generic Values Source # | |||||
Defined in RichEnv.Types.Values Associated Types
| |||||
Show Values Source # | |||||
Eq Values Source # | |||||
type Rep Values Source # | |||||
Defined in RichEnv.Types.Values |
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.
Constructors
Prefixes | |
Fields
|
Instances
FromJSON Prefixes Source # | |||||
Defined in RichEnv.Types.Prefixes | |||||
ToJSON Prefixes Source # | |||||
Monoid Prefixes Source # | |||||
Semigroup Prefixes Source # | |||||
Generic Prefixes Source # | |||||
Defined in RichEnv.Types.Prefixes Associated Types
| |||||
Show Prefixes Source # | |||||
Eq Prefixes Source # | |||||
type Rep Prefixes Source # | |||||
Defined in RichEnv.Types.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
.