Closed jgm closed 11 years ago
Perhaps custom ToJSON and FromJSON instances should be added as well, in this module, rather than relying on slow generics.
Or maybe use GHC generics, since we have instances for pandoc anyway?
Use DeriveGeneric pragma, and just:
instance FromJSON Pandoc
instance ToJSON Pandoc
With this approach we'd need:
instance FromJSON MetaValue
instance ToJSON MetaValue
instance FromJSON Meta
instance ToJSON Meta
instance FromJSON CitationMode
instance ToJSON CitationMode
instance FromJSON Citation
instance ToJSON Citation
instance FromJSON QuoteType
instance ToJSON QuoteType
instance FromJSON MathType
instance ToJSON MathType
instance FromJSON ListNumberStyle
instance ToJSON ListNumberStyle
instance FromJSON ListNumberDelim
instance ToJSON ListNumberDelim
instance FromJSON Alignment
instance ToJSON Alignment
instance FromJSON Inline
instance ToJSON Inline
instance FromJSON Block
instance ToJSON Block
instance FromJSON Pandoc
instance ToJSON Pandoc
Some benchmarks suggest that using GHC generics is significantly faster than using the syb generics as we currently do (> 2x writing, slightly less reading).
Done 1567d291a3aed0e55ddaaa65492ab19741e515b5
This would really reduce executable sizes in scripts.