packages feed

salak-toml 0.3.3 → 0.3.3.2

raw patch · 3 files changed

+17/−13 lines, 3 filesdep ~salak

Dependency ranges changed: salak

Files

salak-toml.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.12 name: salak-toml-version: 0.3.3+version: 0.3.3.2 license: MIT license-file: LICENSE copyright: 2019 Daniel YU@@ -21,11 +21,13 @@     other-modules:         Paths_salak_toml     default-language: Haskell2010-    default-extensions: RecordWildCards+    default-extensions: RecordWildCards TupleSections OverloadedStrings+                        ScopedTypeVariables FlexibleInstances MultiParamTypeClasses+                        DeriveGeneric     ghc-options: -Wall -fno-warn-orphans -fno-warn-missing-signatures     build-depends:         base >=4.10 && <5,-        salak >=0.3.3 && <0.4,+        salak >=0.3.3.2 && <0.4,         text >=1.2.3.1 && <1.3,         time >=1.8.0.2 && <1.9,         tomland >=1.0 && <1.2,@@ -39,7 +41,9 @@         Salak.Toml         Paths_salak_toml     default-language: Haskell2010-    default-extensions: RecordWildCards+    default-extensions: RecordWildCards TupleSections OverloadedStrings+                        ScopedTypeVariables FlexibleInstances MultiParamTypeClasses+                        DeriveGeneric     ghc-options: -Wall -fno-warn-orphans -fno-warn-missing-signatures     build-depends:         QuickCheck >=2.13.2 && <2.14,@@ -47,7 +51,7 @@         exceptions >=0.10.2 && <0.11,         hspec ==2.*,         mtl >=2.2.2 && <2.3,-        salak >=0.3.3 && <0.4,+        salak >=0.3.3.2 && <0.4,         text >=1.2.3.1 && <1.3,         time >=1.8.0.2 && <1.9,         tomland >=1.0 && <1.2,
src/Salak/Toml.hs view
@@ -41,8 +41,8 @@ instance HasLoad TOML where   loaders _ = (, loadToml) <$> ["toml", "tml"] -toSs :: T.Key -> [Key]-toSs (T.Key ps) = toS <$> N.toList ps+toSs :: T.Key -> Keys+toSs (T.Key ps) = fromKeys $ toS <$> N.toList ps  toS :: Piece -> Key toS = KT . unPiece@@ -54,12 +54,12 @@   . foldTableArrays tomlTableArrays   where     foldToml go p t = HM.foldlWithKey' go t p-    foldPairs       = foldToml (\s k v -> TR.modify' (Keys $ toSs k) (insertAnyValue i v) s)+    foldPairs       = foldToml (\s k v -> TR.modify' (toSs k) (insertAnyValue i v) s)     foldTableArrays = foldToml (\s _ v -> foldArray (N.toList v) (loadTOML i) s)     foldTables      = foldToml (\s _ v -> go v s)       where-        go (Leaf   k toml)    = TR.modify' (Keys $ toSs k) (loadTOML i toml)-        go (Branch k v tomap) = TR.modify' (Keys $ toSs k) (foldTables tomap) . maybe id (loadTOML i) v+        go (Leaf   k toml)    = TR.modify' (toSs k) (loadTOML i toml)+        go (Branch k v tomap) = TR.modify' (toSs k) (foldTables tomap) . maybe id (loadTOML i) v insertAnyValue :: Int -> AnyValue -> TraceSource -> TraceSource insertAnyValue i (AnyValue (Array   b))             ts = foldArray b (insertAnyValue i . AnyValue) ts insertAnyValue i (AnyValue (Bool    b))             ts = setVal i (VB  b) ts
test/Spec.hs view
@@ -50,17 +50,17 @@ data SubConf = SubConf   { hello :: String } deriving (Eq, Show, Generic) -instance Monad m => FromProp m SubConf where+instance FromProp m SubConf where   fromProp = SubConf <$> "hello" .?= "yyy" -instance Monad m => FromProp m Conf+instance FromProp m Conf  tomlProperty :: SpecWith () tomlProperty = do   context "load toml" $ do     it "salak.toml" $ do       loadAndRunSalak (loadToml "test/salak.toml") $ do-        SourcePack{..}  <- askSalak+        SourcePack{..}  <- ask         cf <- require "me.icymint.conf"         lift $ do           name cf `shouldBe` "shelly"