HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

Modulecuddle-1.8.1.0GHC2021

Codec.CBOR.Cuddle.Pretty.Columnar

This module provides some utility functions to help with aligning pretty printed values by column.

  • 4 types
  • 8 values
  • Packagecuddle-1.8.1.0
  • Exports12
  • LanguageGHC2021
  • LicenceApache-2.0
  • SourceColumnar.hs
valuecellL :: Pretty a => a -> Cell ann
#

Creates a cell by pretty printing the input value and then left-aligning the resulting Doc within the table.

valuecellR :: Pretty a => a -> Cell ann
#

Creates a cell by pretty printing the input value and then right-aligning the resulting Doc within the table.

valueemptyCell :: Cell ann
#

A cell that takes up a cell but has no content.

newtypenewtype Columnar ann
#

Columnar is a two-dimensional table of Docs. When rendered, the cells within each row will be aligned with the cells of every other row in the same column.

Constructors

valuecolumnarListing :: Doc ann -> Doc ann -> Doc ann -> Columnar ann -> Doc ann
#

Pretty prints the Columnar so that the rows are separated by by the separator Doc provided as the third argument and then everything is enclosed within the left and right brackets provided as the first and second argument accordingly. The brackets will be aligned with the separators in the first column, e.g. ``` [ foo , bar ] ```

valuecolumnarSepBy :: Doc ann -> Columnar ann -> Doc ann
#

Pretty prints the Columnar so that every line after the first has a separator prepended to it. This can be useful when you want to align the rows, but the separator would cause all the other rows after the first to be shifted right by one. The way you use this is you reduce the indentation on the following lines by the width of the separator. ``` foo = x , y , z ```