Safe Haskell | None |
---|---|
Language | Haskell2010 |
Language.Haskell.Tools.Rewrite.Create.Modules
Contents
Description
Generation of UModule-level AST fragments for refactorings.
The bindings defined here create a the annotated version of the AST constructor with the same name.
For example, mkModule
creates the annotated version of the UModule
AST constructor.
- mkModule :: [FilePragma dom] -> Maybe (ModuleHead dom) -> [ImportDecl dom] -> [Decl dom] -> Module dom
- mkModuleHead :: ModuleName dom -> Maybe (ModulePragma dom) -> Maybe (ExportSpecs dom) -> ModuleHead dom
- mkExportSpecs :: [ExportSpec dom] -> ExportSpecs dom
- mkExportSpec :: IESpec dom -> ExportSpec dom
- mkModuleExport :: ModuleName dom -> ExportSpec dom
- mkIESpec :: Name dom -> Maybe (SubSpec dom) -> IESpec dom
- mkPatternIESpec :: Name dom -> IESpec dom
- mkSubList :: [Name dom] -> SubSpec dom
- mkSubAll :: SubSpec dom
- mkImportDecl :: Bool -> Bool -> Bool -> Maybe String -> ModuleName dom -> Maybe (ModuleName dom) -> Maybe (ImportSpec dom) -> ImportDecl dom
- mkImportSpecList :: [IESpec dom] -> ImportSpec dom
- mkImportHidingList :: [IESpec dom] -> ImportSpec dom
- mkModuleName :: String -> ModuleName dom
- mkLanguagePragma :: [String] -> FilePragma dom
- mkOptionsGHC :: String -> FilePragma dom
- mkModuleWarningPragma :: [String] -> ModulePragma dom
- mkModuleDeprecatedPragma :: [String] -> ModulePragma dom
Documentation
mkModule :: [FilePragma dom] -> Maybe (ModuleHead dom) -> [ImportDecl dom] -> [Decl dom] -> Module dom Source #
The representation of a haskell module, that is a separate compilation unit. It may or may not have a header.
mkModuleHead :: ModuleName dom -> Maybe (ModulePragma dom) -> Maybe (ExportSpecs dom) -> ModuleHead dom Source #
Module declaration with name and (optional) exports
mkExportSpecs :: [ExportSpec dom] -> ExportSpecs dom Source #
A list of export specifications surrounded by parentheses
mkExportSpec :: IESpec dom -> ExportSpec dom Source #
Export a name and related names
mkModuleExport :: ModuleName dom -> ExportSpec dom Source #
The export of an imported module ( module A
)
mkIESpec :: Name dom -> Maybe (SubSpec dom) -> IESpec dom Source #
Marks a name to be imported or exported with related names (subspecifier)
mkPatternIESpec :: Name dom -> IESpec dom Source #
Marks a pattern synonym to be imported or exported
mkSubList :: [Name dom] -> SubSpec dom Source #
(a,b,c)
: a class exported with some of its methods, or a datatype exported with some of its constructors.
mkSubAll :: SubSpec dom Source #
(..)
: a class exported with all of its methods, or a datatype exported with all of its constructors.
mkImportDecl :: Bool -> Bool -> Bool -> Maybe String -> ModuleName dom -> Maybe (ModuleName dom) -> Maybe (ImportSpec dom) -> ImportDecl dom Source #
An import declaration: import Module.Name
mkImportSpecList :: [IESpec dom] -> ImportSpec dom Source #
Restrict the import definition to ONLY import the listed names
mkImportHidingList :: [IESpec dom] -> ImportSpec dom Source #
Restrict the import definition to DONT import the listed names
mkModuleName :: String -> ModuleName dom Source #
The name of a module
Pragmas
mkLanguagePragma :: [String] -> FilePragma dom Source #
LANGUAGE
pragma, listing the enabled language extensions in that file
mkOptionsGHC :: String -> FilePragma dom Source #
OPTIONS
pragma, possibly qualified with a tool, e.g. OPTIONS_GHC
mkModuleWarningPragma :: [String] -> ModulePragma dom Source #
A warning pragma attached to the module
mkModuleDeprecatedPragma :: [String] -> ModulePragma dom Source #
A deprecated pragma attached to the module