apply-refact-0.12.0.0: Perform refactorings specified by the refact library.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Refact.Utils

Synopsis

Synonyms

Monad

type M a = StateT () IO a Source #

Utility

modifyAnnKey :: (Data mod, Data t, Data old, Data new, Monoid t, Typeable t) => mod -> LocatedAn t old -> LocatedAn t new -> M (LocatedAn t new) Source #

Perform the necessary adjustments to annotations when replacing one Located thing with another Located thing.

For example, this function will ensure the correct relative position and make sure that any trailing semi colons or commas are transferred. modifyAnnKey :: (Data old, Data new, Data mod) => mod -> GHC.Located old -> GHC.Located new -> M (GHC.Located new)

getAnnSpan :: forall a. Located a -> AnnSpan Source #

getAnnSpanA :: forall an a. LocatedAn an a -> AnnSpan Source #

toGhcSrcSpan :: FilePath -> SrcSpan -> SrcSpan Source #

Convert a Refact.Types.SrcSpan to a SrcLoc.SrcSpan

toGhcSrcSpan' :: FastString -> SrcSpan -> SrcSpan Source #

Convert a Refact.Types.SrcSpan to a SrcLoc.SrcSpan