table-layout-0.9.0.1: Format tabular data as grid or table.

Safe HaskellSafe
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 deriveColModInfos. Finally, columnModifier will interpret them and apply the appropriate modification function to the cells of the column.

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 :: String -> Position H -> ColModInfo -> ColModInfo Source #

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

fitTitlesCMI :: [String] -> [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.

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

Derive the ColModInfo by using layout specifications and the actual cells of a column. This function only needs to know about LenSpec and AlignInfo.

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

Derive the ColModInfo and generate functions without any intermediate steps.

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

Generate the AlignInfo of a cell by using the OccSpec.