{-# LANGUAGE OverloadedLists #-} {-# OPTIONS_GHC -Wno-orphans #-} module Literate.Document.Table where import Data.List qualified as List import Literate.Document.Type import Literate.Prelude table = Table { tableHeads = Nothing , tableTemplate = [] , tableRowsEvenOdd = False , tableRows = [] } tableTemplateFinal :: Table -> TableTemplate tableTemplateFinal tbl | tbl & tableTemplate & null = 1 & fr & LengthRelative & List.replicate columns | otherwise = tbl & tableTemplate where columns :: Int columns = maximum [ row & tableRowColumns & List.length | row <- tbl & tableRows ] tableRow = TableRow { tableRowColumns = [] } tableCell = TableCell { tableCellContent = "" , tableCellJustify = JustificationCenter } dict = Dict { dictEntries = [] }