aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-11-05 15:06:14 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2018-11-05 15:06:55 -0800
commit8c61fe8d6ab59716640e298a59737ff1eb1156ea (patch)
tree748963c23e5e793126e0d52d0cc91b0b5a4bc4b7
parent6a5661da637ac51691aac2f5a3a50b38c6ba2674 (diff)
downloadpandoc-8c61fe8d6ab59716640e298a59737ff1eb1156ea.tar.gz
Use DERIVE_JSON_VIA_TH in Text.Pandoc.Filter.
Previously AVOID_TEMPLATE_HASKELL was used (with the opposite valence). I assume this was a leftover from an earlier version.
-rw-r--r--src/Text/Pandoc/Filter.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Filter.hs b/src/Text/Pandoc/Filter.hs
index 5f8a9fdee..df80d4c82 100644
--- a/src/Text/Pandoc/Filter.hs
+++ b/src/Text/Pandoc/Filter.hs
@@ -38,11 +38,11 @@ module Text.Pandoc.Filter
) where
import Prelude
-#ifdef AVOID_TEMPLATE_HASKELL
+#ifdef DERIVE_JSON_VIA_TH
+import Data.Aeson.TH (deriveJSON, defaultOptions)
+#else
import Data.Aeson (FromJSON (..), ToJSON (..),
defaultOptions, genericToEncoding)
-#else
-import Data.Aeson.TH (deriveJSON, defaultOptions)
#endif
import Data.Foldable (foldrM)
import GHC.Generics (Generic)
@@ -76,10 +76,10 @@ expandFilterPath :: Filter -> PandocIO Filter
expandFilterPath (LuaFilter fp) = LuaFilter <$> Path.expandFilterPath fp
expandFilterPath (JSONFilter fp) = JSONFilter <$> Path.expandFilterPath fp
-#ifdef AVOID_TEMPLATE_HASKELL
+#ifdef DERIVE_JSON_VIA_TH
+$(deriveJSON defaultOptions ''Filter)
+#else
instance ToJSON Filter where
toEncoding = genericToEncoding defaultOptions
instance FromJSON Filter
-#else
-$(deriveJSON defaultOptions ''Filter)
#endif