git.iko.soy/typeable/pandoc
on master help sign in
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.

commit8c61fe8d6ab59716640e298a59737ff1eb1156ea authorJohn MacFarlane <jgm@berkeley.edu> dateMon 5 Nov 2018, 15:06 (8 years ago) parent6a5661d
1 file changed+6−6
src/Text/Pandoc/Filter.hs+6−6
src/Text/Pandoc/Filter.hs+6−6
@@ -38,11 +38,11 @@ module Text.Pandoc.Filter
3838 ) where
3939
4040import Prelude
41−#ifdef AVOID_TEMPLATE_HASKELL
41+#ifdef DERIVE_JSON_VIA_TH
42+import Data.Aeson.TH (deriveJSON, defaultOptions)
43+#else
4244import Data.Aeson (FromJSON (..), ToJSON (..),
4345 defaultOptions, genericToEncoding)
44−#else
45−import Data.Aeson.TH (deriveJSON, defaultOptions)
4646#endif
4747import Data.Foldable (foldrM)
4848import GHC.Generics (Generic)
@@ -76,10 +76,10 @@ expandFilterPath :: Filter -> PandocIO Filter
7676expandFilterPath (LuaFilter fp) = LuaFilter <$> Path.expandFilterPath fp
7777expandFilterPath (JSONFilter fp) = JSONFilter <$> Path.expandFilterPath fp
7878
79−#ifdef AVOID_TEMPLATE_HASKELL
79+#ifdef DERIVE_JSON_VIA_TH
80+$(deriveJSON defaultOptions ''Filter)
81+#else
8082instance ToJSON Filter where
8183 toEncoding = genericToEncoding defaultOptions
8284instance FromJSON Filter
83−#else
84−$(deriveJSON defaultOptions ''Filter)
8585#endif