Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Random utilities used by the code.
Synopsis
- data RelativePos
- attachRelativePos :: [a] -> [(RelativePos, a)]
- combineSrcSpans' :: NonEmpty SrcSpan -> SrcSpan
- notImplemented :: String -> a
- showOutputable :: Outputable o => o -> String
- splitDocString :: HsDocString -> [Text]
- incSpanLine :: Int -> SrcSpan -> SrcSpan
- separatedByBlank :: (a -> SrcSpan) -> a -> a -> Bool
- separatedByBlankNE :: (a -> SrcSpan) -> NonEmpty a -> NonEmpty a -> Bool
- onTheSameLine :: SrcSpan -> SrcSpan -> Bool
- matchAddEpAnn :: AnnKeywordId -> AddEpAnn -> Maybe EpaLocation
- textToStringBuffer :: Text -> StringBuffer
- ghcModuleNameToCabal :: ModuleName -> ModuleName
Documentation
data RelativePos Source #
Relative positions in a list.
Instances
Show RelativePos Source # | |
Defined in Ormolu.Utils showsPrec :: Int -> RelativePos -> ShowS # show :: RelativePos -> String # showList :: [RelativePos] -> ShowS # | |
Eq RelativePos Source # | |
Defined in Ormolu.Utils (==) :: RelativePos -> RelativePos -> Bool # (/=) :: RelativePos -> RelativePos -> Bool # |
attachRelativePos :: [a] -> [(RelativePos, a)] Source #
Attach RelativePos
es to elements of a given list.
combineSrcSpans' :: NonEmpty SrcSpan -> SrcSpan Source #
Combine all source spans from the given list.
notImplemented :: String -> a Source #
Placeholder for things that are not yet implemented.
showOutputable :: Outputable o => o -> String Source #
Pretty-print an Outputable
thing.
splitDocString :: HsDocString -> [Text] Source #
Split and normalize a doc string. The result is a list of lines that make up the comment.
separatedByBlank :: (a -> SrcSpan) -> a -> a -> Bool Source #
Do two declarations have a blank between them?
separatedByBlankNE :: (a -> SrcSpan) -> NonEmpty a -> NonEmpty a -> Bool Source #
Do two declaration groups have a blank between them?
onTheSameLine :: SrcSpan -> SrcSpan -> Bool Source #
Return True
if one span ends on the same line the second one starts.
matchAddEpAnn :: AnnKeywordId -> AddEpAnn -> Maybe EpaLocation Source #
Check whether the given AnnKeywordId
or its Unicode variant is in an
AddEpAnn
, and return the EpaLocation
if so.
textToStringBuffer :: Text -> StringBuffer Source #
Convert Text
to a StringBuffer
by making a copy.
ghcModuleNameToCabal :: ModuleName -> ModuleName Source #
Convert GHC's ModuleName
into the one used by Cabal.