module Text.Layout.Table.Primitives.Table where
import Data.List
import Text.Layout.Table.StringBuilder
import Text.Layout.Table.Spec.Util
hLineDetail
:: StringBuilder b
=> Char
-> Char
-> Char
-> Char
-> Row b
-> b
hLineDetail :: Char -> Char -> Char -> Char -> Row b -> b
hLineDetail Char
hSpace Char
delimL Char
delimM Char
delimR Row b
cells =
Row b -> b
forall a. Monoid a => [a] -> a
mconcat (Row b -> b) -> Row b -> b
forall a b. (a -> b) -> a -> b
$ b -> Row b -> Row b
forall a. a -> [a] -> [a]
intersperse (Char -> b
forall a. StringBuilder a => Char -> a
charB Char
hSpace) (Row b -> Row b) -> Row b -> Row b
forall a b. (a -> b) -> a -> b
$ Char -> b
forall a. StringBuilder a => Char -> a
charB Char
delimL b -> Row b -> Row b
forall a. a -> [a] -> [a]
: b -> Row b -> Row b
forall a. a -> [a] -> [a]
intersperse (Char -> b
forall a. StringBuilder a => Char -> a
charB Char
delimM) Row b
cells Row b -> Row b -> Row b
forall a. [a] -> [a] -> [a]
++ [Char -> b
forall a. StringBuilder a => Char -> a
charB Char
delimR]
hLine
:: StringBuilder b
=> Char
-> Char
-> Row b
-> b
hLine :: Char -> Char -> Row b -> b
hLine Char
hSpace Char
delim = Char -> Char -> Char -> Char -> Row b -> b
forall b.
StringBuilder b =>
Char -> Char -> Char -> Char -> Row b -> b
hLineDetail Char
hSpace Char
delim Char
delim Char
delim
hLineContent
:: StringBuilder b
=> Char
-> Row b
-> b
hLineContent :: Char -> Row b -> b
hLineContent = Char -> Char -> Row b -> b
forall b. StringBuilder b => Char -> Char -> Row b -> b
hLine Char
' '