Safe Haskell | None |
---|---|
Language | Haskell98 |
Documentation
data Declaration Source #
A top-level declaration.
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 (==) :: Declaration -> Declaration -> Bool # (/=) :: Declaration -> Declaration -> Bool # | |
Data Declaration Source # | |
Defined in Data.Aeson.Schema.CodeGenM 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 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
:: 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
:: 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.