packages feed

hedn 0.3.0.1 → 0.3.0.2

raw patch · 3 files changed

+32/−16 lines, 3 filesdep ~basedep ~megaparsecPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base, megaparsec

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [0.3.0.2] - 2020-11-17++- Add liftTyped methods for template-haskell 2.16+ ## [0.3.0.1] - 2020-03-21  - GHC 8.8 warnings fixed@@ -81,6 +85,7 @@  - Use utf8-string parsing for unicode literals. +[0.3.0.2]: https://gitlab.com/dpwiz/hedn/tree/v0.3.0.2 [0.3.0.1]: https://gitlab.com/dpwiz/hedn/tree/v0.3.0.1 [0.3.0.0]: https://gitlab.com/dpwiz/hedn/tree/v0.3.0.0 [0.2.0.1]: https://gitlab.com/dpwiz/hedn/tree/v0.2.0.1
hedn.cabal view
@@ -1,13 +1,13 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.31.2.+-- This file has been generated from package.yaml by hpack version 0.33.0. -- -- see: https://github.com/sol/hpack ----- hash: f3b90ccbe3e47e61b73ecfb02d73d8aef5786484faa6ee6c6a2d0dc8594a4627+-- hash: 2a23dd91dd0abdc7d8b11923b6462270bbedd2b9d7d66252316a767969f5c218  name:           hedn-version:        0.3.0.1+version:        0.3.0.2 synopsis:       EDN parsing and encoding description:    A EDN parsing and encoding library.                 .@@ -18,7 +18,7 @@ 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+tested-with:    GHC==8.2.2, GHC==8.4.4, GHC==8.6.5, GHC==8.8.3, GHC==8.10.2 build-type:     Simple extra-source-files:     CHANGELOG.md@@ -47,11 +47,11 @@       lib   ghc-options: -Wall   build-depends:-      base >=4.9 && <4.14+      base >=4.9 && <5     , containers >=0.5.7 && <0.7     , deepseq >=1.4 && <2     , deriving-compat >=0.3.6 && <0.6-    , megaparsec >=7.0 && <9+    , megaparsec >=7.0 && <10     , parser-combinators >=1.0 && <2     , prettyprinter >=1.2 && <2     , scientific >=0.3 && <0.4@@ -76,11 +76,11 @@       tests   ghc-options: -Wall   build-depends:-      base >=4.9 && <4.14+      base >=4.9 && <5     , containers >=0.5.7 && <0.7     , hedgehog >=0.6 && <2     , hedn >=0.2 && <1-    , megaparsec >=7.0 && <9+    , megaparsec >=7.0 && <10     , text >=1.2 && <2     , time >=1.6 && <2     , uuid-types >=1.0 && <2
lib/Data/EDN/QQ.hs view
@@ -27,10 +27,11 @@ import Data.Text (Text) import Data.Typeable (cast) import Language.Haskell.TH.Quote (QuasiQuoter(..))-import Language.Haskell.TH.Syntax (Exp(..), Lift(..), Q, dataToExpQ, loc_filename, qLocation)+import Language.Haskell.TH.Syntax (Exp(..), Lift(..), Q)  import qualified Data.Text as Text import qualified Data.Vector as Vector+import qualified Language.Haskell.TH.Syntax as TH  import Data.EDN (FromEDN, decodeText, parseText) import Data.EDN.AST.Types (Tagged(..), Value(..))@@ -42,7 +43,7 @@ -- @ edn :: QuasiQuoter edn = ednQQ $ \str -> do-  src <- fmap loc_filename qLocation+  src <- fmap TH.loc_filename TH.qLocation    case parseText src (Text.pack str) of     Right val ->@@ -59,7 +60,7 @@ -- @ ednList :: QuasiQuoter ednList = ednQQ $ \str -> do-  src <- fmap loc_filename qLocation+  src <- fmap TH.loc_filename TH.qLocation   let doc = "(" <> Text.pack str <> ")"    case parseText src doc of@@ -79,7 +80,7 @@ -- @ ednVec :: QuasiQuoter ednVec = ednQQ $ \str -> do-  src <- fmap loc_filename qLocation+  src <- fmap TH.loc_filename TH.qLocation   let doc = "[" <> Text.pack str <> "]"    case parseText src doc of@@ -99,7 +100,7 @@ -- @ ednSet :: QuasiQuoter ednSet = ednQQ $ \str -> do-  src <- fmap loc_filename qLocation+  src <- fmap TH.loc_filename TH.qLocation   let doc = "#{" <> Text.pack str <> "}"    case parseText src doc of@@ -119,7 +120,7 @@ -- @ ednMap :: QuasiQuoter ednMap = ednQQ $ \str -> do-  src <- fmap loc_filename qLocation+  src <- fmap TH.loc_filename TH.qLocation   let doc = "{" <> Text.pack str <> "}"    case parseText src doc of@@ -139,7 +140,7 @@ -- > theFred = [ednPerson| #myapp/Person { :first "Fred" } |] fromEDN :: forall a. (Lift a, FromEDN a) => QuasiQuoter fromEDN = ednQQ $ \str -> do-  src <- fmap loc_filename qLocation+  src <- fmap TH.loc_filename TH.qLocation   case decodeText src (Text.pack str) of     Left err ->       error err@@ -157,7 +158,7 @@ -- XXX: Workaround for Text.pack not present in the same module with Text constructors. -- See https://stackoverflow.com/a/38182444 liftData' :: Data a => a -> Q Exp-liftData' = dataToExpQ $ fmap liftText . cast+liftData' = TH.dataToExpQ $ fmap liftText . cast  liftText :: Text.Text -> Q Exp liftText txt = AppE (VarE 'Text.pack) <$> lift (Text.unpack txt)@@ -174,12 +175,22 @@       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)+#endif+ instance Lift Value where   lift = \case     Vec items ->       AppE (ConE 'Vec) <$> liftVector items     val ->       liftData' val++#if MIN_VERSION_template_haskell(2,16,0)+  liftTyped x =+    TH.unsafeTExpCoerce (lift x)+#endif  liftVector :: Lift a => Vector.Vector a -> Q Exp liftVector vec =