Safe Haskell | None |
---|---|
Language | Haskell2010 |
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]
- typeArgToType :: LHsTypeArg p -> LHsType p
- unSrcSpan :: SrcSpan -> Maybe RealSrcSpan
- incSpanLine :: Int -> SrcSpan -> SrcSpan
- separatedByBlank :: (a -> SrcSpan) -> a -> a -> Bool
- separatedByBlankNE :: (a -> SrcSpan) -> NonEmpty a -> NonEmpty a -> Bool
- onTheSameLine :: SrcSpan -> SrcSpan -> Bool
- removeIndentation :: String -> (String, Int)
Documentation
data RelativePos Source #
Relative positions in a list.
Instances
Eq RelativePos Source # | |
Defined in Ormolu.Utils (==) :: RelativePos -> RelativePos -> Bool # (/=) :: RelativePos -> RelativePos -> Bool # | |
Show RelativePos Source # | |
Defined in Ormolu.Utils showsPrec :: Int -> RelativePos -> ShowS # show :: RelativePos -> String # showList :: [RelativePos] -> ShowS # |
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.
typeArgToType :: LHsTypeArg p -> LHsType p Source #
Get LHsType
out of LHsTypeArg
.
unSrcSpan :: SrcSpan -> Maybe RealSrcSpan Source #
Get RealSrcSpan
out of SrcSpan
if the span is “helpful”.
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?