| Safe Haskell | None |
|---|
Yi.Config.Simple.Types
Description
exports from Yi.Config.Simple which are useful to "core yi" rather than just config files.
- newtype ConfigM a = ConfigM {
- runConfigM :: StateT Config IO a
- type Field a = Accessor Config a
- customVariable :: YiConfigVariable a => Field a
Documentation
The configuration monad. Run it with configMain.
Constructors
| ConfigM | |
Fields
| |
customVariable :: YiConfigVariable a => Field aSource
Accessor for any YiConfigVariable, to be used by modules defining
YiConfigVariables. Such modules should provide a custom-named field.
For instance, take the following hypothetical YiConfigVariable:
newtype UserName = UserName { unUserName :: String }
deriving(Typeable, Binary, Initializable)
instance YiConfigVariable UserName
$(nameDeriveAccessors ''UserName (n -> Just (n ++ "A")))
userName :: Field String
userName = unUserNameA . customVariableHere, the hypothetical library would provide the field userName to be used in preference to customVariable.