json-autotype 0.2.5.1 → 0.2.5.2
raw patch · 3 files changed
+15/−6 lines, 3 filesdep ~basePVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
Dependency ranges changed: base
API changes (from Hackage documentation)
+ Data.Aeson.AutoType.Alternative: alt :: (a -> c) -> (b -> c) -> a :|: b -> c
Files
- Data/Aeson/AutoType/Alternative.hs +6/−1
- changelog.md +5/−1
- json-autotype.cabal +4/−4
Data/Aeson/AutoType/Alternative.hs view
@@ -1,7 +1,8 @@-{-# LANGUAGE ViewPatterns, TypeOperators #-}+{-# LANGUAGE TypeOperators #-} module Data.Aeson.AutoType.Alternative( (:|:)(..) , toEither, fromEither+ , alt ) where import Data.Aeson@@ -19,6 +20,10 @@ fromEither :: Either a b -> a :|: b fromEither (Left a) = AltLeft a fromEither (Right b) = AltRight b++alt :: (a -> c) -> (b -> c) -> a :|: b -> c+alt f _ (AltLeft a) = f a+alt _ g (AltRight b) = g b instance (ToJSON a, ToJSON b) => ToJSON (a :|: b) where toJSON (AltLeft a) = toJSON a
changelog.md view
@@ -1,8 +1,12 @@ Changelog =========+ 0.2.5.2 Dec 2014++ * Updated metainfo, relaxed upper bounds for GHC 7.10.+ 0.2.5.0 Nov 2014 - * Nicer union type syntax in Data.Aeson.AutoTpe.Alternative.+ * Nicer union type syntax in Data.Aeson.AutoType.Alternative. 0.2.4.0 Nov 2014
json-autotype.cabal view
@@ -1,6 +1,6 @@ -- Build information for the package. name: json-autotype-version: 0.2.5.1+version: 0.2.5.2 synopsis: Automatic type declaration for JSON input data description: Generates datatype declarations with Aeson's "FromJSON" instances from a set of example ".json" files.@@ -32,7 +32,7 @@ extra-source-files: README.md changelog.md cabal-version: >=1.10 bug-reports: https://github.com/mgajda/json-autotype/issues-tested-with: GHC==7.8.2+tested-with: GHC==7.6.3,GHC==7.8.3 source-repository head type: git@@ -56,7 +56,7 @@ other-modules: -- internal module Data.Aeson.AutoType.Util- build-depends: base >=4.3 && <4.8,+ build-depends: base >=4.3 && <4.9, GenericPretty >=1.2 && <1.3, MissingH >=1.2 && <1.3, aeson >=0.7 && <0.9,@@ -87,7 +87,7 @@ DeriveDataTypeable, DeriveGeneric, RecordWildCards- build-depends: base >=4.3 && <4.8,+ build-depends: base >=4.3 && <4.9, GenericPretty >=1.2 && <1.3, MissingH >=1.2 && <1.3, aeson >=0.7 && <0.9,