gridtables-0.1.0.0: Parser for reStructuredText-style grid tables.
Copyright© 2022 RStudio PBC
LicenseMIT
MaintainerAlbert Krewinkel <albert@zeitkraut.de>
Safe HaskellNone
LanguageHaskell2010

Text.GridTable.ArrayTable

Description

Grid table representation based on arrays.

Synopsis

Documentation

data ArrayTable a Source #

Table representation based on an array; cells are placed on a grid, with indices spanned by other cells containing placeholder cells that point to the spanning cell.

Constructors

ArrayTable 

Instances

Instances details
Show a => Show (ArrayTable a) Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Methods

showsPrec :: Int -> ArrayTable a -> ShowS

show :: ArrayTable a -> String

showList :: [ArrayTable a] -> ShowS

Eq a => Eq (ArrayTable a) Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Methods

(==) :: ArrayTable a -> ArrayTable a -> Bool

(/=) :: ArrayTable a -> ArrayTable a -> Bool

data GridCell a Source #

A grid cell contains either a real table cell, or is the continuation of a column or row-spanning cell. In the latter case, the index of the continued cell is provided.

Instances

Instances details
Show a => Show (GridCell a) Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Methods

showsPrec :: Int -> GridCell a -> ShowS

show :: GridCell a -> String

showList :: [GridCell a] -> ShowS

Eq a => Eq (GridCell a) Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Methods

(==) :: GridCell a -> GridCell a -> Bool

(/=) :: GridCell a -> GridCell a -> Bool

newtype RowSpan Source #

The number of rows spanned by a cell.

Constructors

RowSpan Int 

Instances

Instances details
Enum RowSpan Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Num RowSpan Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Read RowSpan Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Methods

readsPrec :: Int -> ReadS RowSpan

readList :: ReadS [RowSpan]

readPrec :: ReadPrec RowSpan

readListPrec :: ReadPrec [RowSpan]

Show RowSpan Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Methods

showsPrec :: Int -> RowSpan -> ShowS

show :: RowSpan -> String

showList :: [RowSpan] -> ShowS

Eq RowSpan Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Methods

(==) :: RowSpan -> RowSpan -> Bool

(/=) :: RowSpan -> RowSpan -> Bool

Ord RowSpan Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Methods

compare :: RowSpan -> RowSpan -> Ordering

(<) :: RowSpan -> RowSpan -> Bool

(<=) :: RowSpan -> RowSpan -> Bool

(>) :: RowSpan -> RowSpan -> Bool

(>=) :: RowSpan -> RowSpan -> Bool

max :: RowSpan -> RowSpan -> RowSpan

min :: RowSpan -> RowSpan -> RowSpan

newtype ColSpan Source #

The number of columns spanned by a cell.

Constructors

ColSpan Int 

Instances

Instances details
Enum ColSpan Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Num ColSpan Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Read ColSpan Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Methods

readsPrec :: Int -> ReadS ColSpan

readList :: ReadS [ColSpan]

readPrec :: ReadPrec ColSpan

readListPrec :: ReadPrec [ColSpan]

Show ColSpan Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Methods

showsPrec :: Int -> ColSpan -> ShowS

show :: ColSpan -> String

showList :: [ColSpan] -> ShowS

Eq ColSpan Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Methods

(==) :: ColSpan -> ColSpan -> Bool

(/=) :: ColSpan -> ColSpan -> Bool

Ord ColSpan Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Methods

compare :: ColSpan -> ColSpan -> Ordering

(<) :: ColSpan -> ColSpan -> Bool

(<=) :: ColSpan -> ColSpan -> Bool

(>) :: ColSpan -> ColSpan -> Bool

(>=) :: ColSpan -> ColSpan -> Bool

max :: ColSpan -> ColSpan -> ColSpan

min :: ColSpan -> ColSpan -> ColSpan

type CellIndex = (RowIndex, ColIndex) Source #

Index to a cell in a table part.

newtype RowIndex Source #

Row index in a table array.

Constructors

RowIndex 

Fields

Instances

Instances details
Enum RowIndex Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Ix RowIndex Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Num RowIndex Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Show RowIndex Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Methods

showsPrec :: Int -> RowIndex -> ShowS

show :: RowIndex -> String

showList :: [RowIndex] -> ShowS

Eq RowIndex Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Methods

(==) :: RowIndex -> RowIndex -> Bool

(/=) :: RowIndex -> RowIndex -> Bool

Ord RowIndex Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Methods

compare :: RowIndex -> RowIndex -> Ordering

(<) :: RowIndex -> RowIndex -> Bool

(<=) :: RowIndex -> RowIndex -> Bool

(>) :: RowIndex -> RowIndex -> Bool

(>=) :: RowIndex -> RowIndex -> Bool

max :: RowIndex -> RowIndex -> RowIndex

min :: RowIndex -> RowIndex -> RowIndex

newtype ColIndex Source #

Column index in a table array.

Constructors

ColIndex 

Fields

Instances

Instances details
Enum ColIndex Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Ix ColIndex Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Num ColIndex Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Show ColIndex Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Methods

showsPrec :: Int -> ColIndex -> ShowS

show :: ColIndex -> String

showList :: [ColIndex] -> ShowS

Eq ColIndex Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Methods

(==) :: ColIndex -> ColIndex -> Bool

(/=) :: ColIndex -> ColIndex -> Bool

Ord ColIndex Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Methods

compare :: ColIndex -> ColIndex -> Ordering

(<) :: ColIndex -> ColIndex -> Bool

(<=) :: ColIndex -> ColIndex -> Bool

(>) :: ColIndex -> ColIndex -> Bool

(>=) :: ColIndex -> ColIndex -> Bool

max :: ColIndex -> ColIndex -> ColIndex

min :: ColIndex -> ColIndex -> ColIndex

data Alignment Source #

Cell alignment

Instances

Instances details
Enum Alignment Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Read Alignment Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Methods

readsPrec :: Int -> ReadS Alignment

readList :: ReadS [Alignment]

readPrec :: ReadPrec Alignment

readListPrec :: ReadPrec [Alignment]

Show Alignment Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Methods

showsPrec :: Int -> Alignment -> ShowS

show :: Alignment -> String

showList :: [Alignment] -> ShowS

Eq Alignment Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Methods

(==) :: Alignment -> Alignment -> Bool

(/=) :: Alignment -> Alignment -> Bool

Ord Alignment Source # 
Instance details

Defined in Text.GridTable.ArrayTable

Methods

compare :: Alignment -> Alignment -> Ordering

(<) :: Alignment -> Alignment -> Bool

(<=) :: Alignment -> Alignment -> Bool

(>) :: Alignment -> Alignment -> Bool

(>=) :: Alignment -> Alignment -> Bool

max :: Alignment -> Alignment -> Alignment

min :: Alignment -> Alignment -> Alignment

mapCells :: (a -> b) -> ArrayTable a -> ArrayTable b Source #

Apply a function to all cell contents in a grid table.