úÎHE¶      Safe-Inferred0The configuration file is in an invalid format. "The in-memory configuration data.  !"#!  !"# Safe-InferredThe type of a setting.  It contains the setting name 8 (key in the configuration file) and its default value. BIt is advised to have a module in your project handling settings.  In this module, you'(d have all the settings declared at the  toplevel, and exported. ) The rest of the application can then do    getSetting <setting>  setSetting <conf> <setting> <value>  and so on. D declares a simple setting. A value for that setting will be stored - in the configuration file in a single line. " however declares a list setting. + While it is perfectly fine to store lists 9 using the usual Setting constructor, if you have a list ; of more complex items, you will get very long lines and a > configuration file very difficult to edit or review by hand. <The ListSetting will store settings using one line per item  in the list:   testList :: Setting [String] ? testList = ListSetting "testList" ["list1", "list2", "list3"] ,Now the configuration file looks like that:   testList_1="list1"  testList_2="list2"  testList_3="list3" 7Also note that an empty ListSetting is stored like so:  testList= >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  to other functions if you're going to read or @ write to the configuration. The GetSetting lets you only read. $%&$%&$%& Safe-Inferred 3Where to look for or store the configuration file. %Absolute path to a location on disk. .Automatically build the location based on the  application name. It will be ~/.<app name>/ config.ini. 6Information about the default configuration. Contains * all the settings (that you declare using ) 8 and their default values. It is useful when you save a 5 configuration file, if you give this information to , 8 it will save default options in the configuration file ; in a commented form, as a form of documentation to a user ( who would edit the configuration file. 3 However this is completely optional, you can give    if you don't want this behaviour. /Default configuration containing no options. It's fine  to give that to  if you don't want default 5 settings being written to the configuration file in  commented form (see  ) see the  documentation. Used in combination with  to register settings. ' Registering settings is optional, see  .  " defaultSettings :: DefaultConfig ) defaultSettings = getDefaultConfig $ do  setting <setting1>  setting <setting2> Read settings from disk.  Because it is doing file I/O it is smart to wrap the call  with a try, as I/O exceptions can be thrown. ! Also, the function will throw a  if the ! file is not properly formatted. 9 NOTE that if the file is properly formatted in general, : but a value is stored in an invalid format (for instance "hello" @ for a Double), you will get no error and get the default value / for that setting when you attempt to read it. 0This function returns a pair. The first element 8 is the configuration itself, which you can use to save # back or modify the configuration. 1 The second element is a function wrapped in the   ; newtype. This function allows you to read a configuration < option simply by giving that option (without that callback  you'#d have to call getSetting settings <setting>, so * the callback lets you save a parameter).  There is no such shortcut for  though, as it's @ normally used less often and in other contexts, it is probably 5 OK to have that extra parameter for the setSetting. Example of use:   readResult <- try $ readSettings (Path " my.config")  case readResult of , Right (conf, GetSetting getSetting) -> do & let textSize = getSetting fontSize ) saveSettings emptyDefaultConfig (Path " my.config") conf % Left (x :: SomeException) -> error "Error reading the config file!" 0It is advised to run the save within a try call  because it does disk I/*O, otherwise the call is straightforward. "Change the value of a setting. You'll have to call  ( so that the change is written to disk.  '()*+,       '()*+,-        !"#$%&'()*+,app-settings-0.2.0.3Data.AppSettingsData.SerializationData.AppSettingsInternalParseExceptionConfSetting ListSetting getSetting' FileLocationPathAutoFromAppName DefaultConfig GetSettingemptyDefaultConfigsettinggetDefaultConfig readSettings saveSettings setSetting ConfigElementComment ConfigEntry SettingInfovalueuserSetreadConfigFile isConfigEntryparseConfigFilecomment configEntry emptyLinewriteConfigFilewriteConfigEntry$fExceptionParseExceptionisKeyForListSettinggetSettingValueFromConfdecodeListSettinggetPathForLocationaddListSettingscleanListSettinggetSettingsFoldergetConfigFileName$fShowGetSetting