Copyright | (c) 2019 Daniel YU |
---|---|
License | BSD3 |
Maintainer | leptonyu@gmail.com |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
This module is designed for implementating configuration file loading. Please don't use if you are not implemanting a new configuration file.
Synopsis
- type Source = SourceT QV
- data SourcePack
- addErr :: Monad m => String -> LoadSalakT m ()
- newVStr :: Text -> Priority -> Value
- data Selector
- simpleSelectors :: Text -> [Selector]
- emptySource :: Source
- nullSource :: Source -> Bool
- insertSource :: Value -> Source -> Source
- updateSources :: Monad m => [Selector] -> (Source -> m Source) -> Source -> m Source
- updateSource :: Monad m => Selector -> (Source -> m Source) -> Source -> m Source
- tryLoadFile :: MonadIO m => (FilePath -> LoadSalakT m ()) -> FilePath -> LoadSalakT m ()
- loadFile :: MonadIO m => String -> (Priority -> Source -> WriterT [String] IO Source) -> LoadSalakT m ()
- loading :: (Foldable f, Monad m) => String -> f a -> (Priority -> a -> m (Text, Value)) -> LoadSalakT m ()
SourcePack
data SourcePack Source #
Source package, used to store all properties.
Instances
Show SourcePack Source # | |
Defined in Salak.Types showsPrec :: Int -> SourcePack -> ShowS # show :: SourcePack -> String # showList :: [SourcePack] -> ShowS # | |
MonadReader SourcePack Prop Source # | |
Defined in Salak.Prop ask :: Prop SourcePack # local :: (SourcePack -> SourcePack) -> Prop a -> Prop a # reader :: (SourcePack -> a) -> Prop a # |
Selector
simpleSelectors :: Text -> [Selector] Source #
Source
emptySource :: Source Source #
nullSource :: Source -> Bool Source #
Load
tryLoadFile :: MonadIO m => (FilePath -> LoadSalakT m ()) -> FilePath -> LoadSalakT m () Source #