api-tools-0.5.2: 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

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

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