aeson-iproute 0.2.1 → 0.3.0
raw patch · 2 files changed
+9/−15 lines, 2 filesdep −unordered-containersdep ~aesonPVP ok
version bump matches the API change (PVP)
Dependencies removed: unordered-containers
Dependency ranges changed: aeson
API changes (from Hackage documentation)
Files
- Data/Aeson/IP.hs +5/−10
- aeson-iproute.cabal +4/−5
Data/Aeson/IP.hs view
@@ -1,16 +1,11 @@-{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE UndecidableInstances #-} module Data.Aeson.IP () where -#if __GLASGOW_HASKELL__ <= 708-import Control.Applicative (pure)-#endif- import Data.Aeson+import qualified Data.Aeson.Key as Key+import qualified Data.Aeson.KeyMap as KeyMap import Data.Aeson.Types-import Data.Aeson.Internal-import qualified Data.HashMap.Strict as HashMap import Data.IP import Data.IP.RouteTable (Routable, IPRTable) import qualified Data.IP.RouteTable as RouteTable@@ -121,8 +116,8 @@ ) => FromJSON1 (IPRTable k) where liftParseJSON p _ = case fromJSONKey of FromJSONKeyTextParser f -> withObject "IPRTable k v" $- HashMap.foldrWithKey- (\k v rt -> RouteTable.insert <$> f k <?> Key k+ KeyMap.foldrWithKey+ (\k v rt -> RouteTable.insert <$> f (Key.toText k) <?> Key k <*> p v <?> Key k <*> rt) (pure RouteTable.empty)@@ -137,7 +132,7 @@ instance (Routable k, Show k, ToJSON k) => ToJSON1 (IPRTable k) where liftToJSON g _ = case toJSONKey of- ToJSONKeyText f _ -> Object . HashMap.fromList+ ToJSONKeyText f _ -> Object . KeyMap.fromList . map (\(k, v) -> (f k, g v)) . RouteTable.toList _ -> error "using IPRTable as a JSON key is not yet supported"
aeson-iproute.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: aeson-iproute-version: 0.2.1+version: 0.3.0 synopsis: Aeson instances for iproute types description: Aeson instances for iproute types. license: BSD3@@ -13,15 +13,14 @@ category: Data build-type: Simple cabal-version: >=1.10-Tested-With: GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.2+Tested-With: GHC == 8.10.7, GHC == 9.0.1 library exposed-modules: Data.Aeson.IP- build-depends: aeson >= 0.8,+ build-depends: aeson >= 2.0 && < 3.0, base >=4 && <5, iproute >= 1.7.3,- text >= 1.0,- unordered-containers+ text >= 1.0 default-language: Haskell2010