table-layout-1.0.0.0: Format tabular data as grid or table.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.Layout.Table.Primitives.ColumnModifier

Synopsis

Documentation

data ColModInfo Source #

Specifies how a column should be modified. Values of this type are derived in a traversal over the input columns by using deriveColModInfosFromGrid. Finally, columnModifier will interpret them and apply the appropriate modification function to the cells of the column.

Constructors

FillAligned OccSpec AlignInfo 
FillTo Int 
FitTo Int (Maybe (OccSpec, AlignInfo)) 

showCMI :: ColModInfo -> String Source #

Private show function.

widthCMI :: ColModInfo -> Int Source #

Get the exact width of a ColModInfo after applying it with columnModifier.

unalignedCMI :: ColModInfo -> ColModInfo Source #

Remove alignment from a ColModInfo. This is used to change alignment of headers while using the combined width information.

ensureWidthCMI :: Int -> Position H -> ColModInfo -> ColModInfo Source #

Ensures that the modification provides a minimum width but only if it is not limited.

ensureWidthOfCMI :: Cell a => a -> Position H -> ColModInfo -> ColModInfo Source #

Ensures that the given String will fit into the modified columns.

fitTitlesCMI :: Cell a => [a] -> [Position H] -> [ColModInfo] -> [ColModInfo] Source #

Fit titles of a header column into the derived ColModInfo.

columnModifier :: (Cell a, StringBuilder b) => Position H -> CutMark -> ColModInfo -> a -> b Source #

Generates a function which modifies a given cell according to Position, CutMark and ColModInfo. This is used to modify a single cell of a column to bring all cells of a column to the same width.

deriveAlignInfo :: Cell a => OccSpec -> a -> AlignInfo Source #

Generate the AlignInfo of a cell by using the OccSpec.

deriveColModInfosFromGridLA :: Cell a => [(LenSpec, AlignSpec)] -> [Row a] -> [ColModInfo] Source #

Derive the ColModInfo for each column of a list of rows by using the corresponding specifications.

deriveColModInfosFromGrid :: Cell a => [ColSpec] -> [Row a] -> [ColModInfo] Source #

Derive the ColModInfo for each column of a list of rows by using the corresponding ColSpec.

deriveColModInfoFromColumnLA :: (Foldable col, Cell a) => (LenSpec, AlignSpec) -> col a -> ColModInfo Source #

Derive the ColModInfo of a single column by using the LenSpec and the AlignSpec.

deriveColModInfosFromColumnsLA :: (Foldable col, Cell a) => [(LenSpec, AlignSpec)] -> [col a] -> [ColModInfo] Source #

Derive the ColModInfo for each column of a list of columns by using the corresponding specifications.

deriveColModInfosFromColumns :: (Foldable col, Cell a) => [ColSpec] -> [col a] -> [ColModInfo] Source #

Derive the ColModInfo for each column of a list of columns by using the corresponding ColSpec.

deriveColumnModifiers :: (Cell a, StringBuilder b) => [ColSpec] -> [Row a] -> [a -> b] Source #

Derive the ColModInfo and generate functions without any intermediate steps.