hindent-6.0.0: Extensible Haskell pretty printer
Safe HaskellSafe-Inferred
LanguageHaskell2010

HIndent.Pretty.Combinators.Lineup

Description

Printer combinators for lining up multiple elements.

Synopsis

Tuples

hvTuple :: [Printer ()] -> Printer () Source #

Applies hTuple if the result fits in a line or vTuple otherwise.

hvTuple' :: [Printer ()] -> Printer () Source #

Applies hTuple' if the result fits in a line or vTuple' otherwise.

hTuple :: [Printer ()] -> Printer () Source #

Runs printers to construct a tuple in a line.

vTuple :: [Printer ()] -> Printer () Source #

Runs printers to construct a tuple where elements are aligned vertically.

vTuple' :: [Printer ()] -> Printer () Source #

Similar to vTuple, but the closing parenthesis is in the last element.

hPromotedTuple :: [Printer ()] -> Printer () Source #

Runs printers to construct a promoted tuple in a line.

Unboxed tuples

hvUnboxedTuple' :: [Printer ()] -> Printer () Source #

Runs printers to construct an unboxed tuple. The elements are aligned either in a line or vertically.

hUnboxedTuple :: [Printer ()] -> Printer () Source #

Runs printers to construct an unboxed tuple in a line.

Unboxed sums

hvUnboxedSum' :: [Printer ()] -> Printer () Source #

Runs printers to construct an unboxed sum. The elements are aligned either in a line or vertically.

The enclosing parenthesis will be printed on the same line as the last element.

Records

hvFields :: [Printer ()] -> Printer () Source #

Applies hFields if the result fits in a line or vFields otherwise.

hFields :: [Printer ()] -> Printer () Source #

Runs printers to construct a record in a line.

vFields :: [Printer ()] -> Printer () Source #

Runs printers to construct a record where elements are aligned vertically.

vFields' :: [Printer ()] -> Printer () Source #

Similar to vFields, but the closing brace is in the same line as the last element.

Lists

hList :: [Printer ()] -> Printer () Source #

Runs printers to construct a list in a line.

vList :: [Printer ()] -> Printer () Source #

Runs printers to construct a list where elements are aligned vertically.

hvPromotedList :: [Printer ()] -> Printer () Source #

Runs printers to construct a promoted list where elements are aligned in a line or vertically.

Bars

hvBarSep :: [Printer ()] -> Printer () Source #

Applies hBarSep if the result fits in a line or vBarSep otherwise.

hBarSep :: [Printer ()] -> Printer () Source #

Runs printers in a line with a bar as the separator.

vBarSep :: [Printer ()] -> Printer () Source #

Runs printers where each line except the first one has | as a prefix.

Commas

hvCommaSep :: [Printer ()] -> Printer () Source #

Applies hCommaSep if the result fits in a line or vCommaSep otherwise.

hCommaSep :: [Printer ()] -> Printer () Source #

Runs printers in a line with a comma as the separator.

vCommaSep :: [Printer ()] -> Printer () Source #

Runs printers with each line except the first one has , as a prefix.

Others

spaced :: [Printer ()] -> Printer () Source #

Runs printers in a line with a space as the separator.

lined :: [Printer ()] -> Printer () Source #

Runs printers line by line.

blanklined :: [Printer ()] -> Printer () Source #

Runs printers with a blank line as the separator.

hDotSep :: [Printer ()] -> Printer () Source #

Runs printers with a dot as the separator.

spacePrefixed :: [Printer ()] -> Printer () Source #

Prints each element after a space like.

newlinePrefixed :: [Printer ()] -> Printer () Source #

Prints each element after a new line.

prefixedLined :: String -> [Printer ()] -> Printer () Source #

Runs printers with a prefix. The prefix is printed before the indent.

inter :: Printer () -> [Printer ()] -> Printer () Source #