h-booru- Haskell library for retrieving data from various booru image sites

Safe HaskellNone



| Helper module for HBooru.Parsers.GenericBooru due to Template Haskell limitation of being unable to splice inside of the same module of definitions.



makePost :: Name -> Q [Dec]Source

A TH helper which makes an instance along with the data type using makePost' and makePostInstance.

makePost' :: Name -> Q [Dec]Source

Template Haskell function which is able to generate GenericPost-alike type declarations for cases where we want to use this format but need a different data type. It can be used by using TemplateHaskell extension and calling $(makePost (mkName "YourTypeName")) at the top level. Hopefully a temporary measure until the author thinks of a better way to provide generic Gelbooru-like post parsing while casting out to different data types that's OK to write.

makePostInstance :: Name -> Q [Dec]Source

Template Haskell function which creates Post instances for things made with makePost.