diff --git a/ChangeLog.md b/ChangeLog.md index 78eb1fd..00c0ae3 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,15 @@ # Revision history for config-parser -## 0.1.0.0 -- YYYY-mm-dd +## 1.0.0.0 -- 2017-12-04 + +* Removed 'ConfigParser' constructor with janky call to 'error'. Non-unique keys + will now cause parsing to fail, instead. +* Duplicate keys in config files will now cause parsing to fail. +* 'ConfigOption' now has a 'required' field to specify that omitting a + particular key from a config file is an error. Omiting required keys causes + parsing to fail. +* The 'boundedIntegral' parser is now correctly exported. + +## 0.2.0.0 -- 2017-10-31 * First version. Released on an unsuspecting world. diff --git a/README.md b/README.md index 61732fc..adb6aab 100644 --- a/README.md +++ b/README.md @@ -31,19 +31,22 @@ import Text.ConfigParser cp :: ConfigParser (Maybe String, Maybe Integer, [Integer]) cp = configParser (Nothing, Nothing, []) [ ConfigOption - { key = "a_string" - , parser = string - , action = \s (_,n,ns) -> (Just s, n, ns) + { key = "a_string" + , required = True + , parser = string + , action = \s (_,n,ns) -> (Just s, n, ns) } , ConfigOption - { key = "a_number" - , parser = integer - , action = \n (s,_,ns) -> (s, Just n, ns) + { key = "a_number" + , required = True + , parser = integer + , action = \n (s,_,ns) -> (s, Just n, ns) } , ConfigOption - { key = "a_list" - , parser = list integer - , action = \ns (s,n,_) -> (s, n, ns) + { key = "a_list" + , required = True + , parser = list integer + , action = \ns (s,n,_) -> (s, n, ns) } ] diff --git a/config-parser.cabal b/config-parser.cabal index 8d3cf66..d85695d 100644 --- a/config-parser.cabal +++ b/config-parser.cabal @@ -1,5 +1,5 @@ name: config-parser -version: 0.2.0.0 +version: 1.0.0.0 synopsis: Parse config files using parsec and generate parse errors on unhandled keys description: This is yet another entry in Haskell's enourmous collection