ormolu-0.7.7.0: A formatter for Haskell source code
Safe HaskellNone
LanguageGHC2021

Ormolu.Utils

Description

Random utilities used by the code.

Synopsis

Documentation

data RelativePos #

Relative positions in a list.

Instances

Instances details
Show RelativePos # 
Instance details

Defined in Ormolu.Utils

Eq RelativePos # 
Instance details

Defined in Ormolu.Utils

attachRelativePos :: [a] -> [(RelativePos, a)] #

Attach RelativePoses to elements of a given list.

combineSrcSpans' :: NonEmpty SrcSpan -> SrcSpan #

Combine all source spans from the given list.

notImplemented :: String -> a #

Placeholder for things that are not yet implemented.

showOutputable :: Outputable o => o -> String #

Pretty-print an Outputable thing.

splitDocString :: HsDocString -> [Text] #

Split and normalize a doc string. The result is a list of lines that make up the comment.

incSpanLine :: Int -> SrcSpan -> SrcSpan #

Increment line number in a SrcSpan.

separatedByBlank :: (a -> SrcSpan) -> a -> a -> Bool #

Do two declarations have a blank between them?

separatedByBlankNE :: (a -> SrcSpan) -> NonEmpty a -> NonEmpty a -> Bool #

Do two declaration groups have a blank between them?

onTheSameLine :: SrcSpan -> SrcSpan -> Bool #

Return True if one span ends on the same line the second one starts.

matchAddEpAnn :: AnnKeywordId -> AddEpAnn -> Maybe EpaLocation #

Check whether the given AnnKeywordId or its Unicode variant is in an AddEpAnn, and return the EpaLocation if so.

textToStringBuffer :: Text -> StringBuffer #

Convert Text to a StringBuffer by making a copy.

ghcModuleNameToCabal :: ModuleName -> ModuleName #

Convert GHC's ModuleName into the one used by Cabal.