diff options
author | John MacFarlane <jgm@berkeley.edu> | 2019-10-07 21:22:50 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-10-07 21:23:50 -0700 |
commit | 8fb9a0d168517462860d6916c1f882958520988b (patch) | |
tree | 0ce884c8cebc80da5519d453c6794f70fc345daf /src/Text/Pandoc/App/Opt.hs | |
parent | b235a187dc47e3d0afc8942f4e19c99527e1fca8 (diff) | |
download | pandoc-8fb9a0d168517462860d6916c1f882958520988b.tar.gz |
Remove derive_json_via_th flag; always use TH.
This cuts down on code duplication and reduces the chance
for errors. See #4083.
Diffstat (limited to 'src/Text/Pandoc/App/Opt.hs')
-rw-r--r-- | src/Text/Pandoc/App/Opt.hs | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/Text/Pandoc/App/Opt.hs b/src/Text/Pandoc/App/Opt.hs index bc472d43c..f714586e4 100644 --- a/src/Text/Pandoc/App/Opt.hs +++ b/src/Text/Pandoc/App/Opt.hs @@ -2,9 +2,7 @@ {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} -#ifdef DERIVE_JSON_VIA_TH {-# LANGUAGE TemplateHaskell #-} -#endif {- | Module : Text.Pandoc.App.Opt Copyright : Copyright (C) 2006-2019 John MacFarlane @@ -36,11 +34,7 @@ import qualified Data.Text as T import Data.Aeson (defaultOptions, Options(..), FromJSON(..), ToJSON(..), Value(..)) import Data.Aeson.Types (typeMismatch) -#ifdef DERIVE_JSON_VIA_TH import Data.Aeson.TH (deriveJSON) -#else -import Data.Aeson (genericToEncoding) -#endif -- | The type of line-endings to be used when writing plain-text. data LineEnding = LF | CRLF | Native deriving (Show, Generic) @@ -203,16 +197,8 @@ defaultOpts = Opt , optStripComments = False } -#ifdef DERIVE_JSON_VIA_TH -- see https://github.com/jgm/pandoc/pull/4083 -- using generic deriving caused long compilation times $(deriveJSON defaultOptions{ fieldLabelModifier = camelCaseToHyphenated . drop 3 } ''Opt) -#else -instance ToJSON Opt where - toEncoding = genericToEncoding - defaultOptions{ fieldLabelModifier = - camelCaseToHyphenated . drop 3 } -instance FromJSON Opt -#endif |