nixfmt-0.3.0: An opinionated formatter for Nix

Safe HaskellNone
LanguageHaskell2010

Nixfmt.Util

Synopsis

Documentation

manyP :: (Stream s, Ord e) => (Token s -> Bool) -> ParsecT e s m (Tokens s) Source #

Match zero or more characters that match a predicate.

someP :: (Stream s, Ord e) => (Token s -> Bool) -> ParsecT e s m (Tokens s) Source #

Match one or more characters that match a predicate.

manyText :: (Stream s, Ord e) => ParsecT e s m Text -> ParsecT e s m Text Source #

Match zero or more texts and return the concatenation.

someText :: (Stream s, Ord e) => ParsecT e s m Text -> ParsecT e s m Text Source #

Match one or more texts and return the concatenation.

commonPrefix :: Text -> Text -> Text Source #

The longest common prefix of the arguments.

commonIndentation :: [Text] -> Maybe Text Source #

The longest common prefix consisting of only whitespace. The longest common prefix of zero texts is infinite, represented as Nothing.

dropCommonIndentation :: [Text] -> [Text] Source #

Strip the longest common indentation from a list of lines. Empty lines do not count towards the common indentation.