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

Safe Haskell | None
Language | Haskell2010

Refact.Utils

Contents

- Synonyms
- Monad
- Utility

Synopsis

- type Module = Located (HsModule GhcPs)
- type Stmt = ExprLStmt GhcPs
- type Expr = LHsExpr GhcPs
- type Decl = LHsDecl GhcPs
- type Name = LocatedN RdrName
- type Pat = LPat GhcPs
- type Type = LHsType GhcPs
- type Import = LImportDecl GhcPs
- type FunBind = HsMatchContext GhcPs
- pattern RealSrcLoc' :: RealSrcLoc -> SrcLoc
- pattern RealSrcSpan' :: RealSrcSpan -> SrcSpan
- type M a = StateT () IO a
- modifyAnnKey :: (Data mod, Data t, Data old, Data new, Monoid t, Typeable t) => mod -> LocatedAn t old -> LocatedAn t new -> M (LocatedAn t new)
- getAnnSpan :: Located a -> AnnSpan
- getAnnSpanA :: LocatedAn an a -> AnnSpan
- toGhcSrcSpan :: FilePath -> SrcSpan -> SrcSpan
- toGhcSrcSpan' :: FastString -> SrcSpan -> SrcSpan
- annSpanToSrcSpan :: AnnSpan -> SrcSpan
- srcSpanToAnnSpan :: SrcSpan -> AnnSpan
- setAnnSpanFile :: FastString -> AnnSpan -> AnnSpan
- setSrcSpanFile :: FastString -> SrcSpan -> SrcSpan
- setRealSrcSpanFile :: FastString -> RealSrcSpan -> RealSrcSpan

# Synonyms

type Module = Located (HsModule GhcPs) #

type Stmt = ExprLStmt GhcPs #

type Expr = LHsExpr GhcPs #

type Decl = LHsDecl GhcPs #

type Name = LocatedN RdrName #

type Pat = LPat GhcPs #

type Type = LHsType GhcPs #

type Import = LImportDecl GhcPs #

type FunBind = HsMatchContext GhcPs #

pattern RealSrcLoc' :: RealSrcLoc -> SrcLoc #

pattern RealSrcSpan' :: RealSrcSpan -> SrcSpan #

# Monad

type M a = StateT () IO a #

# 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) #

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 :: Located a -> AnnSpan #

getAnnSpanA :: LocatedAn an a -> AnnSpan #

toGhcSrcSpan :: FilePath -> SrcSpan -> SrcSpan #

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

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

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

annSpanToSrcSpan :: AnnSpan -> SrcSpan #

srcSpanToAnnSpan :: SrcSpan -> AnnSpan #

setAnnSpanFile :: FastString -> AnnSpan -> AnnSpan #

setSrcSpanFile :: FastString -> SrcSpan -> SrcSpan #

setRealSrcSpanFile :: FastString -> RealSrcSpan -> RealSrcSpan #