hedn 0.3.0.2 → 0.3.0.3
raw patch · 2 files changed
+31/−16 lines, 2 filesdep ~deriving-compatdep ~hednPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: deriving-compat, hedn
API changes (from Hackage documentation)
Files
- hedn.cabal +7/−6
- lib/Data/EDN/QQ.hs +24/−10
hedn.cabal view
@@ -1,13 +1,13 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.33.0.+-- This file has been generated from package.yaml by hpack version 0.34.4. -- -- see: https://github.com/sol/hpack ----- hash: 2a23dd91dd0abdc7d8b11923b6462270bbedd2b9d7d66252316a767969f5c218+-- hash: 84c235a38db770dd0b8f9f27fada3973288d77b2c15ac97f48420e7df492d075 name: hedn-version: 0.3.0.2+version: 0.3.0.3 synopsis: EDN parsing and encoding description: A EDN parsing and encoding library. .@@ -18,7 +18,8 @@ copyright: (c) 2019 Alexander Bondarenko license: BSD3 license-file: LICENSE-tested-with: GHC==8.2.2, GHC==8.4.4, GHC==8.6.5, GHC==8.8.3, GHC==8.10.2+tested-with:+ GHC==8.2.2, GHC==8.4.4, GHC==8.6.5, GHC==8.8.3, GHC==8.10.4, GHC==9.0.1 build-type: Simple extra-source-files: CHANGELOG.md@@ -54,7 +55,7 @@ , megaparsec >=7.0 && <10 , parser-combinators >=1.0 && <2 , prettyprinter >=1.2 && <2- , scientific >=0.3 && <0.4+ , scientific ==0.3.* , template-haskell >=2.11 && <3 , text >=1.2 && <2 , time >=1.6 && <2@@ -79,7 +80,7 @@ base >=4.9 && <5 , containers >=0.5.7 && <0.7 , hedgehog >=0.6 && <2- , hedn >=0.2 && <1+ , hedn , megaparsec >=7.0 && <10 , text >=1.2 && <2 , time >=1.6 && <2
lib/Data/EDN/QQ.hs view
@@ -157,12 +157,28 @@ -- XXX: Workaround for Text.pack not present in the same module with Text constructors. -- See https://stackoverflow.com/a/38182444+#if MIN_VERSION_base(4,15,0)+liftData' :: (Data a, TH.Quote m) => a -> m Exp+#else liftData' :: Data a => a -> Q Exp+#endif liftData' = TH.dataToExpQ $ fmap liftText . cast +#if MIN_VERSION_base(4,15,0)+liftText :: TH.Quote m => Text.Text -> m Exp+#else liftText :: Text.Text -> Q Exp+#endif liftText txt = AppE (VarE 'Text.pack) <$> lift (Text.unpack txt) +#if MIN_VERSION_base(4,15,0)+liftVector :: (Lift a, TH.Quote m) => Vector.Vector a -> m Exp+#else+liftVector :: Lift a => Vector.Vector a -> Q Exp+#endif+liftVector vec =+ AppE (VarE 'Vector.fromList) <$> lift (Vector.toList vec)+ -- XXX: Workaround for undefined toConstr in Data instance for Vector. instance Data a => Lift (Tagged Text a) where lift = \case@@ -175,9 +191,10 @@ val' <- liftData' val pure $ ConE 'Tagged `AppE` tagNS' `AppE` tag' `AppE` val' -#if MIN_VERSION_template_haskell(2,16,0)- liftTyped x =- TH.unsafeTExpCoerce (lift x)+#if MIN_VERSION_template_haskell(2,17,0)+ liftTyped = TH.unsafeCodeCoerce . lift+#elif MIN_VERSION_template_haskell(2,16,0)+ liftTyped = TH.unsafeTExpCoerce . lift #endif instance Lift Value where@@ -187,11 +204,8 @@ val -> liftData' val -#if MIN_VERSION_template_haskell(2,16,0)- liftTyped x =- TH.unsafeTExpCoerce (lift x)+#if MIN_VERSION_template_haskell(2,17,0)+ liftTyped = TH.unsafeCodeCoerce . lift+#elif MIN_VERSION_template_haskell(2,16,0)+ liftTyped = TH.unsafeTExpCoerce . lift #endif--liftVector :: Lift a => Vector.Vector a -> Q Exp-liftVector vec =- AppE (VarE 'Vector.fromList) <$> lift (Vector.toList vec)