app-settings 0.2.0.0 → 0.2.0.1
raw patch · 3 files changed
+10/−7 lines, 3 filesdep ~hspecdep ~mtlPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
Dependency ranges changed: hspec, mtl
API changes (from Hackage documentation)
+ Data.AppSettings: getSetting' :: Read a => Conf -> Setting a -> a
Files
- Data/AppSettings.hs +2/−1
- Data/AppSettingsInternal.hs +4/−2
- app-settings.cabal +4/−4
Data/AppSettings.hs view
@@ -13,7 +13,8 @@ readSettings, ParseException, saveSettings,- setSetting) where+ setSetting,+ getSetting') where import System.Directory import qualified Data.Map as M
Data/AppSettingsInternal.hs view
@@ -67,8 +67,10 @@ -- if the setting is invalid in the config file instead of silently -- give you the default? --- | More low-level, please use the second function you get from 'readSettings',--- wrapped in a 'GetSetting' newtype.+-- | Most of the time you can use the second function you get from 'readSettings',+-- wrapped in a 'GetSetting' newtype, however sometimes it's nicer to just pass+-- a single 'Conf' to other functions if you're going to read or+-- write to the configuration. The GetSetting lets you only read. getSetting' :: (Read a) => Conf -> Setting a -> a getSetting' conf (Setting key defaultV) = fromMaybe defaultV $ getSettingValueFromConf conf key getSetting' conf (ListSetting key defaultV) = case getSettingValueFromConf conf $ key ++ "_1" of
app-settings.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: app-settings-version: 0.2.0.0+version: 0.2.0.1 synopsis: A library to manage application settings (INI file-like) description: A library to deal with application settings.@@ -99,7 +99,7 @@ Data.AppSettingsInternal -- other-extensions: build-depends: base >=4.6 && <5,- mtl == 2.1.*,+ mtl >= 2.1 && <2.3, containers == 0.5.*, directory == 1.2.*, text >= 0.10,@@ -114,9 +114,9 @@ main-is: Tests.hs default-language: Haskell2010 build-depends: base,- hspec >= 1.8 && <1.9,+ hspec >= 1.8 && <1.10, HUnit >= 1.2 && <1.3,- mtl == 2.1.*,+ mtl >= 2.1 && <2.3, containers == 0.5.*, directory == 1.2.*, text >= 0.10,