apply-refact-0.5.0.0: Perform refactorings specified by the refact library.

Safe HaskellNone
LanguageHaskell2010

Refact.Utils

Contents

Synopsis

Synonyms

type Pat = LPat GhcPs #

Monad

type M a = State Anns a #

Utility

mergeAnns :: Anns -> Anns -> Anns #

Left bias pair union

modifyAnnKey :: (Data old, Data new, Data mod) => mod -> Located old -> Located new -> M (Located new) #

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 :: Anns -> AnnKey -> AnnKey -> AnnKey -> AnnKey -> Anns #

Lower level version of modifyAnnKey

toGhcSrcSpan :: FilePath -> SrcSpan -> SrcSpan #

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

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

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