json-autotype 1.0.10 → 1.0.11
raw patch · 3 files changed
+26/−18 lines, 3 filesdep +mmapdep ~aesondep ~basedep ~processPVP ok
version bump matches the API change (PVP)
Dependencies added: mmap
Dependency ranges changed: aeson, base, process
API changes (from Hackage documentation)
Files
- GenerateJSONParser.hs +7/−5
- changelog.md +5/−0
- json-autotype.cabal +14/−13
GenerateJSONParser.hs view
@@ -13,6 +13,7 @@ import Data.List (partition) import System.Exit import System.IO (stdin, stderr, stdout, IOMode(..))+--import System.IO.Posix.MMap (mmapFileByteString) import System.FilePath (splitExtension) import System.Process (system) import qualified Data.ByteString.Lazy.Char8 as BSL@@ -59,12 +60,13 @@ -- @FilePath@, extracted @Type@, and a JSON @Value@. extractTypeFromJSONFile :: FilePath -> IO (Maybe (FilePath, Type, Value)) extractTypeFromJSONFile inputFilename =- withFileOrHandle inputFilename ReadMode stdin $ \hIn ->+ withFileOrHandle inputFilename ReadMode stdin $ \hInput -> -- First we decode JSON input into Aeson's Value type- do bs <- preprocess <$> BSL.hGetContents hIn- Text.hPutStrLn stderr $ "Processing " `Text.append` Text.pack (show inputFilename)- myTrace ("Decoded JSON: " ++ pretty (decode bs :: Maybe Value))- case decode bs of+ do Text.hPutStrLn stderr $ "Processing " `Text.append` Text.pack (show inputFilename)+ decodedJSON :: Maybe Value <- decode <$> BSL.hGetContents hInput+ --let decodedJSON :: Maybe Value = decodeValue input+ -- myTrace ("Decoded JSON: " ++ pretty decoded)+ case decodedJSON of Nothing -> do report $ "Cannot decode JSON input from " `Text.append` Text.pack (show inputFilename) return Nothing Just v -> do -- If decoding JSON was successful...
changelog.md view
@@ -1,5 +1,10 @@ Changelog =========+ 1.0.11 Mar 2016++ * Updated to GHC 8.0++ 1.0.10 Sep 2015 * Fixed bug appeared with aeson 0.10 breaking change:
json-autotype.cabal view
@@ -1,6 +1,6 @@ -- Build information for the package. name: json-autotype-version: 1.0.10+version: 1.0.11 synopsis: Automatic type declaration for JSON input data description: Generates datatype declarations with Aeson's "FromJSON" instances from a set of example ".json" files.@@ -60,9 +60,9 @@ other-modules: -- internal module Data.Aeson.AutoType.Util- build-depends: base >=4.3 && <4.9,+ build-depends: base >=4.3 && <4.10, GenericPretty >=1.2 && <1.3,- aeson >=0.7 && <0.11,+ aeson >=0.7 && <0.12, bytestring >=0.9 && <0.11, containers >=0.3 && <0.6, filepath >=1.3 && <1.5,@@ -70,9 +70,10 @@ hint >=0.3 && <0.5, hflags >=0.3 && <0.5, lens >=4.1 && <4.14,+ mmap >=0.5 && <0.6, mtl >=2.1 && <2.3, pretty >=1.1 && <1.3,- process >=1.1 && <1.4,+ process >=1.1 && <1.5, scientific >=0.3 && <0.5, text >=1.1 && <1.4, uniplate >=1.6 && <1.7,@@ -99,9 +100,9 @@ DeriveDataTypeable, DeriveGeneric, RecordWildCards- build-depends: base >=4.3 && <4.9,+ build-depends: base >=4.3 && <4.10, GenericPretty >=1.2 && <1.3,- aeson >=0.7 && <0.11,+ aeson >=0.7 && <0.12, bytestring >=0.9 && <0.11, containers >=0.3 && <0.6, filepath >=1.3 && <1.5,@@ -111,7 +112,7 @@ lens >=4.1 && <4.14, mtl >=2.1 && <2.3, pretty >=1.1 && <1.3,- process >=1.1 && <1.4,+ process >=1.1 && <1.5, scientific >=0.3 && <0.5, text >=1.1 && <1.4, uniplate >=1.6 && <1.7,@@ -139,9 +140,9 @@ DeriveDataTypeable, DeriveGeneric, RecordWildCards- build-depends: base >=4.3 && <4.9,+ build-depends: base >=4.3 && <4.10, GenericPretty >=1.2 && <1.3,- aeson >=0.7 && <0.11,+ aeson >=0.7 && <0.12, bytestring >=0.9 && <0.11, containers >=0.3 && <0.6, directory >=1.1 && <1.3,@@ -150,7 +151,7 @@ lens >=4.1 && <4.14, mtl >=2.1 && <2.3, pretty >=1.1 && <1.3,- process >=1.1 && <1.4,+ process >=1.1 && <1.5, scientific >=0.3 && <0.5, smallcheck >=1.0 && <1.2, text >=1.1 && <1.4,@@ -180,9 +181,9 @@ DeriveDataTypeable, DeriveGeneric, RecordWildCards- build-depends: base >=4.3 && <4.9,+ build-depends: base >=4.3 && <4.10, GenericPretty >=1.2 && <1.3,- aeson >=0.7 && <0.11,+ aeson >=0.7 && <0.12, bytestring >=0.9 && <0.11, containers >=0.3 && <0.6, directory >=1.1 && <1.3,@@ -192,7 +193,7 @@ lens >=4.1 && <4.14, mtl >=2.1 && <2.3, pretty >=1.1 && <1.3,- process >=1.1 && <1.4,+ process >=1.1 && <1.5, scientific >=0.3 && <0.5, smallcheck >=1.0 && <1.2, text >=1.1 && <1.4,