packages feed

uniform-json 0.1.5.1 → 0.1.5.2

raw patch · 5 files changed

+18/−11 lines, 5 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Uniform.Yaml: yaml2value :: YamlText -> Value
+ Uniform.Yaml: yaml2value :: Path Abs File -> YamlText -> Value

Files

ChangeLog.md view
@@ -11,4 +11,5 @@   0.0.6.1 for lts-19.16 with aeson 2.0.3.0 -         0.1.5 branch for ghc 9.2.5-0.1.5.1    +0.1.5.1+0.1.5.2  add filename in error msg from yaml parse    
src/Uniform/Json.hs view
@@ -111,6 +111,11 @@   getAt2Key meta2 k1 k2 = meta2 ^? key k1 . key k2 . _String   putAtKey k2 txt meta2 = meta2 & _Object . at k2 ?~ String txt +-- instance AtKey Value [Text] where+--   getAtKey meta2 k2 = lookup  k2 meta2+-- --   getAt2Key meta2 k1 k2 = meta2 ^? key k1 . key k2 . _String+-- --   putAtKey k2 txt meta2 = meta2 & _Object . at k2 ?~ String txt+ instance AtKey Value Integer where   getAtKey meta2 k2 = meta2 ^? key k2 . _Integral   getAt2Key meta2 k1 k2 = meta2 ^? key k1 . key k2 . _Integral
src/Uniform/Yaml.hs view
@@ -75,13 +75,14 @@ -- error when syntax issue readYaml2value fp = do   t <- read8 fp yamlFileType-  return . yaml2value $ t+  return . (yaml2value fp) $ t -yaml2value :: YamlText -> Value+yaml2value :: Path Abs File -> YamlText -> Value -- convert a YamlText to a JSON value, error if not ok -- how to debug input erros?-yaml2value yt = either (error . show) Prelude.id vx+yaml2value fp yt = either (errorT . show2) Prelude.id vx   where+    show2 a =   ["Yaml error in file (line count start 0)", showT fp, ":", showT a]      vx = Y.decodeEither' (t2b . unYAML $ yt) :: Either Y.ParseException Value  readYaml2rec :: (FromJSON a, Show a) => Path Abs File -> ErrIO a 
tests/Uniform/Json_test.hs view
@@ -74,8 +74,8 @@                     return a2         assertEqual (Right p1) res  -test_getAtKeyInt =  -        assertEqual (Just 30::Maybe Int) (getAtKey p2j "age" )+-- test_getAtKeyInt =  +--         assertEqual (Just 30::Maybe Int) (getAtKey p2j "age" )   
uniform-json.cabal view
@@ -4,15 +4,15 @@ -- -- see: https://github.com/sol/hpack ----- hash: 91c57d89d01ab321adfd3ad7f72a6b6fd8e0b13c316db871a6e0ee839077570b+-- hash: 095a485a37e98888760efed1bb583dcfc7299cdf67b51e97aa43d138db791f6a  name:           uniform-json-version:        0.1.5.1+version:        0.1.5.2 synopsis:       handling of JSON and YAML in an uniform way description:    remove particular aspects of abstraction in json and yaml - with an eye to use it with pandoc category:       Data Text JSON YAML Pandoc-homepage:       https://github.com/git@github.com:andrewufrank/u4blog.git#readme-bug-reports:    https://github.com/git@github.com:andrewufrank/u4blog.git/issues+homepage:       https://github.com/andrewufrank/u4blog.git#readme+bug-reports:    https://github.com/andrewufrank/u4blog.git/issues author:         Andrew Frank maintainer:     Andrew U. Frank <frank@geoinfo.tuwien.ac.at> copyright:      2021 Andrew U. Frank@@ -25,7 +25,7 @@  source-repository head   type: git-  location: https://github.com/git@github.com:andrewufrank/u4blog.git+  location: https://github.com/andrewufrank/u4blog.git   subdir: uniform-json  library