greskell-core 0.1.3.2 → 0.1.3.3
raw patch · 3 files changed
+17/−4 lines, 3 filesdep ~aesonPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: aeson
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- greskell-core.cabal +2/−2
- src/Data/Greskell/GMap.hs +11/−2
ChangeLog.md view
@@ -1,5 +1,9 @@ # Revision history for greskell-core +## 0.1.3.3 -- 2020-05-30++* Support `aeson-1.5.0.0`.+ ## 0.1.3.2 -- 2020-03-29 * Confirm test with `QuickCheck-2.14`.
greskell-core.cabal view
@@ -1,5 +1,5 @@ name: greskell-core-version: 0.1.3.2+version: 0.1.3.3 author: Toshio Ito <debug.ito@gmail.com> maintainer: Toshio Ito <debug.ito@gmail.com> license: BSD3@@ -31,7 +31,7 @@ other-modules: Data.Greskell.GraphSON.GraphSONTyped, Data.Greskell.GraphSON.Core build-depends: base >=4.9.0.0 && <4.14,- aeson >=1.0.2.1 && <1.5,+ aeson >=1.0.2.1 && <1.6, unordered-containers >=0.2.7.1 && <0.3, hashable >=1.2.6.1 && <1.4, scientific >=0.3.4.9 && <0.4,
src/Data/Greskell/GMap.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE TypeFamilies, OverloadedStrings, GeneralizedNewtypeDeriving, DeriveTraversable #-}+{-# LANGUAGE TypeFamilies, OverloadedStrings, GeneralizedNewtypeDeriving, DeriveTraversable, CPP #-} -- | -- Module: Data.Greskell.GMap -- Description: data type for g:Map@@ -42,7 +42,12 @@ import qualified Data.Vector as V import GHC.Exts (IsList(Item)) import qualified GHC.Exts as List (IsList(fromList, toList))++#if MIN_VERSION_aeson(1,5,0)+import Data.Coerce (coerce)+#else import Unsafe.Coerce (unsafeCoerce)+#endif import Data.Greskell.GraphSON.GraphSONTyped (GraphSONTyped(..)) @@ -239,11 +244,15 @@ getParser = case fromJSONKey of FromJSONKeyText p -> return $ fmap return p FromJSONKeyTextParser p -> return p- FromJSONKeyCoerce _ -> return $ fmap return unsafeCoerce FromJSONKeyValue _ -> fail ( "Unexpected FromJSONKeyValue." ++ " It expects that the entry key is parsed from the text key in JSON Object," ++ " but the key type does not support it." )+#if MIN_VERSION_aeson(1,5,0)+ FromJSONKeyCoerce -> return $ fmap return coerce+#else+ FromJSONKeyCoerce _ -> return $ fmap return unsafeCoerce+#endif orElseM :: Monad m => m (Maybe a) -> m (Maybe a) -> m (Maybe a) orElseM act_a act_b = do