module Data.API.Tools
( generate
, generateAPITools
, generateWith
, generateAPIToolsWith
, ToolSettings
, defaultToolSettings
, warnOnOmittedInstance
, newtypeSmartConstructors
, enumTool
, exampleTool
, deepSeqTool
, jsonTool
, jsonTool'
, cborTool
, jsonTestsTool
, cborTestsTool
, cborToJSONTestsTool
, jsonToCBORTestsTool
, jsonGenericValueTestsTool
, cborGenericValueTestsTool
, lensTool
, quickCheckTool
, safeCopyTool
, samplesTool
) where
import Data.API.Tools.Combinators
import Data.API.Tools.Datatypes
import Data.API.Tools.DeepSeq
import Data.API.Tools.Enum
import Data.API.Tools.Example
import Data.API.Tools.CBOR
import Data.API.Tools.JSON
import Data.API.Tools.JSONTests
import Data.API.Tools.Lens
import Data.API.Tools.QuickCheck
import Data.API.Tools.SafeCopy
import Data.API.Types
import qualified Data.Monoid as Monoid
import Language.Haskell.TH
generate :: API -> Q [Dec]
generate = generateWith defaultToolSettings
generateWith :: ToolSettings -> API -> Q [Dec]
generateWith ts api = generateAPIToolsWith ts api [datatypesTool]
generateAPITools :: API -> [APITool] -> Q [Dec]
generateAPITools = generateAPIToolsWith defaultToolSettings
generateAPIToolsWith :: ToolSettings -> API -> [APITool] -> Q [Dec]
generateAPIToolsWith ts api tools = runTool (Monoid.mconcat tools) ts api