module Data.ConfigFile.Monadic (
module Reexporting,
simpleAccess,
interpolatingAccess,
readfile, readhandle, readstring,
has_section, options, has_option, items,
set, setshow, remove_option, add_section, remove_section
) where
import Control.Monad.Error
import System.IO(Handle)
import Data.ConfigFile as Reexporting (SectionSpec, OptionSpec, ConfigParser(..),
CPErrorData, CPError, emptyCP, Get_C(..), sections, merge, to_string)
import qualified Data.ConfigFile as C
simpleAccess :: MonadError CPError m =>
SectionSpec -> OptionSpec -> ConfigParser -> m String
simpleAccess :: forall (m :: * -> *).
MonadError CPError m =>
SectionSpec -> SectionSpec -> ConfigParser -> m SectionSpec
simpleAccess SectionSpec
s SectionSpec
o ConfigParser
cp = forall (m :: * -> *).
MonadError CPError m =>
ConfigParser -> SectionSpec -> SectionSpec -> m SectionSpec
C.simpleAccess ConfigParser
cp SectionSpec
s SectionSpec
o
interpolatingAccess :: MonadError CPError m =>
Int ->
SectionSpec -> OptionSpec -> ConfigParser
-> m String
interpolatingAccess :: forall (m :: * -> *).
MonadError CPError m =>
Int -> SectionSpec -> SectionSpec -> ConfigParser -> m SectionSpec
interpolatingAccess Int
maxdepth SectionSpec
s SectionSpec
o ConfigParser
cp = forall (m :: * -> *).
MonadError CPError m =>
Int -> ConfigParser -> SectionSpec -> SectionSpec -> m SectionSpec
C.interpolatingAccess Int
maxdepth ConfigParser
cp SectionSpec
s SectionSpec
o
readfile :: MonadError CPError m => FilePath -> ConfigParser -> IO (m ConfigParser)
readfile :: forall (m :: * -> *).
MonadError CPError m =>
SectionSpec -> ConfigParser -> IO (m ConfigParser)
readfile SectionSpec
fp ConfigParser
cp = forall (m :: * -> *).
MonadError CPError m =>
ConfigParser -> SectionSpec -> IO (m ConfigParser)
C.readfile ConfigParser
cp SectionSpec
fp
readhandle :: MonadError CPError m => Handle -> ConfigParser -> IO (m ConfigParser)
readhandle :: forall (m :: * -> *).
MonadError CPError m =>
Handle -> ConfigParser -> IO (m ConfigParser)
readhandle Handle
h ConfigParser
cp = forall (m :: * -> *).
MonadError CPError m =>
ConfigParser -> Handle -> IO (m ConfigParser)
C.readhandle ConfigParser
cp Handle
h
readstring :: MonadError CPError m =>
String -> ConfigParser -> m ConfigParser
readstring :: forall (m :: * -> *).
MonadError CPError m =>
SectionSpec -> ConfigParser -> m ConfigParser
readstring SectionSpec
cp ConfigParser
s = forall (m :: * -> *).
MonadError CPError m =>
ConfigParser -> SectionSpec -> m ConfigParser
C.readstring ConfigParser
s SectionSpec
cp
has_section :: SectionSpec -> ConfigParser -> Bool
has_section :: SectionSpec -> ConfigParser -> Bool
has_section SectionSpec
x ConfigParser
cp = ConfigParser -> SectionSpec -> Bool
C.has_section ConfigParser
cp SectionSpec
x
add_section :: MonadError CPError m =>
SectionSpec -> ConfigParser -> m ConfigParser
add_section :: forall (m :: * -> *).
MonadError CPError m =>
SectionSpec -> ConfigParser -> m ConfigParser
add_section SectionSpec
s ConfigParser
cp = forall (m :: * -> *).
MonadError CPError m =>
ConfigParser -> SectionSpec -> m ConfigParser
C.add_section ConfigParser
cp SectionSpec
s
options :: MonadError CPError m =>
SectionSpec -> ConfigParser -> m [OptionSpec]
options :: forall (m :: * -> *).
MonadError CPError m =>
SectionSpec -> ConfigParser -> m [SectionSpec]
options SectionSpec
x ConfigParser
cp = forall (m :: * -> *).
MonadError CPError m =>
ConfigParser -> SectionSpec -> m [SectionSpec]
C.options ConfigParser
cp SectionSpec
x
has_option :: SectionSpec -> OptionSpec -> ConfigParser -> Bool
has_option :: SectionSpec -> SectionSpec -> ConfigParser -> Bool
has_option SectionSpec
s SectionSpec
o ConfigParser
cp = ConfigParser -> SectionSpec -> SectionSpec -> Bool
C.has_option ConfigParser
cp SectionSpec
s SectionSpec
o
items :: MonadError CPError m =>
SectionSpec -> ConfigParser -> m [(OptionSpec, String)]
items :: forall (m :: * -> *).
MonadError CPError m =>
SectionSpec -> ConfigParser -> m [(SectionSpec, SectionSpec)]
items SectionSpec
s ConfigParser
cp = forall (m :: * -> *).
MonadError CPError m =>
ConfigParser -> SectionSpec -> m [(SectionSpec, SectionSpec)]
C.items ConfigParser
cp SectionSpec
s
set :: MonadError CPError m =>
SectionSpec -> OptionSpec -> String -> ConfigParser -> m ConfigParser
set :: forall (m :: * -> *).
MonadError CPError m =>
SectionSpec
-> SectionSpec -> SectionSpec -> ConfigParser -> m ConfigParser
set SectionSpec
s SectionSpec
passedo SectionSpec
val ConfigParser
cp = forall (m :: * -> *).
MonadError CPError m =>
ConfigParser
-> SectionSpec -> SectionSpec -> SectionSpec -> m ConfigParser
C.set ConfigParser
cp SectionSpec
s SectionSpec
passedo SectionSpec
val
setshow :: (Show a, MonadError CPError m) =>
SectionSpec -> OptionSpec -> a -> ConfigParser -> m ConfigParser
setshow :: forall a (m :: * -> *).
(Show a, MonadError CPError m) =>
SectionSpec -> SectionSpec -> a -> ConfigParser -> m ConfigParser
setshow SectionSpec
s SectionSpec
o a
val ConfigParser
cp = forall a (m :: * -> *).
(Show a, MonadError CPError m) =>
ConfigParser -> SectionSpec -> SectionSpec -> a -> m ConfigParser
C.setshow ConfigParser
cp SectionSpec
s SectionSpec
o a
val
remove_option :: MonadError CPError m =>
SectionSpec -> OptionSpec -> ConfigParser -> m ConfigParser
remove_option :: forall (m :: * -> *).
MonadError CPError m =>
SectionSpec -> SectionSpec -> ConfigParser -> m ConfigParser
remove_option SectionSpec
s SectionSpec
passedo ConfigParser
cp = forall (m :: * -> *).
MonadError CPError m =>
ConfigParser -> SectionSpec -> SectionSpec -> m ConfigParser
C.remove_option ConfigParser
cp SectionSpec
s SectionSpec
passedo
remove_section :: MonadError CPError m =>
SectionSpec -> ConfigParser -> m ConfigParser
remove_section :: forall (m :: * -> *).
MonadError CPError m =>
SectionSpec -> ConfigParser -> m ConfigParser
remove_section SectionSpec
s ConfigParser
cp = forall (m :: * -> *).
MonadError CPError m =>
ConfigParser -> SectionSpec -> m ConfigParser
C.remove_section ConfigParser
cp SectionSpec
s