minilight-0.3.0: A SDL2-based graphics library, batteries-included.

Safe HaskellNone
LanguageHaskell2010

MiniLight.Component.Loader

Synopsis

Documentation

resolveConfig :: MonadIO m => FilePath -> m (Either String AppConfig) Source #

Load an config file and return the resolved AppConfig.

loadAppConfig Source #

Arguments

:: (HasLightEnv env, HasLoaderEnv env, MonadIO m, MonadCatch m) 
=> FilePath

Filepath to the yaml file.

-> Resolver

Specify any resolver.

-> LightT env m () 

Load an config file and set in the environment. Calling this function at once, this overrides all values in the environment. This will generate an error log and skip the component if the configuration is invalid. This function also assign unique IDs for each component, using assignUID.

patchAppConfig Source #

Arguments

:: (HasLightEnv env, HasLoaderEnv env, MonadIO m, MonadCatch m) 
=> FilePath

Filepath to the yaml file.

-> Resolver

Specify any resolver.

-> LightT env m () 

Load the config file again and place the newly loaded components. This is used for HCR (hot component replacement). Call loadAppConfig first.