| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Data.Aeson.Schema.CodeGen
Contents
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 |
Instances
| Eq Declaration Source # | |
Defined in Data.Aeson.Schema.CodeGenM | |
| Data Declaration Source # | |
Defined in Data.Aeson.Schema.CodeGenM Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Declaration -> c Declaration # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Declaration # toConstr :: Declaration -> Constr # dataTypeOf :: Declaration -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Declaration) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Declaration) # gmapT :: (forall b. Data b => b -> b) -> Declaration -> Declaration # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Declaration -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Declaration -> r # gmapQ :: (forall d. Data d => d -> u) -> Declaration -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Declaration -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Declaration -> m Declaration # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Declaration -> m Declaration # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Declaration -> m Declaration # | |
| Show Declaration Source # | |
Defined in Data.Aeson.Schema.CodeGenM Methods showsPrec :: Int -> Declaration -> ShowS # show :: Declaration -> String # showList :: [Declaration] -> ShowS # | |
| MonadWriter Code (CodeGenM s) Source # | |
type Code = [Declaration] Source #
Haskell code (without module declaration and imports)
generate :: Graph Schema Text -> Options -> Q (Code, Map Text Name) Source #
Generate a generalized representation of the code in a Haskell module
Arguments
| :: Graph Schema Text | Set of schemas |
| -> Options | |
| -> Q ([Dec], Map Text Name) | Generated code and mapping from schema identifiers to type names |
Generate data-types and FromJSON instances for all schemas
Arguments
| :: Text | Name of the generated module |
| -> Graph Schema Text | Set of schemas |
| -> Options | |
| -> Q (Text, Map Text Name) | Module code and mapping from schema identifiers to type names |
Generated a self-contained module that parses and validates values of a set of given schemas.