apply-refact-0.9.0.0: Perform refactorings specified by the refact library.
Safe HaskellNone
LanguageHaskell2010

Refact.Utils

Synopsis

Synonyms

Monad

type M a = StateT (Anns, AnnKeyMap) IO a Source #

Utility

mergeAnns :: Anns -> Anns -> Anns #

Left bias pair union

modifyAnnKey :: (Data old, Data new, Data mod) => mod -> Located old -> Located new -> M (Located 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.

replaceAnnKey :: AnnKey -> AnnKey -> AnnKey -> AnnKey -> Anns -> Anns Source #

Lower level version of modifyAnnKey

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

findParent :: Data a => SrcSpan -> Anns -> a -> Maybe AnnKey Source #

A parent in this case is an element which has the same SrcSpan