packages feed

config-ini 0.2.2.0 → 0.2.3.0

raw patch · 7 files changed

+28/−11 lines, 7 filesdep ~basedep ~megaparsecdep ~textPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: base, megaparsec, text

API changes (from Hackage documentation)

+ Data.Ini.Config.Bidir: iniValueL :: Lens (Ini s) (Ini s) s s
- Data.Ini.Config.Bidir: (&) :: () => a -> (a -> b) -> b
+ Data.Ini.Config.Bidir: (&) :: () => a -> a -> b -> b
- Data.Ini.Config.Bidir: FieldValue :: (Text -> Either String a) -> (a -> Text) -> FieldValue a
+ Data.Ini.Config.Bidir: FieldValue :: Text -> Either String a -> a -> Text -> FieldValue a

Files

CHANGELOG.md view
@@ -1,3 +1,10 @@+0.2.3.0+=======++- Add the `iniValueL` lens for access to the underlying INI value in a+  value of type `Ini s`+- Bumped compatible version of `megaparsec`+ 0.2.2.0 ======= 
README.md view
@@ -1,6 +1,6 @@ # `config-ini` -[![Hackage](https://img.shields.io/hackage/v/config-ini.svg)](https://hackage.haskell.org/package/config-ini)+[![Hackage](https://img.shields.io/hackage/v/config-ini.svg)](https://hackage.haskell.org/package/config-ini) ![stability: stable](https://img.shields.io/badge/stability-stable-green.svg)  The `config-ini` library is a Haskell library for doing elementary INI file parsing in a quick and painless way. 
config-ini.cabal view
@@ -1,5 +1,5 @@ name:             config-ini-version:          0.2.2.0+version:          0.2.3.0 synopsis:         A library for simple INI-based configuration files. homepage:         https://github.com/aisamanra/config-ini bug-reports:      https://github.com/aisamanra/config-ini/issues@@ -21,8 +21,7 @@ copyright:        ©2018 Getty Ritter category:         Configuration build-type:       Simple-cabal-version:    >= 1.18-bug-reports:      https://github.com/aisamanra/config-ini/issues+cabal-version:    1.18 extra-source-files:   README.md,   CHANGELOG.md,@@ -48,7 +47,7 @@                      , text                  >=1.2.2 && <1.3                      , unordered-containers  >=0.2.7 && <0.3                      , transformers          >=0.4.1 && <0.6-                     , megaparsec            >=6     && <7+                     , megaparsec            >=7     && <8   default-language:    Haskell2010  test-suite test-ini-compat@@ -89,3 +88,4 @@   build-depends:    base                   , doctest                   , microlens+                  , text
src/Data/Ini/Config.hs view
@@ -1,3 +1,4 @@+{-# OPTIONS_GHC -fno-warn-redundant-constraints #-} {-| Module     : Data.Ini.Config Copyright  : (c) Getty Ritter, 2017
src/Data/Ini/Config/Bidir.hs view
@@ -1,3 +1,4 @@+{-# OPTIONS_GHC -fno-warn-redundant-constraints #-} {-| Module     : Data.Ini.Config.Bidir Copyright  : (c) Getty Ritter, 2017@@ -144,6 +145,7 @@   Ini , ini , getIniValue+, iniValueL , getRawIni -- ** Parsing INI files , parseIni@@ -278,6 +280,13 @@ -- | Get the underlying Haskell value associated with the 'Ini'. getIniValue :: Ini s -> s getIniValue = iniCurr++mkLens :: (a -> b) -> (b -> a -> a) -> Lens a a b b+mkLens get' set' f a = (`set'` a) `fmap` f (get' a)++-- | The lens equivalent of 'getIniValue'+iniValueL :: Lens (Ini s) (Ini s) s s+iniValueL = mkLens iniCurr (\ i v -> v { iniCurr = i })  -- | Get the textual representation of an 'Ini' value. If this 'Ini' -- value is the result of 'parseIni', then it will attempt to retain
src/Data/Ini/Config/Raw.hs view
@@ -39,7 +39,7 @@ import           Text.Megaparsec import           Text.Megaparsec.Char -type Parser = Parsec (ErrorFancy Void) Text+type Parser = Parsec Void Text  -- | The 'NormalizedText' type is an abstract representation of text -- which has had leading and trailing whitespace removed and been@@ -146,7 +146,7 @@ -- amount of structure as needed to reconstruct the original INI file. parseRawIni :: Text -> Either String RawIni parseRawIni t = case runParser pIni "ini file" t of-  Left err -> Left (parseErrorPretty err)+  Left err -> Left (errorBundlePretty err)   Right v  -> Right v  pIni :: Parser RawIni@@ -160,7 +160,7 @@ sComment :: Parser BlankLine sComment = do   c <- oneOf ";#"-  txt <- T.pack `fmap` manyTill anyChar eol+  txt <- T.pack `fmap` manyTill anySingle eol   return (CommentLine c txt)  pSections :: Seq BlankLine -> Seq (NormalizedText, IniSection) -> Parser RawIni@@ -206,7 +206,7 @@   pos <- getCurrentLine   key <- T.pack `fmap` some (noneOf "[]=:")   delim <- oneOf ":="-  val <- T.pack `fmap` manyTill anyChar eol+  val <- T.pack `fmap` manyTill anySingle eol   return ( normalize key          , IniValue              { vLineNo       = pos@@ -218,7 +218,7 @@              } )  getCurrentLine :: Parser Int-getCurrentLine = (fromIntegral . unPos . sourceLine) `fmap` getPosition+getCurrentLine = (fromIntegral . unPos . sourceLine) `fmap` getSourcePos   -- | Serialize an INI file to text, complete with any comments which
test/doctest/Main.hs view
@@ -4,4 +4,4 @@  main :: IO () main = do-  doctest [ "src/Data/Ini/Config.hs", "-XOverloadedStrings"  ]+  doctest [ "src/Data/Ini/Config.hs", "-XOverloadedStrings", "-isrc" ]