haskell-tools-rewrite-0.8.1.0: Facilities for generating new parts of the Haskell-Tools AST

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.Tools.AST.Gen.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

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