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]
- incSpanLine :: Int -> SrcSpan -> SrcSpan
- separatedByBlank :: (a -> SrcSpan) -> a -> a -> Bool
- separatedByBlankNE :: (a -> SrcSpan) -> NonEmpty a -> NonEmpty a -> Bool
- onTheSameLine :: SrcSpan -> SrcSpan -> Bool
- class HasSrcSpan l where
- getLoc' :: HasSrcSpan l => GenLocated l a -> SrcSpan
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.
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.
class HasSrcSpan l where Source #
Instances
HasSrcSpan SrcSpan Source # | |
HasSrcSpan (SrcSpanAnn' ann) Source # | |
Defined in Ormolu.Utils loc' :: SrcSpanAnn' ann -> SrcSpan Source # |
getLoc' :: HasSrcSpan l => GenLocated l a -> SrcSpan Source #