fourmolu-0.17.0.0: A formatter for Haskell source code

Safe Haskell | None
Language | GHC2021

Ormolu.Processing.Common

Description

Common definitions for pre- and post- processing.

Synopsis

- removeIndentation :: Text -> (Text, Int)
- reindent :: Int -> Text -> Text
- linesInRegion :: RegionDeltas -> Text -> Text
- intSetToRegions :: Int -> IntSet -> [RegionDeltas]

# Documentation

removeIndentation :: Text -> (Text, Int) #

Remove indentation from a given `Text`. Return the input with indentation removed and the detected indentation level.

reindent :: Int -> Text -> Text #

Add indentation to a `Text`.

linesInRegion :: RegionDeltas -> Text -> Text #

All lines in the region specified by `RegionDeltas`.

intSetToRegions #

Arguments

:: Int | Total number of lines
-> IntSet |
-> [RegionDeltas] |

Convert a set of line indices into disjoint `RegionDelta`s