Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Text.Layout.Table.Primitives.ColumnModifier
Synopsis
- data ColModInfo
- showCMI :: ColModInfo -> String
- widthCMI :: ColModInfo -> Int
- unalignedCMI :: ColModInfo -> ColModInfo
- ensureWidthCMI :: Int -> Position H -> ColModInfo -> ColModInfo
- ensureWidthOfCMI :: Cell a => a -> Position H -> ColModInfo -> ColModInfo
- fitTitlesCMI :: Cell a => [a] -> [Position H] -> [ColModInfo] -> [ColModInfo]
- columnModifier :: (Cell a, StringBuilder b) => Position H -> CutMark -> ColModInfo -> a -> b
- deriveAlignInfo :: Cell a => OccSpec -> a -> AlignInfo
- unpackColSpecs :: [ColSpec] -> [(LenSpec, AlignSpec)]
- deriveColModInfosFromGridLA :: Cell a => [(LenSpec, AlignSpec)] -> [Row a] -> [ColModInfo]
- deriveColModInfosFromGrid :: Cell a => [ColSpec] -> [Row a] -> [ColModInfo]
- deriveColModInfoFromColumnLA :: (Foldable col, Cell a) => (LenSpec, AlignSpec) -> col a -> ColModInfo
- deriveColModInfosFromColumnsLA :: (Foldable col, Cell a) => [(LenSpec, AlignSpec)] -> [col a] -> [ColModInfo]
- deriveColModInfosFromColumns :: (Foldable col, Cell a) => [ColSpec] -> [col a] -> [ColModInfo]
- deriveColumnModifiers :: (Cell a, StringBuilder b) => [ColSpec] -> [Row a] -> [a -> b]
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.
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.
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.