HaRe-0.7.0.7: the Haskell Refactorer.

Safe HaskellNone

Language.Haskell.Refact.Utils.Monad

Synopsis

Documentation

type ParseResult = TypecheckedModuleSource

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 token stream, which gets 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

rsFlags :: !RefactFlags

Flags for controlling generic traversals

rsStorage :: !StateStorage

Temporary storage of values while refactoring takes place

rsModule :: !(Maybe RefactModule)

The current module being refactored

data RefactModule Source

Constructors

RefMod 

Fields

rsTypecheckedMod :: !TypecheckedModule
 
rsOrigTokenStream :: ![PosToken]

Original Token stream for the current module

rsTokenCache :: !TokenCache

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

rsStreamModified :: !Bool

current module has updated the token stream

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

Instances

initGhcSession :: Cradle -> [FilePath] -> RefactGhc ()Source

Initialise the GHC session, when starting a refactoring. This should never be called directly.