Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Refact.Utils
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 :: forall a. Located a -> AnnSpan
- getAnnSpanA :: forall an a. 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 Import = LImportDecl GhcPs #
type FunBind = HsMatchContext GhcPs #
pattern RealSrcLoc' :: RealSrcLoc -> SrcLoc #
pattern RealSrcSpan' :: RealSrcSpan -> SrcSpan #
Monad
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 :: forall a. Located a -> AnnSpan #
getAnnSpanA :: forall an a. 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 #