aeson-schema-0.3.0.6: Haskell JSON schema validator and parser generator

Safe HaskellNone
LanguageHaskell98

Data.Aeson.Schema.CodeGenM

Synopsis

Documentation

data Declaration Source

A top-level declaration.

Constructors

Declaration Dec (Maybe Text)

Optional textual declaration. This can be used for information (e.g. inline comments) that are not representable in TH.

Comment Text

Comment text

type Code = [Declaration] Source

 Haskell code (without module declaration and imports)

newtype CodeGenM s a Source

Constructors

CodeGenM 

Fields

unCodeGenM :: RWST s Code StringSet Q a
 

Instances

MonadReader s (CodeGenM s) 
MonadWriter Code (CodeGenM s) 
Monad (CodeGenM s) 
Functor (CodeGenM s) 
Applicative (CodeGenM s) 
MonadIO (CodeGenM s)

Generates a record data declaration where the fields may have descriptions for Haddock

Quasi (CodeGenM s) 

renderDeclaration :: Declaration -> Text Source

 Render a declaration. When a declaration contains both a TH syntax tree and a text representation, the text representation is preferred.

codeGenNewName :: String -> StringSet -> (Name, StringSet) Source

 Generates a fresh name

genRecord Source

Arguments

:: Name

Type and constructor name

-> [(Name, TypeQ, Maybe Text)]

Fields

-> [Name]

Deriving typeclasses

-> Q Declaration