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.
Synopsis
- mkModule :: [FilePragma] -> Maybe ModuleHead -> [ImportDecl] -> [Decl] -> Module
- mkModuleHead :: ModuleName -> Maybe ModulePragma -> Maybe ExportSpecs -> ModuleHead
- mkExportSpecs :: [ExportSpec] -> ExportSpecs
- mkExportSpec :: IESpec -> ExportSpec
- mkModuleExport :: ModuleName -> ExportSpec
- mkIESpec :: Name -> Maybe SubSpec -> IESpec
- mkPatternIESpec :: Name -> IESpec
- mkSubList :: [Name] -> SubSpec
- mkSubAll :: SubSpec
- mkImportDecl :: Bool -> Bool -> Bool -> Maybe String -> ModuleName -> Maybe ModuleName -> Maybe ImportSpec -> ImportDecl
- mkImportSpecList :: [IESpec] -> ImportSpec
- mkImportHidingList :: [IESpec] -> ImportSpec
- mkModuleName :: String -> ModuleName
- mkFilePragmas :: [FilePragma] -> FilePragmaList
- mkLanguagePragma :: [String] -> FilePragma
- mkOptionsGHC :: String -> FilePragma
- mkModuleWarningPragma :: [String] -> ModulePragma
- mkModuleDeprecatedPragma :: [String] -> ModulePragma
Documentation
mkModule :: [FilePragma] -> Maybe ModuleHead -> [ImportDecl] -> [Decl] -> Module Source #
The representation of a haskell module, that is a separate compilation unit. It may or may not have a header.
mkModuleHead :: ModuleName -> Maybe ModulePragma -> Maybe ExportSpecs -> ModuleHead Source #
Module declaration with name and (optional) exports
mkExportSpecs :: [ExportSpec] -> ExportSpecs Source #
A list of export specifications surrounded by parentheses
mkExportSpec :: IESpec -> ExportSpec Source #
Export a name and related names
mkModuleExport :: ModuleName -> ExportSpec Source #
The export of an imported module ( module A
)
mkIESpec :: Name -> Maybe SubSpec -> IESpec Source #
Marks a name to be imported or exported with related names (subspecifier)
mkPatternIESpec :: Name -> IESpec Source #
Marks a pattern synonym to be imported or exported
mkSubList :: [Name] -> SubSpec Source #
(a,b,c)
: a class exported with some of its methods, or a datatype exported with some of its constructors.
(..)
: a class exported with all of its methods, or a datatype exported with all of its constructors.
mkImportDecl :: Bool -> Bool -> Bool -> Maybe String -> ModuleName -> Maybe ModuleName -> Maybe ImportSpec -> ImportDecl Source #
An import declaration: import Module.Name
mkImportSpecList :: [IESpec] -> ImportSpec Source #
Restrict the import definition to ONLY import the listed names
mkImportHidingList :: [IESpec] -> ImportSpec Source #
Restrict the import definition to DONT import the listed names
mkModuleName :: String -> ModuleName Source #
The name of a module
Pragmas
mkFilePragmas :: [FilePragma] -> FilePragmaList Source #
mkLanguagePragma :: [String] -> FilePragma Source #
LANGUAGE
pragma, listing the enabled language extensions in that file
mkOptionsGHC :: String -> FilePragma Source #
OPTIONS
pragma, possibly qualified with a tool, e.g. OPTIONS_GHC
mkModuleWarningPragma :: [String] -> ModulePragma Source #
A warning pragma attached to the module
mkModuleDeprecatedPragma :: [String] -> ModulePragma Source #
A deprecated pragma attached to the module