| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
MiniLight.Component.Loader
Synopsis
- data ComponentConfig = ComponentConfig {
- name :: Text
- properties :: Value
- data AppConfig = AppConfig {
- app :: [ComponentConfig]
- loadAppConfig :: (HasLightEnv env, MonadIO m) => FilePath -> (Text -> Value -> LightT env m Component) -> LightT env m [Component]
- data Expr
- parser :: Parser Expr
- data Context = Context {}
- getAt :: Value -> [Either Int Text] -> Value
- normalize :: Vector (Either Int Text) -> [Either Int Text] -> [Either Int Text]
- pattern Arithmetic :: Text -> Scientific -> Scientific -> Expr
- eval :: Context -> Expr -> Value
- convertPath :: Text -> [Either Int Text]
- convert :: Context -> Text -> Value
- parseText :: Parser a -> Text -> Result a
- resolve :: Value -> Value
Documentation
data ComponentConfig Source #
Constructors
| ComponentConfig | |
Fields
| |
Instances
| Generic ComponentConfig Source # | |
Defined in MiniLight.Component.Loader Associated Types type Rep ComponentConfig :: Type -> Type # Methods from :: ComponentConfig -> Rep ComponentConfig x # to :: Rep ComponentConfig x -> ComponentConfig # | |
| FromJSON ComponentConfig Source # | |
Defined in MiniLight.Component.Loader Methods parseJSON :: Value -> Parser ComponentConfig parseJSONList :: Value -> Parser [ComponentConfig] | |
| type Rep ComponentConfig Source # | |
Defined in MiniLight.Component.Loader type Rep ComponentConfig = D1 (MetaData "ComponentConfig" "MiniLight.Component.Loader" "minilight-0.1.0-inplace" False) (C1 (MetaCons "ComponentConfig" PrefixI True) (S1 (MetaSel (Just "name") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Text) :*: S1 (MetaSel (Just "properties") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Value))) | |
Constructors
| AppConfig | |
Fields
| |
Instances
| Generic AppConfig Source # | |
| FromJSON AppConfig Source # | |
Defined in MiniLight.Component.Loader | |
| type Rep AppConfig Source # | |
Defined in MiniLight.Component.Loader type Rep AppConfig = D1 (MetaData "AppConfig" "MiniLight.Component.Loader" "minilight-0.1.0-inplace" False) (C1 (MetaCons "AppConfig" PrefixI True) (S1 (MetaSel (Just "app") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 [ComponentConfig]))) | |
Arguments
| :: (HasLightEnv env, MonadIO m) | |
| => FilePath | Filepath to the yaml file. |
| -> (Text -> Value -> LightT env m Component) | Specify any resolver. |
| -> LightT env m [Component] |
Load an config file and construct components.
pattern Arithmetic :: Text -> Scientific -> Scientific -> Expr Source #