api-tools-0.8.0.1: DSL for generating API boilerplate and docs

Safe HaskellNone
LanguageHaskell2010

Data.API.Tools.Datatypes

Synopsis

Documentation

datatypesTool :: APITool Source #

Tool to generate datatypes and type synonyms corresponding to an API

datatypesTool' :: (APINode -> [Name]) -> APITool Source #

Tool to generate datatypes and type synonyms corresponding to an API, where the function specifies the derived classes for each datatype.

defaultDerivedClasses :: APINode -> [Name] Source #

Default names of classes for which to derive instances, depending on the type of API node.

type_nm :: APINode -> Name Source #

Name of the type corresponding to the API node, e.g. JobId

rep_type_nm :: APINode -> Name Source #

Name of the representation type corresponding to the API node, which differs from the type_nm only if custom conversion functions are specified. This is also the name of the sole constructor for newtypes and records.

nodeT :: APINode -> TypeQ Source #

The type corresponding to an API node

nodeRepT :: APINode -> TypeQ Source #

The representation type corresponding to an API node

nodeConE :: APINode -> ExpQ Source #

The constructor for a record API node

nodeNewtypeConE :: ToolSettings -> APINode -> SpecNewtype -> ExpQ Source #

The constructor for a newtype, which might be renamed

nodeFieldE :: APINode -> FieldName -> ExpQ Source #

A record field in an API node, as an expression

nodeFieldP :: APINode -> FieldName -> PatQ Source #

A record field in an API node, as a pattern

nodeAltConE :: APINode -> FieldName -> ExpQ Source #

A prefixed constructor for a union or enum, as an expression

nodeAltConP :: APINode -> FieldName -> [PatQ] -> PatQ Source #

A prefixed constructor for a union or enum, as a pattern

newtypeProjectionE :: APINode -> ExpQ Source #

The projection function from a newtype API node, as an epxression