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]
- 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
- toGhcSrcSpan :: FilePath -> SrcSpan -> SrcSpan
- toGhcSrcSpan' :: FastString -> SrcSpan -> SrcSpan
- setSrcSpanFile :: FastString -> SrcSpan -> SrcSpan
- findParent :: Data a => SrcSpan -> Anns -> a -> Maybe AnnKey
Synonyms
type Import = LImportDecl GhcPs Source #
type FunBind = HsMatchContext RdrName 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
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
setSrcSpanFile :: FastString -> SrcSpan -> SrcSpan Source #