Safe Haskell | None |
---|---|
Language | Haskell2010 |
Functionality to split models into multiple modules according to their dependencies
Synopsis
- getModelModulesFromModelsWithDependencies :: String -> [ModelWithDependencies] -> Q [ModuleDefinition]
- type ModuleDefinition = ([String], Doc)
- type Models = Set Text
- type ModelContentWithDependencies = (Q Doc, Models)
- type ModelWithDependencies = (Text, ModelContentWithDependencies)
Documentation
getModelModulesFromModelsWithDependencies :: String -> [ModelWithDependencies] -> Q [ModuleDefinition] Source #
Analyzes the dependencies of the provided models and splits them into modules.
All models with cyclic dependencies (between each other or to itself) are put in a module named by cyclicTypesModule
.
type ModuleDefinition = ([String], Doc) Source #
A module definition with a name as a string list with the different module levels (e. g. ["OpenAPI", "Generate"] for OpenAPI.Generate)
and the Doc
representing the module content
type ModelContentWithDependencies = (Q Doc, Models) Source #
A tuple containing the content and the dependencies of a model
type ModelWithDependencies = (Text, ModelContentWithDependencies) Source #
Represents a model with a name, content and dependencies