Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- debugEnabledFlag :: Bool
- debugPEnabledFlag :: Bool
- debug :: c -> String -> c
- debugP :: String -> c -> c
- debugM :: Monad m => String -> m ()
- warn :: c -> String -> c
- isGoodDelta :: DeltaPos -> Bool
- ss2delta :: Pos -> RealSrcSpan -> DeltaPos
- ss2deltaEnd :: RealSrcSpan -> RealSrcSpan -> DeltaPos
- ss2deltaStart :: RealSrcSpan -> RealSrcSpan -> DeltaPos
- pos2delta :: Pos -> Pos -> DeltaPos
- undelta :: Pos -> DeltaPos -> LayoutStartCol -> Pos
- undeltaSpan :: RealSrcSpan -> AnnKeywordId -> DeltaPos -> AddEpAnn
- addDP :: DeltaPos -> DeltaPos -> DeltaPos
- adjustDeltaForOffset :: Int -> LayoutStartCol -> DeltaPos -> DeltaPos
- ss2pos :: RealSrcSpan -> Pos
- ss2posEnd :: RealSrcSpan -> Pos
- ss2range :: SrcSpan -> (Pos, Pos)
- rs2range :: RealSrcSpan -> (Pos, Pos)
- rs :: SrcSpan -> RealSrcSpan
- range2rs :: (Pos, Pos) -> RealSrcSpan
- badRealSrcSpan :: RealSrcSpan
- spanLength :: RealSrcSpan -> Int
- isPointSrcSpan :: RealSrcSpan -> Bool
- orderByKey :: [(RealSrcSpan, a)] -> [RealSrcSpan] -> [(RealSrcSpan, a)]
- isListComp :: HsStmtContext name -> Bool
- isGadt :: [LConDecl (GhcPass p)] -> Bool
- isExactName :: Data name => name -> Bool
- insertCppComments :: ParsedSource -> [LEpaComment] -> ParsedSource
- ghcCommentText :: LEpaComment -> String
- tokComment :: LEpaComment -> Comment
- mkLEpaComment :: String -> Anchor -> LEpaComment
- mkComment :: String -> Anchor -> Comment
- normaliseCommentText :: String -> String
- mkKWComment :: AnnKeywordId -> EpaLocation -> Comment
- comment2dp :: (Comment, DeltaPos) -> (KeywordId, DeltaPos)
- sortAnchorLocated :: [GenLocated Anchor a] -> [GenLocated Anchor a]
- getAnnotationEP :: Data a => Located a -> Anns -> Maybe Annotation
- annTrueEntryDelta :: Annotation -> DeltaPos
- annLeadingCommentEntryDelta :: Annotation -> DeltaPos
- dpFromString :: String -> DeltaPos
- isSymbolRdrName :: RdrName -> Bool
- rdrName2String :: RdrName -> String
- name2String :: Name -> String
- occAttributes :: OccName -> String
- locatedAnAnchor :: LocatedAn a t -> RealSrcSpan
- showAst :: Data a => a -> String
- ghead :: String -> [a] -> a
- glast :: String -> [a] -> a
- gtail :: String -> [a] -> [a]
- gfromJust :: String -> Maybe a -> a
Documentation
debugEnabledFlag :: Bool Source #
Global switch to enable debug tracing in ghc-exactprint Delta / Print
debugPEnabledFlag :: Bool Source #
Global switch to enable debug tracing in ghc-exactprint Pretty
debug :: c -> String -> c Source #
Provide a version of trace that comes at the end of the line, so it can easily be commented out when debugging different things.
isGoodDelta :: DeltaPos -> Bool Source #
A good delta has no negative values.
ss2delta :: Pos -> RealSrcSpan -> DeltaPos Source #
Create a delta from the current position to the start of the given
SrcSpan
.
ss2deltaEnd :: RealSrcSpan -> RealSrcSpan -> DeltaPos Source #
create a delta from the end of a current span. The +1 is because the stored position ends up one past the span, this is prior to that adjustment
ss2deltaStart :: RealSrcSpan -> RealSrcSpan -> DeltaPos Source #
create a delta from the start of a current span. The +1 is because the stored position ends up one past the span, this is prior to that adjustment
pos2delta :: Pos -> Pos -> DeltaPos Source #
Convert the start of the second Pos
to be an offset from the
first. The assumption is the reference starts before the second Pos
undelta :: Pos -> DeltaPos -> LayoutStartCol -> Pos Source #
Apply the delta to the current position, taking into account the current column offset if advancing to a new line
undeltaSpan :: RealSrcSpan -> AnnKeywordId -> DeltaPos -> AddEpAnn Source #
addDP :: DeltaPos -> DeltaPos -> DeltaPos Source #
Add together two DeltaPos
taking into account newlines
DP (0, 1) `addDP` DP (0, 2) == DP (0, 3) DP (0, 9) `addDP` DP (1, 5) == DP (1, 5) DP (1, 4) `addDP` DP (1, 3) == DP (2, 3)
adjustDeltaForOffset :: Int -> LayoutStartCol -> DeltaPos -> DeltaPos Source #
ss2pos :: RealSrcSpan -> Pos Source #
ss2posEnd :: RealSrcSpan -> Pos Source #
rs :: SrcSpan -> RealSrcSpan Source #
spanLength :: RealSrcSpan -> Int Source #
isPointSrcSpan :: RealSrcSpan -> Bool Source #
Checks whether a SrcSpan has zero length.
orderByKey :: [(RealSrcSpan, a)] -> [RealSrcSpan] -> [(RealSrcSpan, a)] Source #
Given a list of items and a list of keys, returns a list of items ordered by their position in the list of keys.
isListComp :: HsStmtContext name -> Bool Source #
isExactName :: Data name => name -> Bool Source #
insertCppComments :: ParsedSource -> [LEpaComment] -> ParsedSource Source #
ghcCommentText :: LEpaComment -> String Source #
tokComment :: LEpaComment -> Comment Source #
mkLEpaComment :: String -> Anchor -> LEpaComment Source #
normaliseCommentText :: String -> String Source #
mkKWComment :: AnnKeywordId -> EpaLocation -> Comment Source #
Makes a comment which originates from a specific keyword.
sortAnchorLocated :: [GenLocated Anchor a] -> [GenLocated Anchor a] Source #
getAnnotationEP :: Data a => Located a -> Anns -> Maybe Annotation Source #
annTrueEntryDelta :: Annotation -> DeltaPos Source #
The "true entry" is the distance from the last concrete element to the start of the current element.
annLeadingCommentEntryDelta :: Annotation -> DeltaPos Source #
Return the DP of the first item that generates output, either a comment or the entry DP
dpFromString :: String -> DeltaPos Source #
Calculates the distance from the start of a string to the end of a string.
isSymbolRdrName :: RdrName -> Bool Source #
rdrName2String :: RdrName -> String Source #
name2String :: Name -> String Source #
occAttributes :: OccName -> String Source #
locatedAnAnchor :: LocatedAn a t -> RealSrcSpan Source #