Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type Module = Located (HsModule GhcPs)
- type Stmt = ExprLStmt GhcPs
- type Expr = Located (HsExpr GhcPs)
- type Decl = Located (HsDecl GhcPs)
- type Name = Located RdrName
- type Pat = Located (Pat GhcPs)
- type Type = Located (HsType GhcPs)
- type Import = LImportDecl GhcPs
- type FunBind = HsMatchContext RdrName
- type AnnKeyMap = Map AnnKey [AnnKey]
- pattern RealSrcLoc' :: RealSrcLoc -> SrcLoc
- pattern RealSrcSpan' :: RealSrcSpan -> SrcSpan
- type M a = StateT (Anns, AnnKeyMap) IO a
- mergeAnns :: Anns -> Anns -> Anns
- modifyAnnKey :: (Data old, Data new, Data mod) => mod -> Located old -> Located new -> M (Located new)
- replaceAnnKey :: AnnKey -> AnnKey -> AnnKey -> AnnKey -> Anns -> Anns
- getAnnSpan :: forall a. Located 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
- findParent :: Data a => AnnSpan -> Anns -> a -> Maybe AnnKey
- foldAnnKey :: forall a. (AnnKey -> a) -> (RealSrcSpan -> AnnConName -> a) -> AnnKey -> a
Synonyms
type Import = LImportDecl GhcPs Source #
type FunBind = HsMatchContext RdrName Source #
pattern RealSrcLoc' :: RealSrcLoc -> SrcLoc Source #
pattern RealSrcSpan' :: RealSrcSpan -> SrcSpan Source #
Monad
Utility
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
getAnnSpan :: forall a. Located 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
annSpanToSrcSpan :: AnnSpan -> SrcSpan Source #
srcSpanToAnnSpan :: SrcSpan -> AnnSpan Source #
setAnnSpanFile :: FastString -> AnnSpan -> AnnSpan Source #
setSrcSpanFile :: FastString -> SrcSpan -> SrcSpan Source #
findParent :: Data a => AnnSpan -> Anns -> a -> Maybe AnnKey Source #
A parent in this case is an element which has the same SrcSpan
foldAnnKey :: forall a. (AnnKey -> a) -> (RealSrcSpan -> AnnConName -> a) -> AnnKey -> a Source #