Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module provides predefined styles, combinators to modify them, abstract style descriptions, and combinators for quickly turning them into styles.
The following resource may be useful for constructing your own primitive styles: https://en.wikipedia.org/wiki/Box-drawing_character.
Synopsis
- asciiS :: TableStyle LineStyle LineStyle
- asciiRoundS :: TableStyle LineStyle LineStyle
- asciiDoubleS :: TableStyle LineStyle LineStyle
- unicodeS :: TableStyle LineStyle LineStyle
- unicodeBoldHeaderS :: TableStyle LineStyle LineStyle
- unicodeRoundS :: TableStyle LineStyle LineStyle
- unicodeBoldS :: TableStyle LineStyle LineStyle
- unicodeBoldStripedS :: TableStyle LineStyle LineStyle
- unicodeDoubleFrameS :: TableStyle LineStyle LineStyle
- withoutBorders :: TableStyle a b -> TableStyle a b
- withoutTopBorder :: TableStyle a b -> TableStyle a b
- withoutBottomBorder :: TableStyle a b -> TableStyle a b
- withoutLeftBorder :: TableStyle a b -> TableStyle a b
- withoutRightBorder :: TableStyle a b -> TableStyle a b
- withRoundCorners :: TableStyle a b -> TableStyle a b
- inheritStyle :: (c -> a) -> (d -> b) -> TableStyle a b -> TableStyle c d
- inheritStyleHeaderGroup :: (c -> a) -> (c -> a) -> (d -> b) -> (d -> b) -> TableStyle a b -> TableStyle c d
- asciiTableStyleFromSpec :: TableStyleSpec -> TableStyle LineStyle LineStyle
- roundedAsciiTableStyleFromSpec :: TableStyleSpec -> TableStyle LineStyle LineStyle
- unicodeTableStyleFromSpec :: TableStyleSpec -> TableStyle LineStyle LineStyle
- tableStyleFromSpec :: (LineStyle -> String) -> (LineStyle -> String) -> (LineStyle -> LineStyle -> LineStyle -> LineStyle -> String) -> TableStyleSpec -> TableStyle LineStyle LineStyle
- data TableStyleSpec = TableStyleSpec {
- headerSep :: LineStyle
- headerTop :: LineStyle
- headerLeft :: LineStyle
- headerRight :: LineStyle
- rowHeaderSep :: LineStyle
- rowHeaderLeft :: LineStyle
- rowHeaderTop :: LineStyle
- rowHeaderBottom :: LineStyle
- bothHeadersTop :: LineStyle
- bothHeadersBottom :: LineStyle
- bothHeadersLeft :: LineStyle
- bothHeadersRight :: LineStyle
- groupLeft :: LineStyle
- groupRight :: LineStyle
- groupTop :: LineStyle
- groupBottom :: LineStyle
- simpleTableStyleSpec :: LineStyle -> LineStyle -> TableStyleSpec
- setTableStyleSpecSeparator :: LineStyle -> TableStyleSpec -> TableStyleSpec
- data TableStyle rowSep colSep = TableStyle {
- headerSepH :: String
- headerSepLC :: String
- headerSepRC :: String
- headerSepC :: colSep -> colSep -> String
- headerTopH :: String
- headerTopL :: String
- headerTopR :: String
- headerTopC :: colSep -> String
- headerL :: String
- headerR :: String
- headerC :: colSep -> String
- rowHeaderSepV :: String
- rowHeaderSepTC :: String
- rowHeaderSepBC :: String
- rowHeaderSepC :: rowSep -> rowSep -> String
- rowHeaderLeftV :: String
- rowHeaderLeftT :: String
- rowHeaderLeftB :: String
- rowHeaderLeftC :: rowSep -> String
- rowHeaderT :: String
- rowHeaderB :: String
- rowHeaderC :: rowSep -> String
- bothHeadersTL :: String
- bothHeadersTR :: String
- bothHeadersBL :: String
- bothHeadersBR :: String
- bothHeadersL :: String
- bothHeadersR :: String
- bothHeadersT :: String
- bothHeadersB :: String
- groupL :: String
- groupR :: String
- groupC :: colSep -> String
- groupSepH :: rowSep -> String
- groupSepC :: rowSep -> colSep -> String
- groupSepLC :: rowSep -> String
- groupSepRC :: rowSep -> String
- groupTopC :: colSep -> String
- groupTopL :: String
- groupTopR :: String
- groupTopH :: String
- groupBottomC :: colSep -> String
- groupBottomL :: String
- groupBottomR :: String
- groupBottomH :: String
Pre-Constructed Table Styles
ASCII
asciiRoundS :: TableStyle LineStyle LineStyle Source #
My usual ASCII table style.
asciiDoubleS :: TableStyle LineStyle LineStyle Source #
Like asciiS
, but uses double lines and double pluses for borders.
Unicode
unicodeS :: TableStyle LineStyle LineStyle Source #
Uses special unicode characters to draw clean thin boxes.
unicodeBoldHeaderS :: TableStyle LineStyle LineStyle Source #
Same as unicodeS
but uses bold headers.
unicodeRoundS :: TableStyle LineStyle LineStyle Source #
Like unicodeS
but with rounded edges.
unicodeBoldS :: TableStyle LineStyle LineStyle Source #
Uses bold lines.
unicodeBoldStripedS :: TableStyle LineStyle LineStyle Source #
Uses bold lines with the exception of group separators, which are striped.
unicodeDoubleFrameS :: TableStyle LineStyle LineStyle Source #
Draw every line with a double frame.
Combinators
withoutBorders :: TableStyle a b -> TableStyle a b Source #
Remove the top, bottom, left, and right borders from a TableStyle
.
withoutTopBorder :: TableStyle a b -> TableStyle a b Source #
Remove the top border from a TableStyle
.
withoutBottomBorder :: TableStyle a b -> TableStyle a b Source #
Remove the bottom border from a TableStyle
.
withoutLeftBorder :: TableStyle a b -> TableStyle a b Source #
Remove the left border from a TableStyle
.
withoutRightBorder :: TableStyle a b -> TableStyle a b Source #
Remove the right border from a TableStyle
.
withRoundCorners :: TableStyle a b -> TableStyle a b Source #
Modify a TableStyle
to use Unicode rounded corners.
:: (c -> a) | The function to transform the row labels. |
-> (d -> b) | The function to transform the column labels. |
-> TableStyle a b | The |
-> TableStyle c d |
Inherit from a TableStyle
through a pair of functions.
inheritStyleHeaderGroup Source #
:: (c -> a) | The function to transform the row labels in the header. |
-> (c -> a) | The function to transform the row labels in the body. |
-> (d -> b) | The function to transform the column labels in the header. |
-> (d -> b) | The function to transform the column labels in the body. |
-> TableStyle a b | The |
-> TableStyle c d |
Inherit from a TableStyle
using a triple of functions, specifying the
correspondence for row separators, column heading separators, and column separators.
Construct Table Styles from an Abstract Specification
tableStyleFromSpec :: (LineStyle -> String) -> (LineStyle -> String) -> (LineStyle -> LineStyle -> LineStyle -> LineStyle -> String) -> TableStyleSpec -> TableStyle LineStyle LineStyle Source #
Generate a 'TableStyle from a given TableStyleSpec
, along with functions
to construct horizontal and vertical lines and joins.
The function for constructing join strings takes its arguments in the order
west, east, north, south.
Construct an Abstract Specifiction
data TableStyleSpec Source #
A short-hand specification for generating Unicode table styles, by specifying the line type of each of the main lines.
simpleTableStyleSpec :: LineStyle -> LineStyle -> TableStyleSpec Source #
Constructs a simple TableStyleSpec
which uses the given LineStyle
s in
the headers and group, respectively.
setTableStyleSpecSeparator :: LineStyle -> TableStyleSpec -> TableStyleSpec Source #
Modify a TableStyleSpec
to use the given LineStyle
for header separators.
Low-Level Styling Facility
data TableStyle rowSep colSep Source #
Specifies the different letters to construct the non-content structure of a table.
This is quite low-level and difficult to construct by hand. If you want to construct your own, you may wish to use the higher-level interface provided by (in increasing order of detail):
TableStyle | |
|