HaRe-0.8.2.1: the Haskell Refactorer.

Safe HaskellNone
LanguageHaskell98

Language.Haskell.Refact.Utils.Monad

Synopsis

Documentation

type ParseResult = TypecheckedModule Source

Result of parsing a Haskell source file. It is simply the TypeCheckedModule produced by GHC.

data RefactState Source

State for refactoring a single file. Holds/hides the ghc-exactprint annotations, which get updated transparently at key points.

Constructors

RefSt 

Fields

rsSettings :: !RefactSettings

Session level settings

rsUniqState :: !Int

Current Unique creator value, incremented every time it is used

rsSrcSpanCol :: !Int

Current SrcSpan creator value, incremented every time it is used

rsFlags :: !RefactFlags

Flags for controlling generic traversals

rsStorage :: !StateStorage

Temporary storage of values while refactoring takes place

rsCurrentTarget :: !(Maybe TargetModule)
 
rsModule :: !(Maybe RefactModule)

The current module being refactored

data RefactModule Source

Constructors

RefMod 

Fields

rsTypecheckedMod :: !TypecheckedModule
 
rsNameMap :: NameMap

Mapping from the names in the ParsedSource to the renamed versions. Note: No strict mark, can be computed lazily.

rsTokenCache :: !(TokenCache Anns)

Token stream for the current module, maybe modified, in SrcSpan tree form

rsStreamModified :: !RefacResult

current module has updated the AST

type TargetModule = ModulePath Source

type CabalGraph = Map ChComponentName (GmComponent GMCResolved (Set ModulePath)) Source

data RefactFlags Source

Constructors

RefFlags 

Fields

rsDone :: !Bool

Current traversal has already made a change

data StateStorage Source

Provide some temporary storage while the refactoring is taking place