{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE TupleSections #-}

{- |
   Module      : Text.Pandoc.Writers.AnnotatedTable
   Copyright   : Copyright 2020 Christian Despres
   License     : GNU GPL, version 2 or above

   Maintainer  : Christian Despres <christian.j.j.despres@gmail.com>
   Stability   : alpha
   Portability : portable

Definitions and conversion functions for an intermediate 'Table' and
related types, which annotates the existing Pandoc 'B.Table' types
with additional inferred information. For use in writers that need to
know the details of columns that cells span, row numbers, and the
cells that are in the row head.
-}

module Text.Pandoc.Writers.AnnotatedTable
  ( toTable
  , fromTable
  , Table(..)
  , TableHead(..)
  , TableBody(..)
  , TableFoot(..)
  , HeaderRow(..)
  , BodyRow(..)
  , RowNumber(..)
  , RowHead
  , RowBody
  , Cell(..)
  , ColNumber(..)
  )
where

import           Control.Monad.RWS.Strict
                                         hiding ( (<>) )
import           Data.Generics                  ( Data
                                                , Typeable
                                                )
import           Data.List.NonEmpty             ( NonEmpty(..) )
import           GHC.Generics                   ( Generic )
import qualified Text.Pandoc.Builder           as B

-- | An annotated table type, corresponding to the Pandoc 'B.Table'
-- constructor and the HTML @\<table\>@ element. It records the data
-- of the columns that cells span, the cells in the row head, the row
-- numbers of rows, and the column numbers of cells, in addition to
-- the data in a 'B.Table'. The type itself does not enforce any
-- guarantees about the consistency of this data. Use 'toTable' to
-- produce a 'Table' from a Pandoc 'B.Table'.
data Table = Table B.Attr B.Caption [B.ColSpec] TableHead [TableBody] TableFoot
  deriving (Table -> Table -> Bool
(Table -> Table -> Bool) -> (Table -> Table -> Bool) -> Eq Table
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Table -> Table -> Bool
$c/= :: Table -> Table -> Bool
== :: Table -> Table -> Bool
$c== :: Table -> Table -> Bool
Eq, Eq Table
Eq Table
-> (Table -> Table -> Ordering)
-> (Table -> Table -> Bool)
-> (Table -> Table -> Bool)
-> (Table -> Table -> Bool)
-> (Table -> Table -> Bool)
-> (Table -> Table -> Table)
-> (Table -> Table -> Table)
-> Ord Table
Table -> Table -> Bool
Table -> Table -> Ordering
Table -> Table -> Table
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Table -> Table -> Table
$cmin :: Table -> Table -> Table
max :: Table -> Table -> Table
$cmax :: Table -> Table -> Table
>= :: Table -> Table -> Bool
$c>= :: Table -> Table -> Bool
> :: Table -> Table -> Bool
$c> :: Table -> Table -> Bool
<= :: Table -> Table -> Bool
$c<= :: Table -> Table -> Bool
< :: Table -> Table -> Bool
$c< :: Table -> Table -> Bool
compare :: Table -> Table -> Ordering
$ccompare :: Table -> Table -> Ordering
$cp1Ord :: Eq Table
Ord, ReadPrec [Table]
ReadPrec Table
Int -> ReadS Table
ReadS [Table]
(Int -> ReadS Table)
-> ReadS [Table]
-> ReadPrec Table
-> ReadPrec [Table]
-> Read Table
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Table]
$creadListPrec :: ReadPrec [Table]
readPrec :: ReadPrec Table
$creadPrec :: ReadPrec Table
readList :: ReadS [Table]
$creadList :: ReadS [Table]
readsPrec :: Int -> ReadS Table
$creadsPrec :: Int -> ReadS Table
Read, Int -> Table -> ShowS
[Table] -> ShowS
Table -> String
(Int -> Table -> ShowS)
-> (Table -> String) -> ([Table] -> ShowS) -> Show Table
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Table] -> ShowS
$cshowList :: [Table] -> ShowS
show :: Table -> String
$cshow :: Table -> String
showsPrec :: Int -> Table -> ShowS
$cshowsPrec :: Int -> Table -> ShowS
Show, Typeable, Typeable Table
DataType
Constr
Typeable Table
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Table -> c Table)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Table)
-> (Table -> Constr)
-> (Table -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Table))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Table))
-> ((forall b. Data b => b -> b) -> Table -> Table)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Table -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Table -> r)
-> (forall u. (forall d. Data d => d -> u) -> Table -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Table -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Table -> m Table)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Table -> m Table)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Table -> m Table)
-> Data Table
Table -> DataType
Table -> Constr
(forall b. Data b => b -> b) -> Table -> Table
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Table -> c Table
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Table
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Table -> u
forall u. (forall d. Data d => d -> u) -> Table -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Table -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Table -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Table -> m Table
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Table -> m Table
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Table
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Table -> c Table
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Table)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Table)
$cTable :: Constr
$tTable :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Table -> m Table
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Table -> m Table
gmapMp :: (forall d. Data d => d -> m d) -> Table -> m Table
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Table -> m Table
gmapM :: (forall d. Data d => d -> m d) -> Table -> m Table
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Table -> m Table
gmapQi :: Int -> (forall d. Data d => d -> u) -> Table -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Table -> u
gmapQ :: (forall d. Data d => d -> u) -> Table -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Table -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Table -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Table -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Table -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Table -> r
gmapT :: (forall b. Data b => b -> b) -> Table -> Table
$cgmapT :: (forall b. Data b => b -> b) -> Table -> Table
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Table)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Table)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Table)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Table)
dataTypeOf :: Table -> DataType
$cdataTypeOf :: Table -> DataType
toConstr :: Table -> Constr
$ctoConstr :: Table -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Table
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Table
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Table -> c Table
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Table -> c Table
$cp1Data :: Typeable Table
Data, (forall x. Table -> Rep Table x)
-> (forall x. Rep Table x -> Table) -> Generic Table
forall x. Rep Table x -> Table
forall x. Table -> Rep Table x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Table x -> Table
$cfrom :: forall x. Table -> Rep Table x
Generic)

-- | An annotated table head, corresponding to a Pandoc 'B.TableHead'
-- and the HTML @\<thead\>@ element.
data TableHead = TableHead B.Attr [HeaderRow]
  deriving (TableHead -> TableHead -> Bool
(TableHead -> TableHead -> Bool)
-> (TableHead -> TableHead -> Bool) -> Eq TableHead
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TableHead -> TableHead -> Bool
$c/= :: TableHead -> TableHead -> Bool
== :: TableHead -> TableHead -> Bool
$c== :: TableHead -> TableHead -> Bool
Eq, Eq TableHead
Eq TableHead
-> (TableHead -> TableHead -> Ordering)
-> (TableHead -> TableHead -> Bool)
-> (TableHead -> TableHead -> Bool)
-> (TableHead -> TableHead -> Bool)
-> (TableHead -> TableHead -> Bool)
-> (TableHead -> TableHead -> TableHead)
-> (TableHead -> TableHead -> TableHead)
-> Ord TableHead
TableHead -> TableHead -> Bool
TableHead -> TableHead -> Ordering
TableHead -> TableHead -> TableHead
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: TableHead -> TableHead -> TableHead
$cmin :: TableHead -> TableHead -> TableHead
max :: TableHead -> TableHead -> TableHead
$cmax :: TableHead -> TableHead -> TableHead
>= :: TableHead -> TableHead -> Bool
$c>= :: TableHead -> TableHead -> Bool
> :: TableHead -> TableHead -> Bool
$c> :: TableHead -> TableHead -> Bool
<= :: TableHead -> TableHead -> Bool
$c<= :: TableHead -> TableHead -> Bool
< :: TableHead -> TableHead -> Bool
$c< :: TableHead -> TableHead -> Bool
compare :: TableHead -> TableHead -> Ordering
$ccompare :: TableHead -> TableHead -> Ordering
$cp1Ord :: Eq TableHead
Ord, ReadPrec [TableHead]
ReadPrec TableHead
Int -> ReadS TableHead
ReadS [TableHead]
(Int -> ReadS TableHead)
-> ReadS [TableHead]
-> ReadPrec TableHead
-> ReadPrec [TableHead]
-> Read TableHead
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TableHead]
$creadListPrec :: ReadPrec [TableHead]
readPrec :: ReadPrec TableHead
$creadPrec :: ReadPrec TableHead
readList :: ReadS [TableHead]
$creadList :: ReadS [TableHead]
readsPrec :: Int -> ReadS TableHead
$creadsPrec :: Int -> ReadS TableHead
Read, Int -> TableHead -> ShowS
[TableHead] -> ShowS
TableHead -> String
(Int -> TableHead -> ShowS)
-> (TableHead -> String)
-> ([TableHead] -> ShowS)
-> Show TableHead
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TableHead] -> ShowS
$cshowList :: [TableHead] -> ShowS
show :: TableHead -> String
$cshow :: TableHead -> String
showsPrec :: Int -> TableHead -> ShowS
$cshowsPrec :: Int -> TableHead -> ShowS
Show, Typeable, Typeable TableHead
DataType
Constr
Typeable TableHead
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> TableHead -> c TableHead)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c TableHead)
-> (TableHead -> Constr)
-> (TableHead -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c TableHead))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TableHead))
-> ((forall b. Data b => b -> b) -> TableHead -> TableHead)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> TableHead -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> TableHead -> r)
-> (forall u. (forall d. Data d => d -> u) -> TableHead -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> TableHead -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> TableHead -> m TableHead)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> TableHead -> m TableHead)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> TableHead -> m TableHead)
-> Data TableHead
TableHead -> DataType
TableHead -> Constr
(forall b. Data b => b -> b) -> TableHead -> TableHead
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TableHead -> c TableHead
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TableHead
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> TableHead -> u
forall u. (forall d. Data d => d -> u) -> TableHead -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TableHead -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TableHead -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TableHead -> m TableHead
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TableHead -> m TableHead
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TableHead
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TableHead -> c TableHead
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TableHead)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TableHead)
$cTableHead :: Constr
$tTableHead :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> TableHead -> m TableHead
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TableHead -> m TableHead
gmapMp :: (forall d. Data d => d -> m d) -> TableHead -> m TableHead
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TableHead -> m TableHead
gmapM :: (forall d. Data d => d -> m d) -> TableHead -> m TableHead
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TableHead -> m TableHead
gmapQi :: Int -> (forall d. Data d => d -> u) -> TableHead -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> TableHead -> u
gmapQ :: (forall d. Data d => d -> u) -> TableHead -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> TableHead -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TableHead -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TableHead -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TableHead -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TableHead -> r
gmapT :: (forall b. Data b => b -> b) -> TableHead -> TableHead
$cgmapT :: (forall b. Data b => b -> b) -> TableHead -> TableHead
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TableHead)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TableHead)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c TableHead)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TableHead)
dataTypeOf :: TableHead -> DataType
$cdataTypeOf :: TableHead -> DataType
toConstr :: TableHead -> Constr
$ctoConstr :: TableHead -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TableHead
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TableHead
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TableHead -> c TableHead
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TableHead -> c TableHead
$cp1Data :: Typeable TableHead
Data, (forall x. TableHead -> Rep TableHead x)
-> (forall x. Rep TableHead x -> TableHead) -> Generic TableHead
forall x. Rep TableHead x -> TableHead
forall x. TableHead -> Rep TableHead x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TableHead x -> TableHead
$cfrom :: forall x. TableHead -> Rep TableHead x
Generic)

-- | An annotated table body, with an intermediate head and body,
-- corresponding to a Pandoc 'B.TableBody' and the HTML @\<tbody\>@
-- element.
data TableBody = TableBody B.Attr B.RowHeadColumns [HeaderRow] [BodyRow]
  deriving (TableBody -> TableBody -> Bool
(TableBody -> TableBody -> Bool)
-> (TableBody -> TableBody -> Bool) -> Eq TableBody
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TableBody -> TableBody -> Bool
$c/= :: TableBody -> TableBody -> Bool
== :: TableBody -> TableBody -> Bool
$c== :: TableBody -> TableBody -> Bool
Eq, Eq TableBody
Eq TableBody
-> (TableBody -> TableBody -> Ordering)
-> (TableBody -> TableBody -> Bool)
-> (TableBody -> TableBody -> Bool)
-> (TableBody -> TableBody -> Bool)
-> (TableBody -> TableBody -> Bool)
-> (TableBody -> TableBody -> TableBody)
-> (TableBody -> TableBody -> TableBody)
-> Ord TableBody
TableBody -> TableBody -> Bool
TableBody -> TableBody -> Ordering
TableBody -> TableBody -> TableBody
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: TableBody -> TableBody -> TableBody
$cmin :: TableBody -> TableBody -> TableBody
max :: TableBody -> TableBody -> TableBody
$cmax :: TableBody -> TableBody -> TableBody
>= :: TableBody -> TableBody -> Bool
$c>= :: TableBody -> TableBody -> Bool
> :: TableBody -> TableBody -> Bool
$c> :: TableBody -> TableBody -> Bool
<= :: TableBody -> TableBody -> Bool
$c<= :: TableBody -> TableBody -> Bool
< :: TableBody -> TableBody -> Bool
$c< :: TableBody -> TableBody -> Bool
compare :: TableBody -> TableBody -> Ordering
$ccompare :: TableBody -> TableBody -> Ordering
$cp1Ord :: Eq TableBody
Ord, ReadPrec [TableBody]
ReadPrec TableBody
Int -> ReadS TableBody
ReadS [TableBody]
(Int -> ReadS TableBody)
-> ReadS [TableBody]
-> ReadPrec TableBody
-> ReadPrec [TableBody]
-> Read TableBody
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TableBody]
$creadListPrec :: ReadPrec [TableBody]
readPrec :: ReadPrec TableBody
$creadPrec :: ReadPrec TableBody
readList :: ReadS [TableBody]
$creadList :: ReadS [TableBody]
readsPrec :: Int -> ReadS TableBody
$creadsPrec :: Int -> ReadS TableBody
Read, Int -> TableBody -> ShowS
[TableBody] -> ShowS
TableBody -> String
(Int -> TableBody -> ShowS)
-> (TableBody -> String)
-> ([TableBody] -> ShowS)
-> Show TableBody
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TableBody] -> ShowS
$cshowList :: [TableBody] -> ShowS
show :: TableBody -> String
$cshow :: TableBody -> String
showsPrec :: Int -> TableBody -> ShowS
$cshowsPrec :: Int -> TableBody -> ShowS
Show, Typeable, Typeable TableBody
DataType
Constr
Typeable TableBody
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> TableBody -> c TableBody)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c TableBody)
-> (TableBody -> Constr)
-> (TableBody -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c TableBody))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TableBody))
-> ((forall b. Data b => b -> b) -> TableBody -> TableBody)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> TableBody -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> TableBody -> r)
-> (forall u. (forall d. Data d => d -> u) -> TableBody -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> TableBody -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> TableBody -> m TableBody)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> TableBody -> m TableBody)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> TableBody -> m TableBody)
-> Data TableBody
TableBody -> DataType
TableBody -> Constr
(forall b. Data b => b -> b) -> TableBody -> TableBody
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TableBody -> c TableBody
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TableBody
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> TableBody -> u
forall u. (forall d. Data d => d -> u) -> TableBody -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TableBody -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TableBody -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TableBody -> m TableBody
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TableBody -> m TableBody
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TableBody
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TableBody -> c TableBody
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TableBody)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TableBody)
$cTableBody :: Constr
$tTableBody :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> TableBody -> m TableBody
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TableBody -> m TableBody
gmapMp :: (forall d. Data d => d -> m d) -> TableBody -> m TableBody
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TableBody -> m TableBody
gmapM :: (forall d. Data d => d -> m d) -> TableBody -> m TableBody
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TableBody -> m TableBody
gmapQi :: Int -> (forall d. Data d => d -> u) -> TableBody -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> TableBody -> u
gmapQ :: (forall d. Data d => d -> u) -> TableBody -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> TableBody -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TableBody -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TableBody -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TableBody -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TableBody -> r
gmapT :: (forall b. Data b => b -> b) -> TableBody -> TableBody
$cgmapT :: (forall b. Data b => b -> b) -> TableBody -> TableBody
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TableBody)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TableBody)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c TableBody)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TableBody)
dataTypeOf :: TableBody -> DataType
$cdataTypeOf :: TableBody -> DataType
toConstr :: TableBody -> Constr
$ctoConstr :: TableBody -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TableBody
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TableBody
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TableBody -> c TableBody
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TableBody -> c TableBody
$cp1Data :: Typeable TableBody
Data, (forall x. TableBody -> Rep TableBody x)
-> (forall x. Rep TableBody x -> TableBody) -> Generic TableBody
forall x. Rep TableBody x -> TableBody
forall x. TableBody -> Rep TableBody x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TableBody x -> TableBody
$cfrom :: forall x. TableBody -> Rep TableBody x
Generic)

-- | An annotated table foot, corresponding to a Pandoc 'B.TableFoot'
-- and the HTML @\<tfoot\>@ element.
data TableFoot = TableFoot B.Attr [HeaderRow]
  deriving (TableFoot -> TableFoot -> Bool
(TableFoot -> TableFoot -> Bool)
-> (TableFoot -> TableFoot -> Bool) -> Eq TableFoot
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TableFoot -> TableFoot -> Bool
$c/= :: TableFoot -> TableFoot -> Bool
== :: TableFoot -> TableFoot -> Bool
$c== :: TableFoot -> TableFoot -> Bool
Eq, Eq TableFoot
Eq TableFoot
-> (TableFoot -> TableFoot -> Ordering)
-> (TableFoot -> TableFoot -> Bool)
-> (TableFoot -> TableFoot -> Bool)
-> (TableFoot -> TableFoot -> Bool)
-> (TableFoot -> TableFoot -> Bool)
-> (TableFoot -> TableFoot -> TableFoot)
-> (TableFoot -> TableFoot -> TableFoot)
-> Ord TableFoot
TableFoot -> TableFoot -> Bool
TableFoot -> TableFoot -> Ordering
TableFoot -> TableFoot -> TableFoot
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: TableFoot -> TableFoot -> TableFoot
$cmin :: TableFoot -> TableFoot -> TableFoot
max :: TableFoot -> TableFoot -> TableFoot
$cmax :: TableFoot -> TableFoot -> TableFoot
>= :: TableFoot -> TableFoot -> Bool
$c>= :: TableFoot -> TableFoot -> Bool
> :: TableFoot -> TableFoot -> Bool
$c> :: TableFoot -> TableFoot -> Bool
<= :: TableFoot -> TableFoot -> Bool
$c<= :: TableFoot -> TableFoot -> Bool
< :: TableFoot -> TableFoot -> Bool
$c< :: TableFoot -> TableFoot -> Bool
compare :: TableFoot -> TableFoot -> Ordering
$ccompare :: TableFoot -> TableFoot -> Ordering
$cp1Ord :: Eq TableFoot
Ord, ReadPrec [TableFoot]
ReadPrec TableFoot
Int -> ReadS TableFoot
ReadS [TableFoot]
(Int -> ReadS TableFoot)
-> ReadS [TableFoot]
-> ReadPrec TableFoot
-> ReadPrec [TableFoot]
-> Read TableFoot
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TableFoot]
$creadListPrec :: ReadPrec [TableFoot]
readPrec :: ReadPrec TableFoot
$creadPrec :: ReadPrec TableFoot
readList :: ReadS [TableFoot]
$creadList :: ReadS [TableFoot]
readsPrec :: Int -> ReadS TableFoot
$creadsPrec :: Int -> ReadS TableFoot
Read, Int -> TableFoot -> ShowS
[TableFoot] -> ShowS
TableFoot -> String
(Int -> TableFoot -> ShowS)
-> (TableFoot -> String)
-> ([TableFoot] -> ShowS)
-> Show TableFoot
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TableFoot] -> ShowS
$cshowList :: [TableFoot] -> ShowS
show :: TableFoot -> String
$cshow :: TableFoot -> String
showsPrec :: Int -> TableFoot -> ShowS
$cshowsPrec :: Int -> TableFoot -> ShowS
Show, Typeable, Typeable TableFoot
DataType
Constr
Typeable TableFoot
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> TableFoot -> c TableFoot)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c TableFoot)
-> (TableFoot -> Constr)
-> (TableFoot -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c TableFoot))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TableFoot))
-> ((forall b. Data b => b -> b) -> TableFoot -> TableFoot)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> TableFoot -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> TableFoot -> r)
-> (forall u. (forall d. Data d => d -> u) -> TableFoot -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> TableFoot -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> TableFoot -> m TableFoot)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> TableFoot -> m TableFoot)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> TableFoot -> m TableFoot)
-> Data TableFoot
TableFoot -> DataType
TableFoot -> Constr
(forall b. Data b => b -> b) -> TableFoot -> TableFoot
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TableFoot -> c TableFoot
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TableFoot
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> TableFoot -> u
forall u. (forall d. Data d => d -> u) -> TableFoot -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TableFoot -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TableFoot -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TableFoot -> m TableFoot
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TableFoot -> m TableFoot
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TableFoot
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TableFoot -> c TableFoot
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TableFoot)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TableFoot)
$cTableFoot :: Constr
$tTableFoot :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> TableFoot -> m TableFoot
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TableFoot -> m TableFoot
gmapMp :: (forall d. Data d => d -> m d) -> TableFoot -> m TableFoot
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TableFoot -> m TableFoot
gmapM :: (forall d. Data d => d -> m d) -> TableFoot -> m TableFoot
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TableFoot -> m TableFoot
gmapQi :: Int -> (forall d. Data d => d -> u) -> TableFoot -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> TableFoot -> u
gmapQ :: (forall d. Data d => d -> u) -> TableFoot -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> TableFoot -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TableFoot -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TableFoot -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TableFoot -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TableFoot -> r
gmapT :: (forall b. Data b => b -> b) -> TableFoot -> TableFoot
$cgmapT :: (forall b. Data b => b -> b) -> TableFoot -> TableFoot
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TableFoot)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TableFoot)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c TableFoot)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TableFoot)
dataTypeOf :: TableFoot -> DataType
$cdataTypeOf :: TableFoot -> DataType
toConstr :: TableFoot -> Constr
$ctoConstr :: TableFoot -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TableFoot
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TableFoot
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TableFoot -> c TableFoot
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TableFoot -> c TableFoot
$cp1Data :: Typeable TableFoot
Data, (forall x. TableFoot -> Rep TableFoot x)
-> (forall x. Rep TableFoot x -> TableFoot) -> Generic TableFoot
forall x. Rep TableFoot x -> TableFoot
forall x. TableFoot -> Rep TableFoot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TableFoot x -> TableFoot
$cfrom :: forall x. TableFoot -> Rep TableFoot x
Generic)

-- | An annotated header row, corresponding to a Pandoc 'B.Row' and
-- the HTML @\<tr\>@ element, and also recording the row number of the
-- row. All the cells in a 'HeaderRow' are header (@\<th\>@) cells.
data HeaderRow = HeaderRow B.Attr RowNumber [Cell]
  deriving (HeaderRow -> HeaderRow -> Bool
(HeaderRow -> HeaderRow -> Bool)
-> (HeaderRow -> HeaderRow -> Bool) -> Eq HeaderRow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HeaderRow -> HeaderRow -> Bool
$c/= :: HeaderRow -> HeaderRow -> Bool
== :: HeaderRow -> HeaderRow -> Bool
$c== :: HeaderRow -> HeaderRow -> Bool
Eq, Eq HeaderRow
Eq HeaderRow
-> (HeaderRow -> HeaderRow -> Ordering)
-> (HeaderRow -> HeaderRow -> Bool)
-> (HeaderRow -> HeaderRow -> Bool)
-> (HeaderRow -> HeaderRow -> Bool)
-> (HeaderRow -> HeaderRow -> Bool)
-> (HeaderRow -> HeaderRow -> HeaderRow)
-> (HeaderRow -> HeaderRow -> HeaderRow)
-> Ord HeaderRow
HeaderRow -> HeaderRow -> Bool
HeaderRow -> HeaderRow -> Ordering
HeaderRow -> HeaderRow -> HeaderRow
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: HeaderRow -> HeaderRow -> HeaderRow
$cmin :: HeaderRow -> HeaderRow -> HeaderRow
max :: HeaderRow -> HeaderRow -> HeaderRow
$cmax :: HeaderRow -> HeaderRow -> HeaderRow
>= :: HeaderRow -> HeaderRow -> Bool
$c>= :: HeaderRow -> HeaderRow -> Bool
> :: HeaderRow -> HeaderRow -> Bool
$c> :: HeaderRow -> HeaderRow -> Bool
<= :: HeaderRow -> HeaderRow -> Bool
$c<= :: HeaderRow -> HeaderRow -> Bool
< :: HeaderRow -> HeaderRow -> Bool
$c< :: HeaderRow -> HeaderRow -> Bool
compare :: HeaderRow -> HeaderRow -> Ordering
$ccompare :: HeaderRow -> HeaderRow -> Ordering
$cp1Ord :: Eq HeaderRow
Ord, ReadPrec [HeaderRow]
ReadPrec HeaderRow
Int -> ReadS HeaderRow
ReadS [HeaderRow]
(Int -> ReadS HeaderRow)
-> ReadS [HeaderRow]
-> ReadPrec HeaderRow
-> ReadPrec [HeaderRow]
-> Read HeaderRow
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HeaderRow]
$creadListPrec :: ReadPrec [HeaderRow]
readPrec :: ReadPrec HeaderRow
$creadPrec :: ReadPrec HeaderRow
readList :: ReadS [HeaderRow]
$creadList :: ReadS [HeaderRow]
readsPrec :: Int -> ReadS HeaderRow
$creadsPrec :: Int -> ReadS HeaderRow
Read, Int -> HeaderRow -> ShowS
[HeaderRow] -> ShowS
HeaderRow -> String
(Int -> HeaderRow -> ShowS)
-> (HeaderRow -> String)
-> ([HeaderRow] -> ShowS)
-> Show HeaderRow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HeaderRow] -> ShowS
$cshowList :: [HeaderRow] -> ShowS
show :: HeaderRow -> String
$cshow :: HeaderRow -> String
showsPrec :: Int -> HeaderRow -> ShowS
$cshowsPrec :: Int -> HeaderRow -> ShowS
Show, Typeable, Typeable HeaderRow
DataType
Constr
Typeable HeaderRow
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> HeaderRow -> c HeaderRow)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c HeaderRow)
-> (HeaderRow -> Constr)
-> (HeaderRow -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c HeaderRow))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HeaderRow))
-> ((forall b. Data b => b -> b) -> HeaderRow -> HeaderRow)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> HeaderRow -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> HeaderRow -> r)
-> (forall u. (forall d. Data d => d -> u) -> HeaderRow -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> HeaderRow -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> HeaderRow -> m HeaderRow)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> HeaderRow -> m HeaderRow)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> HeaderRow -> m HeaderRow)
-> Data HeaderRow
HeaderRow -> DataType
HeaderRow -> Constr
(forall b. Data b => b -> b) -> HeaderRow -> HeaderRow
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HeaderRow -> c HeaderRow
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HeaderRow
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> HeaderRow -> u
forall u. (forall d. Data d => d -> u) -> HeaderRow -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HeaderRow -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HeaderRow -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> HeaderRow -> m HeaderRow
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HeaderRow -> m HeaderRow
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HeaderRow
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HeaderRow -> c HeaderRow
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c HeaderRow)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HeaderRow)
$cHeaderRow :: Constr
$tHeaderRow :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> HeaderRow -> m HeaderRow
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HeaderRow -> m HeaderRow
gmapMp :: (forall d. Data d => d -> m d) -> HeaderRow -> m HeaderRow
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HeaderRow -> m HeaderRow
gmapM :: (forall d. Data d => d -> m d) -> HeaderRow -> m HeaderRow
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> HeaderRow -> m HeaderRow
gmapQi :: Int -> (forall d. Data d => d -> u) -> HeaderRow -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> HeaderRow -> u
gmapQ :: (forall d. Data d => d -> u) -> HeaderRow -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> HeaderRow -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HeaderRow -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HeaderRow -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HeaderRow -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HeaderRow -> r
gmapT :: (forall b. Data b => b -> b) -> HeaderRow -> HeaderRow
$cgmapT :: (forall b. Data b => b -> b) -> HeaderRow -> HeaderRow
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HeaderRow)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HeaderRow)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c HeaderRow)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c HeaderRow)
dataTypeOf :: HeaderRow -> DataType
$cdataTypeOf :: HeaderRow -> DataType
toConstr :: HeaderRow -> Constr
$ctoConstr :: HeaderRow -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HeaderRow
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HeaderRow
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HeaderRow -> c HeaderRow
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HeaderRow -> c HeaderRow
$cp1Data :: Typeable HeaderRow
Data, (forall x. HeaderRow -> Rep HeaderRow x)
-> (forall x. Rep HeaderRow x -> HeaderRow) -> Generic HeaderRow
forall x. Rep HeaderRow x -> HeaderRow
forall x. HeaderRow -> Rep HeaderRow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HeaderRow x -> HeaderRow
$cfrom :: forall x. HeaderRow -> Rep HeaderRow x
Generic)

-- | An annotated body row, corresponding to a Pandoc 'B.Row' and the
-- HTML @\<tr\>@ element, and also recording its row number and
-- separating the row head cells from the row body cells.
data BodyRow = BodyRow B.Attr RowNumber RowHead RowBody
  deriving (BodyRow -> BodyRow -> Bool
(BodyRow -> BodyRow -> Bool)
-> (BodyRow -> BodyRow -> Bool) -> Eq BodyRow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BodyRow -> BodyRow -> Bool
$c/= :: BodyRow -> BodyRow -> Bool
== :: BodyRow -> BodyRow -> Bool
$c== :: BodyRow -> BodyRow -> Bool
Eq, Eq BodyRow
Eq BodyRow
-> (BodyRow -> BodyRow -> Ordering)
-> (BodyRow -> BodyRow -> Bool)
-> (BodyRow -> BodyRow -> Bool)
-> (BodyRow -> BodyRow -> Bool)
-> (BodyRow -> BodyRow -> Bool)
-> (BodyRow -> BodyRow -> BodyRow)
-> (BodyRow -> BodyRow -> BodyRow)
-> Ord BodyRow
BodyRow -> BodyRow -> Bool
BodyRow -> BodyRow -> Ordering
BodyRow -> BodyRow -> BodyRow
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: BodyRow -> BodyRow -> BodyRow
$cmin :: BodyRow -> BodyRow -> BodyRow
max :: BodyRow -> BodyRow -> BodyRow
$cmax :: BodyRow -> BodyRow -> BodyRow
>= :: BodyRow -> BodyRow -> Bool
$c>= :: BodyRow -> BodyRow -> Bool
> :: BodyRow -> BodyRow -> Bool
$c> :: BodyRow -> BodyRow -> Bool
<= :: BodyRow -> BodyRow -> Bool
$c<= :: BodyRow -> BodyRow -> Bool
< :: BodyRow -> BodyRow -> Bool
$c< :: BodyRow -> BodyRow -> Bool
compare :: BodyRow -> BodyRow -> Ordering
$ccompare :: BodyRow -> BodyRow -> Ordering
$cp1Ord :: Eq BodyRow
Ord, ReadPrec [BodyRow]
ReadPrec BodyRow
Int -> ReadS BodyRow
ReadS [BodyRow]
(Int -> ReadS BodyRow)
-> ReadS [BodyRow]
-> ReadPrec BodyRow
-> ReadPrec [BodyRow]
-> Read BodyRow
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BodyRow]
$creadListPrec :: ReadPrec [BodyRow]
readPrec :: ReadPrec BodyRow
$creadPrec :: ReadPrec BodyRow
readList :: ReadS [BodyRow]
$creadList :: ReadS [BodyRow]
readsPrec :: Int -> ReadS BodyRow
$creadsPrec :: Int -> ReadS BodyRow
Read, Int -> BodyRow -> ShowS
[BodyRow] -> ShowS
BodyRow -> String
(Int -> BodyRow -> ShowS)
-> (BodyRow -> String) -> ([BodyRow] -> ShowS) -> Show BodyRow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BodyRow] -> ShowS
$cshowList :: [BodyRow] -> ShowS
show :: BodyRow -> String
$cshow :: BodyRow -> String
showsPrec :: Int -> BodyRow -> ShowS
$cshowsPrec :: Int -> BodyRow -> ShowS
Show, Typeable, Typeable BodyRow
DataType
Constr
Typeable BodyRow
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> BodyRow -> c BodyRow)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c BodyRow)
-> (BodyRow -> Constr)
-> (BodyRow -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c BodyRow))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BodyRow))
-> ((forall b. Data b => b -> b) -> BodyRow -> BodyRow)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> BodyRow -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> BodyRow -> r)
-> (forall u. (forall d. Data d => d -> u) -> BodyRow -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> BodyRow -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> BodyRow -> m BodyRow)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> BodyRow -> m BodyRow)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> BodyRow -> m BodyRow)
-> Data BodyRow
BodyRow -> DataType
BodyRow -> Constr
(forall b. Data b => b -> b) -> BodyRow -> BodyRow
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> BodyRow -> c BodyRow
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c BodyRow
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> BodyRow -> u
forall u. (forall d. Data d => d -> u) -> BodyRow -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> BodyRow -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> BodyRow -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> BodyRow -> m BodyRow
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> BodyRow -> m BodyRow
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c BodyRow
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> BodyRow -> c BodyRow
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c BodyRow)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BodyRow)
$cBodyRow :: Constr
$tBodyRow :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> BodyRow -> m BodyRow
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> BodyRow -> m BodyRow
gmapMp :: (forall d. Data d => d -> m d) -> BodyRow -> m BodyRow
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> BodyRow -> m BodyRow
gmapM :: (forall d. Data d => d -> m d) -> BodyRow -> m BodyRow
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> BodyRow -> m BodyRow
gmapQi :: Int -> (forall d. Data d => d -> u) -> BodyRow -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> BodyRow -> u
gmapQ :: (forall d. Data d => d -> u) -> BodyRow -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> BodyRow -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> BodyRow -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> BodyRow -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> BodyRow -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> BodyRow -> r
gmapT :: (forall b. Data b => b -> b) -> BodyRow -> BodyRow
$cgmapT :: (forall b. Data b => b -> b) -> BodyRow -> BodyRow
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BodyRow)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BodyRow)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c BodyRow)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c BodyRow)
dataTypeOf :: BodyRow -> DataType
$cdataTypeOf :: BodyRow -> DataType
toConstr :: BodyRow -> Constr
$ctoConstr :: BodyRow -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c BodyRow
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c BodyRow
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> BodyRow -> c BodyRow
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> BodyRow -> c BodyRow
$cp1Data :: Typeable BodyRow
Data, (forall x. BodyRow -> Rep BodyRow x)
-> (forall x. Rep BodyRow x -> BodyRow) -> Generic BodyRow
forall x. Rep BodyRow x -> BodyRow
forall x. BodyRow -> Rep BodyRow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BodyRow x -> BodyRow
$cfrom :: forall x. BodyRow -> Rep BodyRow x
Generic)

-- | The row number of a row. Note that rows are numbered continuously
-- from zero from the start of the table, so the first row in a table
-- body, for instance, may have a large 'RowNumber'.
newtype RowNumber = RowNumber Int
  deriving (RowNumber -> RowNumber -> Bool
(RowNumber -> RowNumber -> Bool)
-> (RowNumber -> RowNumber -> Bool) -> Eq RowNumber
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RowNumber -> RowNumber -> Bool
$c/= :: RowNumber -> RowNumber -> Bool
== :: RowNumber -> RowNumber -> Bool
$c== :: RowNumber -> RowNumber -> Bool
Eq, Eq RowNumber
Eq RowNumber
-> (RowNumber -> RowNumber -> Ordering)
-> (RowNumber -> RowNumber -> Bool)
-> (RowNumber -> RowNumber -> Bool)
-> (RowNumber -> RowNumber -> Bool)
-> (RowNumber -> RowNumber -> Bool)
-> (RowNumber -> RowNumber -> RowNumber)
-> (RowNumber -> RowNumber -> RowNumber)
-> Ord RowNumber
RowNumber -> RowNumber -> Bool
RowNumber -> RowNumber -> Ordering
RowNumber -> RowNumber -> RowNumber
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: RowNumber -> RowNumber -> RowNumber
$cmin :: RowNumber -> RowNumber -> RowNumber
max :: RowNumber -> RowNumber -> RowNumber
$cmax :: RowNumber -> RowNumber -> RowNumber
>= :: RowNumber -> RowNumber -> Bool
$c>= :: RowNumber -> RowNumber -> Bool
> :: RowNumber -> RowNumber -> Bool
$c> :: RowNumber -> RowNumber -> Bool
<= :: RowNumber -> RowNumber -> Bool
$c<= :: RowNumber -> RowNumber -> Bool
< :: RowNumber -> RowNumber -> Bool
$c< :: RowNumber -> RowNumber -> Bool
compare :: RowNumber -> RowNumber -> Ordering
$ccompare :: RowNumber -> RowNumber -> Ordering
$cp1Ord :: Eq RowNumber
Ord, ReadPrec [RowNumber]
ReadPrec RowNumber
Int -> ReadS RowNumber
ReadS [RowNumber]
(Int -> ReadS RowNumber)
-> ReadS [RowNumber]
-> ReadPrec RowNumber
-> ReadPrec [RowNumber]
-> Read RowNumber
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RowNumber]
$creadListPrec :: ReadPrec [RowNumber]
readPrec :: ReadPrec RowNumber
$creadPrec :: ReadPrec RowNumber
readList :: ReadS [RowNumber]
$creadList :: ReadS [RowNumber]
readsPrec :: Int -> ReadS RowNumber
$creadsPrec :: Int -> ReadS RowNumber
Read, Int -> RowNumber -> ShowS
[RowNumber] -> ShowS
RowNumber -> String
(Int -> RowNumber -> ShowS)
-> (RowNumber -> String)
-> ([RowNumber] -> ShowS)
-> Show RowNumber
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RowNumber] -> ShowS
$cshowList :: [RowNumber] -> ShowS
show :: RowNumber -> String
$cshow :: RowNumber -> String
showsPrec :: Int -> RowNumber -> ShowS
$cshowsPrec :: Int -> RowNumber -> ShowS
Show, Typeable, Typeable RowNumber
DataType
Constr
Typeable RowNumber
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> RowNumber -> c RowNumber)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c RowNumber)
-> (RowNumber -> Constr)
-> (RowNumber -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c RowNumber))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RowNumber))
-> ((forall b. Data b => b -> b) -> RowNumber -> RowNumber)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> RowNumber -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> RowNumber -> r)
-> (forall u. (forall d. Data d => d -> u) -> RowNumber -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> RowNumber -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> RowNumber -> m RowNumber)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> RowNumber -> m RowNumber)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> RowNumber -> m RowNumber)
-> Data RowNumber
RowNumber -> DataType
RowNumber -> Constr
(forall b. Data b => b -> b) -> RowNumber -> RowNumber
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RowNumber -> c RowNumber
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RowNumber
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> RowNumber -> u
forall u. (forall d. Data d => d -> u) -> RowNumber -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RowNumber -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RowNumber -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RowNumber -> m RowNumber
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RowNumber -> m RowNumber
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RowNumber
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RowNumber -> c RowNumber
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c RowNumber)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RowNumber)
$cRowNumber :: Constr
$tRowNumber :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> RowNumber -> m RowNumber
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RowNumber -> m RowNumber
gmapMp :: (forall d. Data d => d -> m d) -> RowNumber -> m RowNumber
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RowNumber -> m RowNumber
gmapM :: (forall d. Data d => d -> m d) -> RowNumber -> m RowNumber
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RowNumber -> m RowNumber
gmapQi :: Int -> (forall d. Data d => d -> u) -> RowNumber -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> RowNumber -> u
gmapQ :: (forall d. Data d => d -> u) -> RowNumber -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> RowNumber -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RowNumber -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RowNumber -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RowNumber -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RowNumber -> r
gmapT :: (forall b. Data b => b -> b) -> RowNumber -> RowNumber
$cgmapT :: (forall b. Data b => b -> b) -> RowNumber -> RowNumber
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RowNumber)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RowNumber)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c RowNumber)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c RowNumber)
dataTypeOf :: RowNumber -> DataType
$cdataTypeOf :: RowNumber -> DataType
toConstr :: RowNumber -> Constr
$ctoConstr :: RowNumber -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RowNumber
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RowNumber
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RowNumber -> c RowNumber
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RowNumber -> c RowNumber
$cp1Data :: Typeable RowNumber
Data, (forall x. RowNumber -> Rep RowNumber x)
-> (forall x. Rep RowNumber x -> RowNumber) -> Generic RowNumber
forall x. Rep RowNumber x -> RowNumber
forall x. RowNumber -> Rep RowNumber x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RowNumber x -> RowNumber
$cfrom :: forall x. RowNumber -> Rep RowNumber x
Generic, Integer -> RowNumber
RowNumber -> RowNumber
RowNumber -> RowNumber -> RowNumber
(RowNumber -> RowNumber -> RowNumber)
-> (RowNumber -> RowNumber -> RowNumber)
-> (RowNumber -> RowNumber -> RowNumber)
-> (RowNumber -> RowNumber)
-> (RowNumber -> RowNumber)
-> (RowNumber -> RowNumber)
-> (Integer -> RowNumber)
-> Num RowNumber
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
fromInteger :: Integer -> RowNumber
$cfromInteger :: Integer -> RowNumber
signum :: RowNumber -> RowNumber
$csignum :: RowNumber -> RowNumber
abs :: RowNumber -> RowNumber
$cabs :: RowNumber -> RowNumber
negate :: RowNumber -> RowNumber
$cnegate :: RowNumber -> RowNumber
* :: RowNumber -> RowNumber -> RowNumber
$c* :: RowNumber -> RowNumber -> RowNumber
- :: RowNumber -> RowNumber -> RowNumber
$c- :: RowNumber -> RowNumber -> RowNumber
+ :: RowNumber -> RowNumber -> RowNumber
$c+ :: RowNumber -> RowNumber -> RowNumber
Num, Int -> RowNumber
RowNumber -> Int
RowNumber -> [RowNumber]
RowNumber -> RowNumber
RowNumber -> RowNumber -> [RowNumber]
RowNumber -> RowNumber -> RowNumber -> [RowNumber]
(RowNumber -> RowNumber)
-> (RowNumber -> RowNumber)
-> (Int -> RowNumber)
-> (RowNumber -> Int)
-> (RowNumber -> [RowNumber])
-> (RowNumber -> RowNumber -> [RowNumber])
-> (RowNumber -> RowNumber -> [RowNumber])
-> (RowNumber -> RowNumber -> RowNumber -> [RowNumber])
-> Enum RowNumber
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: RowNumber -> RowNumber -> RowNumber -> [RowNumber]
$cenumFromThenTo :: RowNumber -> RowNumber -> RowNumber -> [RowNumber]
enumFromTo :: RowNumber -> RowNumber -> [RowNumber]
$cenumFromTo :: RowNumber -> RowNumber -> [RowNumber]
enumFromThen :: RowNumber -> RowNumber -> [RowNumber]
$cenumFromThen :: RowNumber -> RowNumber -> [RowNumber]
enumFrom :: RowNumber -> [RowNumber]
$cenumFrom :: RowNumber -> [RowNumber]
fromEnum :: RowNumber -> Int
$cfromEnum :: RowNumber -> Int
toEnum :: Int -> RowNumber
$ctoEnum :: Int -> RowNumber
pred :: RowNumber -> RowNumber
$cpred :: RowNumber -> RowNumber
succ :: RowNumber -> RowNumber
$csucc :: RowNumber -> RowNumber
Enum)

-- | The head of a body row; the portion of the row lying in the stub
-- of the 'TableBody'. Its cells correspond to HTML @\<th\>@ cells.
type RowHead = [Cell]

-- | The body of a body row; the portion of the row lying after the
-- stub of the 'TableBody'. Its cells correspond to HTML @\<td\>@
-- cells.
type RowBody = [Cell]

-- | An annotated table cell, wrapping a Pandoc 'B.Cell' with its
-- 'ColNumber' and the 'B.ColSpec' data for the columns that the cell
-- spans.
data Cell = Cell (NonEmpty B.ColSpec) ColNumber B.Cell
  deriving (Cell -> Cell -> Bool
(Cell -> Cell -> Bool) -> (Cell -> Cell -> Bool) -> Eq Cell
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Cell -> Cell -> Bool
$c/= :: Cell -> Cell -> Bool
== :: Cell -> Cell -> Bool
$c== :: Cell -> Cell -> Bool
Eq, Eq Cell
Eq Cell
-> (Cell -> Cell -> Ordering)
-> (Cell -> Cell -> Bool)
-> (Cell -> Cell -> Bool)
-> (Cell -> Cell -> Bool)
-> (Cell -> Cell -> Bool)
-> (Cell -> Cell -> Cell)
-> (Cell -> Cell -> Cell)
-> Ord Cell
Cell -> Cell -> Bool
Cell -> Cell -> Ordering
Cell -> Cell -> Cell
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Cell -> Cell -> Cell
$cmin :: Cell -> Cell -> Cell
max :: Cell -> Cell -> Cell
$cmax :: Cell -> Cell -> Cell
>= :: Cell -> Cell -> Bool
$c>= :: Cell -> Cell -> Bool
> :: Cell -> Cell -> Bool
$c> :: Cell -> Cell -> Bool
<= :: Cell -> Cell -> Bool
$c<= :: Cell -> Cell -> Bool
< :: Cell -> Cell -> Bool
$c< :: Cell -> Cell -> Bool
compare :: Cell -> Cell -> Ordering
$ccompare :: Cell -> Cell -> Ordering
$cp1Ord :: Eq Cell
Ord, ReadPrec [Cell]
ReadPrec Cell
Int -> ReadS Cell
ReadS [Cell]
(Int -> ReadS Cell)
-> ReadS [Cell] -> ReadPrec Cell -> ReadPrec [Cell] -> Read Cell
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Cell]
$creadListPrec :: ReadPrec [Cell]
readPrec :: ReadPrec Cell
$creadPrec :: ReadPrec Cell
readList :: ReadS [Cell]
$creadList :: ReadS [Cell]
readsPrec :: Int -> ReadS Cell
$creadsPrec :: Int -> ReadS Cell
Read, Int -> Cell -> ShowS
[Cell] -> ShowS
Cell -> String
(Int -> Cell -> ShowS)
-> (Cell -> String) -> ([Cell] -> ShowS) -> Show Cell
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Cell] -> ShowS
$cshowList :: [Cell] -> ShowS
show :: Cell -> String
$cshow :: Cell -> String
showsPrec :: Int -> Cell -> ShowS
$cshowsPrec :: Int -> Cell -> ShowS
Show, Typeable, Typeable Cell
DataType
Constr
Typeable Cell
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Cell -> c Cell)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Cell)
-> (Cell -> Constr)
-> (Cell -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Cell))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Cell))
-> ((forall b. Data b => b -> b) -> Cell -> Cell)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Cell -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Cell -> r)
-> (forall u. (forall d. Data d => d -> u) -> Cell -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Cell -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Cell -> m Cell)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Cell -> m Cell)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Cell -> m Cell)
-> Data Cell
Cell -> DataType
Cell -> Constr
(forall b. Data b => b -> b) -> Cell -> Cell
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Cell -> c Cell
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Cell
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Cell -> u
forall u. (forall d. Data d => d -> u) -> Cell -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Cell -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Cell -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Cell -> m Cell
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Cell -> m Cell
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Cell
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Cell -> c Cell
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Cell)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Cell)
$cCell :: Constr
$tCell :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Cell -> m Cell
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Cell -> m Cell
gmapMp :: (forall d. Data d => d -> m d) -> Cell -> m Cell
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Cell -> m Cell
gmapM :: (forall d. Data d => d -> m d) -> Cell -> m Cell
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Cell -> m Cell
gmapQi :: Int -> (forall d. Data d => d -> u) -> Cell -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Cell -> u
gmapQ :: (forall d. Data d => d -> u) -> Cell -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Cell -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Cell -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Cell -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Cell -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Cell -> r
gmapT :: (forall b. Data b => b -> b) -> Cell -> Cell
$cgmapT :: (forall b. Data b => b -> b) -> Cell -> Cell
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Cell)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Cell)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Cell)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Cell)
dataTypeOf :: Cell -> DataType
$cdataTypeOf :: Cell -> DataType
toConstr :: Cell -> Constr
$ctoConstr :: Cell -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Cell
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Cell
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Cell -> c Cell
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Cell -> c Cell
$cp1Data :: Typeable Cell
Data, (forall x. Cell -> Rep Cell x)
-> (forall x. Rep Cell x -> Cell) -> Generic Cell
forall x. Rep Cell x -> Cell
forall x. Cell -> Rep Cell x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Cell x -> Cell
$cfrom :: forall x. Cell -> Rep Cell x
Generic)

-- | The column number of a cell, meaning the column number of the
-- first column that the cell spans, if the table were laid on a
-- grid. Columns are numbered starting from zero.
newtype ColNumber = ColNumber Int
  deriving (ColNumber -> ColNumber -> Bool
(ColNumber -> ColNumber -> Bool)
-> (ColNumber -> ColNumber -> Bool) -> Eq ColNumber
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ColNumber -> ColNumber -> Bool
$c/= :: ColNumber -> ColNumber -> Bool
== :: ColNumber -> ColNumber -> Bool
$c== :: ColNumber -> ColNumber -> Bool
Eq, Eq ColNumber
Eq ColNumber
-> (ColNumber -> ColNumber -> Ordering)
-> (ColNumber -> ColNumber -> Bool)
-> (ColNumber -> ColNumber -> Bool)
-> (ColNumber -> ColNumber -> Bool)
-> (ColNumber -> ColNumber -> Bool)
-> (ColNumber -> ColNumber -> ColNumber)
-> (ColNumber -> ColNumber -> ColNumber)
-> Ord ColNumber
ColNumber -> ColNumber -> Bool
ColNumber -> ColNumber -> Ordering
ColNumber -> ColNumber -> ColNumber
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ColNumber -> ColNumber -> ColNumber
$cmin :: ColNumber -> ColNumber -> ColNumber
max :: ColNumber -> ColNumber -> ColNumber
$cmax :: ColNumber -> ColNumber -> ColNumber
>= :: ColNumber -> ColNumber -> Bool
$c>= :: ColNumber -> ColNumber -> Bool
> :: ColNumber -> ColNumber -> Bool
$c> :: ColNumber -> ColNumber -> Bool
<= :: ColNumber -> ColNumber -> Bool
$c<= :: ColNumber -> ColNumber -> Bool
< :: ColNumber -> ColNumber -> Bool
$c< :: ColNumber -> ColNumber -> Bool
compare :: ColNumber -> ColNumber -> Ordering
$ccompare :: ColNumber -> ColNumber -> Ordering
$cp1Ord :: Eq ColNumber
Ord, ReadPrec [ColNumber]
ReadPrec ColNumber
Int -> ReadS ColNumber
ReadS [ColNumber]
(Int -> ReadS ColNumber)
-> ReadS [ColNumber]
-> ReadPrec ColNumber
-> ReadPrec [ColNumber]
-> Read ColNumber
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ColNumber]
$creadListPrec :: ReadPrec [ColNumber]
readPrec :: ReadPrec ColNumber
$creadPrec :: ReadPrec ColNumber
readList :: ReadS [ColNumber]
$creadList :: ReadS [ColNumber]
readsPrec :: Int -> ReadS ColNumber
$creadsPrec :: Int -> ReadS ColNumber
Read, Int -> ColNumber -> ShowS
[ColNumber] -> ShowS
ColNumber -> String
(Int -> ColNumber -> ShowS)
-> (ColNumber -> String)
-> ([ColNumber] -> ShowS)
-> Show ColNumber
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ColNumber] -> ShowS
$cshowList :: [ColNumber] -> ShowS
show :: ColNumber -> String
$cshow :: ColNumber -> String
showsPrec :: Int -> ColNumber -> ShowS
$cshowsPrec :: Int -> ColNumber -> ShowS
Show, Typeable, Typeable ColNumber
DataType
Constr
Typeable ColNumber
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ColNumber -> c ColNumber)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ColNumber)
-> (ColNumber -> Constr)
-> (ColNumber -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ColNumber))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ColNumber))
-> ((forall b. Data b => b -> b) -> ColNumber -> ColNumber)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ColNumber -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ColNumber -> r)
-> (forall u. (forall d. Data d => d -> u) -> ColNumber -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> ColNumber -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> ColNumber -> m ColNumber)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ColNumber -> m ColNumber)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ColNumber -> m ColNumber)
-> Data ColNumber
ColNumber -> DataType
ColNumber -> Constr
(forall b. Data b => b -> b) -> ColNumber -> ColNumber
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ColNumber -> c ColNumber
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ColNumber
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> ColNumber -> u
forall u. (forall d. Data d => d -> u) -> ColNumber -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ColNumber -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ColNumber -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ColNumber -> m ColNumber
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ColNumber -> m ColNumber
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ColNumber
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ColNumber -> c ColNumber
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ColNumber)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ColNumber)
$cColNumber :: Constr
$tColNumber :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> ColNumber -> m ColNumber
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ColNumber -> m ColNumber
gmapMp :: (forall d. Data d => d -> m d) -> ColNumber -> m ColNumber
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ColNumber -> m ColNumber
gmapM :: (forall d. Data d => d -> m d) -> ColNumber -> m ColNumber
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ColNumber -> m ColNumber
gmapQi :: Int -> (forall d. Data d => d -> u) -> ColNumber -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ColNumber -> u
gmapQ :: (forall d. Data d => d -> u) -> ColNumber -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ColNumber -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ColNumber -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ColNumber -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ColNumber -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ColNumber -> r
gmapT :: (forall b. Data b => b -> b) -> ColNumber -> ColNumber
$cgmapT :: (forall b. Data b => b -> b) -> ColNumber -> ColNumber
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ColNumber)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ColNumber)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ColNumber)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ColNumber)
dataTypeOf :: ColNumber -> DataType
$cdataTypeOf :: ColNumber -> DataType
toConstr :: ColNumber -> Constr
$ctoConstr :: ColNumber -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ColNumber
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ColNumber
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ColNumber -> c ColNumber
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ColNumber -> c ColNumber
$cp1Data :: Typeable ColNumber
Data, (forall x. ColNumber -> Rep ColNumber x)
-> (forall x. Rep ColNumber x -> ColNumber) -> Generic ColNumber
forall x. Rep ColNumber x -> ColNumber
forall x. ColNumber -> Rep ColNumber x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ColNumber x -> ColNumber
$cfrom :: forall x. ColNumber -> Rep ColNumber x
Generic, Integer -> ColNumber
ColNumber -> ColNumber
ColNumber -> ColNumber -> ColNumber
(ColNumber -> ColNumber -> ColNumber)
-> (ColNumber -> ColNumber -> ColNumber)
-> (ColNumber -> ColNumber -> ColNumber)
-> (ColNumber -> ColNumber)
-> (ColNumber -> ColNumber)
-> (ColNumber -> ColNumber)
-> (Integer -> ColNumber)
-> Num ColNumber
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
fromInteger :: Integer -> ColNumber
$cfromInteger :: Integer -> ColNumber
signum :: ColNumber -> ColNumber
$csignum :: ColNumber -> ColNumber
abs :: ColNumber -> ColNumber
$cabs :: ColNumber -> ColNumber
negate :: ColNumber -> ColNumber
$cnegate :: ColNumber -> ColNumber
* :: ColNumber -> ColNumber -> ColNumber
$c* :: ColNumber -> ColNumber -> ColNumber
- :: ColNumber -> ColNumber -> ColNumber
$c- :: ColNumber -> ColNumber -> ColNumber
+ :: ColNumber -> ColNumber -> ColNumber
$c+ :: ColNumber -> ColNumber -> ColNumber
Num, Int -> ColNumber
ColNumber -> Int
ColNumber -> [ColNumber]
ColNumber -> ColNumber
ColNumber -> ColNumber -> [ColNumber]
ColNumber -> ColNumber -> ColNumber -> [ColNumber]
(ColNumber -> ColNumber)
-> (ColNumber -> ColNumber)
-> (Int -> ColNumber)
-> (ColNumber -> Int)
-> (ColNumber -> [ColNumber])
-> (ColNumber -> ColNumber -> [ColNumber])
-> (ColNumber -> ColNumber -> [ColNumber])
-> (ColNumber -> ColNumber -> ColNumber -> [ColNumber])
-> Enum ColNumber
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: ColNumber -> ColNumber -> ColNumber -> [ColNumber]
$cenumFromThenTo :: ColNumber -> ColNumber -> ColNumber -> [ColNumber]
enumFromTo :: ColNumber -> ColNumber -> [ColNumber]
$cenumFromTo :: ColNumber -> ColNumber -> [ColNumber]
enumFromThen :: ColNumber -> ColNumber -> [ColNumber]
$cenumFromThen :: ColNumber -> ColNumber -> [ColNumber]
enumFrom :: ColNumber -> [ColNumber]
$cenumFrom :: ColNumber -> [ColNumber]
fromEnum :: ColNumber -> Int
$cfromEnum :: ColNumber -> Int
toEnum :: Int -> ColNumber
$ctoEnum :: Int -> ColNumber
pred :: ColNumber -> ColNumber
$cpred :: ColNumber -> ColNumber
succ :: ColNumber -> ColNumber
$csucc :: ColNumber -> ColNumber
Enum)

-- | Convert a Pandoc 'B.Table' to an annotated 'Table'. This function
-- also performs the same normalization that the 'B.table' builder
-- does (fixing overlapping cells, cells that protrude out of their
-- table section, and so on). If the input table happens to satisfy
-- the conditions that 'B.table' guarantees, then the resulting
-- 'Table' will be identical, save for the addition of the inferred
-- table information.
toTable
  :: B.Attr
  -> B.Caption
  -> [B.ColSpec]
  -> B.TableHead
  -> [B.TableBody]
  -> B.TableFoot
  -> Table
toTable :: Attr
-> Caption
-> [ColSpec]
-> TableHead
-> [TableBody]
-> TableFoot
-> Table
toTable Attr
attr Caption
cap [ColSpec]
cs TableHead
th [TableBody]
tbs TableFoot
tf = Attr
-> Caption
-> [ColSpec]
-> TableHead
-> [TableBody]
-> TableFoot
-> Table
Table Attr
attr Caption
cap [ColSpec]
cs TableHead
th' [TableBody]
tbs' TableFoot
tf'
 where
  (TableHead
th', [TableBody]
tbs', TableFoot
tf') = ((TableHead, [TableBody], TableFoot), ())
-> (TableHead, [TableBody], TableFoot)
forall a b. (a, b) -> a
fst (((TableHead, [TableBody], TableFoot), ())
 -> (TableHead, [TableBody], TableFoot))
-> ((TableHead, [TableBody], TableFoot), ())
-> (TableHead, [TableBody], TableFoot)
forall a b. (a -> b) -> a -> b
$ RWS
  ([ColSpec], Int) () RowNumber (TableHead, [TableBody], TableFoot)
-> ([ColSpec], Int)
-> RowNumber
-> ((TableHead, [TableBody], TableFoot), ())
forall r w s a. RWS r w s a -> r -> s -> (a, w)
evalRWS (TableHead
-> [TableBody]
-> TableFoot
-> RWS
     ([ColSpec], Int) () RowNumber (TableHead, [TableBody], TableFoot)
annotateTable TableHead
th [TableBody]
tbs TableFoot
tf) ([ColSpec]
cs, [ColSpec] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [ColSpec]
cs) RowNumber
0

-- | Internal monad for annotating a table, passing in the 'B.ColSpec'
-- data for the table, the grid width, and the current 'RowNumber' to
-- be referenced or updated.
type AnnM a = RWS ([B.ColSpec], Int) () RowNumber a

incRowNumber :: AnnM RowNumber
incRowNumber :: AnnM RowNumber
incRowNumber = do
  RowNumber
rn <- AnnM RowNumber
forall s (m :: * -> *). MonadState s m => m s
get
  RowNumber -> RWST ([ColSpec], Int) () RowNumber Identity ()
forall s (m :: * -> *). MonadState s m => s -> m ()
put (RowNumber -> RWST ([ColSpec], Int) () RowNumber Identity ())
-> RowNumber -> RWST ([ColSpec], Int) () RowNumber Identity ()
forall a b. (a -> b) -> a -> b
$ RowNumber
rn RowNumber -> RowNumber -> RowNumber
forall a. Num a => a -> a -> a
+ RowNumber
1
  RowNumber -> AnnM RowNumber
forall (m :: * -> *) a. Monad m => a -> m a
return RowNumber
rn

annotateTable
  :: B.TableHead
  -> [B.TableBody]
  -> B.TableFoot
  -> AnnM (TableHead, [TableBody], TableFoot)
annotateTable :: TableHead
-> [TableBody]
-> TableFoot
-> RWS
     ([ColSpec], Int) () RowNumber (TableHead, [TableBody], TableFoot)
annotateTable TableHead
th [TableBody]
tbs TableFoot
tf = do
  TableHead
th'  <- TableHead -> AnnM TableHead
annotateTableHead TableHead
th
  [TableBody]
tbs' <- (TableBody
 -> RWST ([ColSpec], Int) () RowNumber Identity TableBody)
-> [TableBody]
-> RWST ([ColSpec], Int) () RowNumber Identity [TableBody]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse TableBody -> RWST ([ColSpec], Int) () RowNumber Identity TableBody
annotateTableBody [TableBody]
tbs
  TableFoot
tf'  <- TableFoot -> AnnM TableFoot
annotateTableFoot TableFoot
tf
  (TableHead, [TableBody], TableFoot)
-> RWS
     ([ColSpec], Int) () RowNumber (TableHead, [TableBody], TableFoot)
forall (m :: * -> *) a. Monad m => a -> m a
return (TableHead
th', [TableBody]
tbs', TableFoot
tf')

annotateTableHead :: B.TableHead -> AnnM TableHead
annotateTableHead :: TableHead -> AnnM TableHead
annotateTableHead (B.TableHead Attr
attr [Row]
rows) =
  Attr -> [HeaderRow] -> TableHead
TableHead Attr
attr ([HeaderRow] -> TableHead)
-> RWST ([ColSpec], Int) () RowNumber Identity [HeaderRow]
-> AnnM TableHead
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Row] -> RWST ([ColSpec], Int) () RowNumber Identity [HeaderRow]
annotateHeaderSection [Row]
rows

annotateTableBody :: B.TableBody -> AnnM TableBody
annotateTableBody :: TableBody -> RWST ([ColSpec], Int) () RowNumber Identity TableBody
annotateTableBody (B.TableBody Attr
attr RowHeadColumns
rhc [Row]
th [Row]
tb) = do
  Int
twidth <- (([ColSpec], Int) -> Int)
-> RWST ([ColSpec], Int) () RowNumber Identity Int
forall r (m :: * -> *) a. MonadReader r m => (r -> a) -> m a
asks ([ColSpec], Int) -> Int
forall a b. (a, b) -> b
snd
  let rhc' :: RowHeadColumns
rhc' = RowHeadColumns -> RowHeadColumns -> RowHeadColumns
forall a. Ord a => a -> a -> a
max RowHeadColumns
0 (RowHeadColumns -> RowHeadColumns)
-> RowHeadColumns -> RowHeadColumns
forall a b. (a -> b) -> a -> b
$ RowHeadColumns -> RowHeadColumns -> RowHeadColumns
forall a. Ord a => a -> a -> a
min (Int -> RowHeadColumns
B.RowHeadColumns Int
twidth) RowHeadColumns
rhc
  [HeaderRow]
th' <- [Row] -> RWST ([ColSpec], Int) () RowNumber Identity [HeaderRow]
annotateHeaderSection [Row]
th
  [BodyRow]
tb' <- RowHeadColumns -> [Row] -> AnnM [BodyRow]
annotateBodySection RowHeadColumns
rhc' [Row]
tb
  TableBody -> RWST ([ColSpec], Int) () RowNumber Identity TableBody
forall (m :: * -> *) a. Monad m => a -> m a
return (TableBody
 -> RWST ([ColSpec], Int) () RowNumber Identity TableBody)
-> TableBody
-> RWST ([ColSpec], Int) () RowNumber Identity TableBody
forall a b. (a -> b) -> a -> b
$ Attr -> RowHeadColumns -> [HeaderRow] -> [BodyRow] -> TableBody
TableBody Attr
attr RowHeadColumns
rhc' [HeaderRow]
th' [BodyRow]
tb'

annotateTableFoot :: B.TableFoot -> AnnM TableFoot
annotateTableFoot :: TableFoot -> AnnM TableFoot
annotateTableFoot (B.TableFoot Attr
attr [Row]
rows) =
  Attr -> [HeaderRow] -> TableFoot
TableFoot Attr
attr ([HeaderRow] -> TableFoot)
-> RWST ([ColSpec], Int) () RowNumber Identity [HeaderRow]
-> AnnM TableFoot
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Row] -> RWST ([ColSpec], Int) () RowNumber Identity [HeaderRow]
annotateHeaderSection [Row]
rows

annotateHeaderSection :: [B.Row] -> AnnM [HeaderRow]
annotateHeaderSection :: [Row] -> RWST ([ColSpec], Int) () RowNumber Identity [HeaderRow]
annotateHeaderSection [Row]
rows = do
  [ColSpec]
colspec <- (([ColSpec], Int) -> [ColSpec])
-> RWST ([ColSpec], Int) () RowNumber Identity [ColSpec]
forall r (m :: * -> *) a. MonadReader r m => (r -> a) -> m a
asks ([ColSpec], Int) -> [ColSpec]
forall a b. (a, b) -> a
fst
  let hangcolspec :: [(RowSpan, ColSpec)]
hangcolspec = (RowSpan
1, ) (ColSpec -> (RowSpan, ColSpec))
-> [ColSpec] -> [(RowSpan, ColSpec)]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [ColSpec]
colspec
  [(RowSpan, ColSpec)]
-> ([HeaderRow] -> [HeaderRow])
-> [Row]
-> RWST ([ColSpec], Int) () RowNumber Identity [HeaderRow]
forall b.
[(RowSpan, ColSpec)]
-> ([HeaderRow] -> b)
-> [Row]
-> RWST ([ColSpec], Int) () RowNumber Identity b
annotateHeaderSection' [(RowSpan, ColSpec)]
hangcolspec [HeaderRow] -> [HeaderRow]
forall a. a -> a
id ([Row] -> RWST ([ColSpec], Int) () RowNumber Identity [HeaderRow])
-> [Row] -> RWST ([ColSpec], Int) () RowNumber Identity [HeaderRow]
forall a b. (a -> b) -> a -> b
$ [Row] -> [Row]
B.clipRows [Row]
rows
 where
  annotateHeaderSection' :: [(RowSpan, ColSpec)]
-> ([HeaderRow] -> b)
-> [Row]
-> RWST ([ColSpec], Int) () RowNumber Identity b
annotateHeaderSection' [(RowSpan, ColSpec)]
oldHang [HeaderRow] -> b
acc (B.Row Attr
attr [Cell]
cells : [Row]
rs) = do
    let (ColNumber
_, [(RowSpan, ColSpec)]
newHang, [Cell]
cells', [Cell]
_) =
          ColNumber
-> [(RowSpan, ColSpec)]
-> [Cell]
-> (ColNumber, [(RowSpan, ColSpec)], [Cell], [Cell])
annotateRowSection ColNumber
0 [(RowSpan, ColSpec)]
oldHang ([Cell] -> (ColNumber, [(RowSpan, ColSpec)], [Cell], [Cell]))
-> [Cell] -> (ColNumber, [(RowSpan, ColSpec)], [Cell], [Cell])
forall a b. (a -> b) -> a -> b
$ [Cell]
cells [Cell] -> [Cell] -> [Cell]
forall a. Semigroup a => a -> a -> a
<> Cell -> [Cell]
forall a. a -> [a]
repeat Cell
B.emptyCell
    RowNumber
n <- AnnM RowNumber
incRowNumber
    let annRow :: HeaderRow
annRow = Attr -> RowNumber -> [Cell] -> HeaderRow
HeaderRow Attr
attr RowNumber
n [Cell]
cells'
    [(RowSpan, ColSpec)]
-> ([HeaderRow] -> b)
-> [Row]
-> RWST ([ColSpec], Int) () RowNumber Identity b
annotateHeaderSection' [(RowSpan, ColSpec)]
newHang ([HeaderRow] -> b
acc ([HeaderRow] -> b)
-> ([HeaderRow] -> [HeaderRow]) -> [HeaderRow] -> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (HeaderRow
annRow HeaderRow -> [HeaderRow] -> [HeaderRow]
forall a. a -> [a] -> [a]
:)) [Row]
rs
  annotateHeaderSection' [(RowSpan, ColSpec)]
_ [HeaderRow] -> b
acc [] = b -> RWST ([ColSpec], Int) () RowNumber Identity b
forall (m :: * -> *) a. Monad m => a -> m a
return (b -> RWST ([ColSpec], Int) () RowNumber Identity b)
-> b -> RWST ([ColSpec], Int) () RowNumber Identity b
forall a b. (a -> b) -> a -> b
$ [HeaderRow] -> b
acc []

annotateBodySection :: B.RowHeadColumns -> [B.Row] -> AnnM [BodyRow]
annotateBodySection :: RowHeadColumns -> [Row] -> AnnM [BodyRow]
annotateBodySection (B.RowHeadColumns Int
rhc) [Row]
rows = do
  [ColSpec]
colspec <- (([ColSpec], Int) -> [ColSpec])
-> RWST ([ColSpec], Int) () RowNumber Identity [ColSpec]
forall r (m :: * -> *) a. MonadReader r m => (r -> a) -> m a
asks ([ColSpec], Int) -> [ColSpec]
forall a b. (a, b) -> a
fst
  let colspec' :: [(RowSpan, ColSpec)]
colspec'             = (RowSpan
1, ) (ColSpec -> (RowSpan, ColSpec))
-> [ColSpec] -> [(RowSpan, ColSpec)]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [ColSpec]
colspec
  let ([(RowSpan, ColSpec)]
stubspec, [(RowSpan, ColSpec)]
bodyspec) = Int
-> [(RowSpan, ColSpec)]
-> ([(RowSpan, ColSpec)], [(RowSpan, ColSpec)])
forall a. Int -> [a] -> ([a], [a])
splitAt Int
rhc [(RowSpan, ColSpec)]
colspec'
  [(RowSpan, ColSpec)]
-> [(RowSpan, ColSpec)]
-> ([BodyRow] -> [BodyRow])
-> [Row]
-> AnnM [BodyRow]
forall b.
[(RowSpan, ColSpec)]
-> [(RowSpan, ColSpec)]
-> ([BodyRow] -> b)
-> [Row]
-> RWST ([ColSpec], Int) () RowNumber Identity b
normalizeBodySection' [(RowSpan, ColSpec)]
stubspec [(RowSpan, ColSpec)]
bodyspec [BodyRow] -> [BodyRow]
forall a. a -> a
id ([Row] -> AnnM [BodyRow]) -> [Row] -> AnnM [BodyRow]
forall a b. (a -> b) -> a -> b
$ [Row] -> [Row]
B.clipRows [Row]
rows
 where
  normalizeBodySection' :: [(RowSpan, ColSpec)]
-> [(RowSpan, ColSpec)]
-> ([BodyRow] -> b)
-> [Row]
-> RWST ([ColSpec], Int) () RowNumber Identity b
normalizeBodySection' [(RowSpan, ColSpec)]
headHang [(RowSpan, ColSpec)]
bodyHang [BodyRow] -> b
acc (B.Row Attr
attr [Cell]
cells : [Row]
rs) = do
    let (ColNumber
colnum, [(RowSpan, ColSpec)]
headHang', [Cell]
rowStub, [Cell]
cells') =
          ColNumber
-> [(RowSpan, ColSpec)]
-> [Cell]
-> (ColNumber, [(RowSpan, ColSpec)], [Cell], [Cell])
annotateRowSection ColNumber
0 [(RowSpan, ColSpec)]
headHang ([Cell] -> (ColNumber, [(RowSpan, ColSpec)], [Cell], [Cell]))
-> [Cell] -> (ColNumber, [(RowSpan, ColSpec)], [Cell], [Cell])
forall a b. (a -> b) -> a -> b
$ [Cell]
cells [Cell] -> [Cell] -> [Cell]
forall a. Semigroup a => a -> a -> a
<> Cell -> [Cell]
forall a. a -> [a]
repeat Cell
B.emptyCell
    let (ColNumber
_, [(RowSpan, ColSpec)]
bodyHang', [Cell]
rowBody, [Cell]
_) = ColNumber
-> [(RowSpan, ColSpec)]
-> [Cell]
-> (ColNumber, [(RowSpan, ColSpec)], [Cell], [Cell])
annotateRowSection ColNumber
colnum [(RowSpan, ColSpec)]
bodyHang [Cell]
cells'
    RowNumber
n <- AnnM RowNumber
incRowNumber
    let annRow :: BodyRow
annRow = Attr -> RowNumber -> [Cell] -> [Cell] -> BodyRow
BodyRow Attr
attr RowNumber
n [Cell]
rowStub [Cell]
rowBody
    [(RowSpan, ColSpec)]
-> [(RowSpan, ColSpec)]
-> ([BodyRow] -> b)
-> [Row]
-> RWST ([ColSpec], Int) () RowNumber Identity b
normalizeBodySection' [(RowSpan, ColSpec)]
headHang' [(RowSpan, ColSpec)]
bodyHang' ([BodyRow] -> b
acc ([BodyRow] -> b) -> ([BodyRow] -> [BodyRow]) -> [BodyRow] -> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (BodyRow
annRow BodyRow -> [BodyRow] -> [BodyRow]
forall a. a -> [a] -> [a]
:)) [Row]
rs
  normalizeBodySection' [(RowSpan, ColSpec)]
_ [(RowSpan, ColSpec)]
_ [BodyRow] -> b
acc [] = b -> RWST ([ColSpec], Int) () RowNumber Identity b
forall (m :: * -> *) a. Monad m => a -> m a
return (b -> RWST ([ColSpec], Int) () RowNumber Identity b)
-> b -> RWST ([ColSpec], Int) () RowNumber Identity b
forall a b. (a -> b) -> a -> b
$ [BodyRow] -> b
acc []

-- | Lay out a section of a 'Table' row on a grid row, annotating the
-- cells with the 'B.ColSpec' data for the columns that they
-- span. Performs the same normalization as 'B.placeRowSection'.
annotateRowSection
  :: ColNumber -- ^ The current column number
  -> [(B.RowSpan, B.ColSpec)] -- ^ The overhang of the previous grid row,
                              -- with column data
  -> [B.Cell] -- ^ The cells to annotate
  -> (ColNumber, [(B.RowSpan, B.ColSpec)], [Cell], [B.Cell]) -- ^ The new
                                                             -- column
                                                             -- number,
                                                             -- overhang,
                                                             -- annotated
                                                             -- cells,
                                                             -- and
                                                             -- remaining
                                                             -- cells
annotateRowSection :: ColNumber
-> [(RowSpan, ColSpec)]
-> [Cell]
-> (ColNumber, [(RowSpan, ColSpec)], [Cell], [Cell])
annotateRowSection !ColNumber
colnum [(RowSpan, ColSpec)]
oldHang [Cell]
cells
  -- If the grid has overhang at our position, try to re-lay in
  -- the next position.
  | (RowSpan
o, ColSpec
colspec) : [(RowSpan, ColSpec)]
os <- [(RowSpan, ColSpec)]
oldHang
  , RowSpan
o RowSpan -> RowSpan -> Bool
forall a. Ord a => a -> a -> Bool
> RowSpan
1
  = let (ColNumber
colnum', [(RowSpan, ColSpec)]
newHang, [Cell]
newCell, [Cell]
cells') =
            ColNumber
-> [(RowSpan, ColSpec)]
-> [Cell]
-> (ColNumber, [(RowSpan, ColSpec)], [Cell], [Cell])
annotateRowSection (ColNumber
colnum ColNumber -> ColNumber -> ColNumber
forall a. Num a => a -> a -> a
+ ColNumber
1) [(RowSpan, ColSpec)]
os [Cell]
cells
    in  (ColNumber
colnum', (RowSpan
o RowSpan -> RowSpan -> RowSpan
forall a. Num a => a -> a -> a
- RowSpan
1, ColSpec
colspec) (RowSpan, ColSpec) -> [(RowSpan, ColSpec)] -> [(RowSpan, ColSpec)]
forall a. a -> [a] -> [a]
: [(RowSpan, ColSpec)]
newHang, [Cell]
newCell, [Cell]
cells')
  -- Otherwise if there is any available width, place the cell and
  -- continue.
  | Cell
c : [Cell]
cells' <- [Cell]
cells
  , (RowSpan
h, ColSpan
w) <- Cell -> (RowSpan, ColSpan)
getDim Cell
c
  , ColSpan
w' <- ColSpan -> ColSpan -> ColSpan
forall a. Ord a => a -> a -> a
max ColSpan
1 ColSpan
w
  , (ColSpan
w'', cellHang :: [(RowSpan, ColSpec)]
cellHang@((RowSpan, ColSpec)
chStart : [(RowSpan, ColSpec)]
chRest), [(RowSpan, ColSpec)]
oldHang') <- RowSpan
-> ColSpan
-> [(RowSpan, ColSpec)]
-> (ColSpan, [(RowSpan, ColSpec)], [(RowSpan, ColSpec)])
splitCellHang RowSpan
h ColSpan
w' [(RowSpan, ColSpec)]
oldHang
  = let c' :: Cell
c'      = ColSpan -> Cell -> Cell
setW ColSpan
w'' Cell
c
        annCell :: Cell
annCell = NonEmpty ColSpec -> ColNumber -> Cell -> Cell
Cell ((RowSpan, ColSpec) -> ColSpec
forall a b. (a, b) -> b
snd ((RowSpan, ColSpec) -> ColSpec)
-> NonEmpty (RowSpan, ColSpec) -> NonEmpty ColSpec
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (RowSpan, ColSpec)
chStart (RowSpan, ColSpec)
-> [(RowSpan, ColSpec)] -> NonEmpty (RowSpan, ColSpec)
forall a. a -> [a] -> NonEmpty a
:| [(RowSpan, ColSpec)]
chRest) ColNumber
colnum Cell
c'
        colnum' :: ColNumber
colnum' = ColNumber
colnum ColNumber -> ColNumber -> ColNumber
forall a. Num a => a -> a -> a
+ Int -> ColNumber
ColNumber (ColSpan -> Int
getColSpan ColSpan
w'')
        (ColNumber
colnum'', [(RowSpan, ColSpec)]
newHang, [Cell]
newCells, [Cell]
remainCells) =
            ColNumber
-> [(RowSpan, ColSpec)]
-> [Cell]
-> (ColNumber, [(RowSpan, ColSpec)], [Cell], [Cell])
annotateRowSection ColNumber
colnum' [(RowSpan, ColSpec)]
oldHang' [Cell]
cells'
    in  (ColNumber
colnum'', [(RowSpan, ColSpec)]
cellHang [(RowSpan, ColSpec)]
-> [(RowSpan, ColSpec)] -> [(RowSpan, ColSpec)]
forall a. Semigroup a => a -> a -> a
<> [(RowSpan, ColSpec)]
newHang, Cell
annCell Cell -> [Cell] -> [Cell]
forall a. a -> [a] -> [a]
: [Cell]
newCells, [Cell]
remainCells)
  -- Otherwise there is no room in the section
  | Bool
otherwise
  = (ColNumber
colnum, [], [], [Cell]
cells)
 where
  getColSpan :: ColSpan -> Int
getColSpan (B.ColSpan Int
x) = Int
x
  getDim :: Cell -> (RowSpan, ColSpan)
getDim (B.Cell Attr
_ Alignment
_ RowSpan
h ColSpan
w [Block]
_) = (RowSpan
h, ColSpan
w)
  setW :: ColSpan -> Cell -> Cell
setW ColSpan
w (B.Cell Attr
a Alignment
b RowSpan
h ColSpan
_ [Block]
c) = Attr -> Alignment -> RowSpan -> ColSpan -> [Block] -> Cell
B.Cell Attr
a Alignment
b RowSpan
h ColSpan
w [Block]
c

-- | In @'splitCellHang' rs cs coldata@, with @rs@ the height of a
-- cell that lies at the beginning of @coldata@, and @cs@ its width
-- (which is not assumed to fit in the available space), return the
-- actual width of the cell (what will fit in the available space),
-- the data for the columns that the cell spans (including updating
-- the overhang to equal @rs@), and the remaining column data.
splitCellHang
  :: B.RowSpan
  -> B.ColSpan
  -> [(B.RowSpan, B.ColSpec)]
  -> (B.ColSpan, [(B.RowSpan, B.ColSpec)], [(B.RowSpan, B.ColSpec)])
splitCellHang :: RowSpan
-> ColSpan
-> [(RowSpan, ColSpec)]
-> (ColSpan, [(RowSpan, ColSpec)], [(RowSpan, ColSpec)])
splitCellHang RowSpan
h ColSpan
n = ColSpan
-> [(RowSpan, ColSpec)]
-> (ColSpan, [(RowSpan, ColSpec)], [(RowSpan, ColSpec)])
forall a b.
(Eq a, Num a) =>
ColSpan -> [(a, b)] -> (ColSpan, [(RowSpan, b)], [(a, b)])
go ColSpan
0
 where
  go :: ColSpan -> [(a, b)] -> (ColSpan, [(RowSpan, b)], [(a, b)])
go ColSpan
acc ((a
1, b
spec) : [(a, b)]
ls) | ColSpan
acc ColSpan -> ColSpan -> Bool
forall a. Ord a => a -> a -> Bool
< ColSpan
n =
    let (ColSpan
acc', [(RowSpan, b)]
hang, [(a, b)]
ls') = ColSpan -> [(a, b)] -> (ColSpan, [(RowSpan, b)], [(a, b)])
go (ColSpan
acc ColSpan -> ColSpan -> ColSpan
forall a. Num a => a -> a -> a
+ ColSpan
1) [(a, b)]
ls in (ColSpan
acc', (RowSpan
h, b
spec) (RowSpan, b) -> [(RowSpan, b)] -> [(RowSpan, b)]
forall a. a -> [a] -> [a]
: [(RowSpan, b)]
hang, [(a, b)]
ls')
  go ColSpan
acc [(a, b)]
l = (ColSpan
acc, [], [(a, b)]
l)

-- | Convert an annotated 'Table' to a Pandoc
-- 'B.Table'. This is the inverse of 'toTable' on
-- well-formed tables (i.e. tables satisfying the guarantees of
-- 'B.table').
fromTable
  :: Table
  -> ( B.Attr
     , B.Caption
     , [B.ColSpec]
     , B.TableHead
     , [B.TableBody]
     , B.TableFoot
     )
fromTable :: Table
-> (Attr, Caption, [ColSpec], TableHead, [TableBody], TableFoot)
fromTable (Table Attr
attr Caption
cap [ColSpec]
cs TableHead
th [TableBody]
tbs TableFoot
tf) = (Attr
attr, Caption
cap, [ColSpec]
cs, TableHead
th', [TableBody]
tbs', TableFoot
tf')
 where
  th' :: TableHead
th'  = TableHead -> TableHead
fromTableHead TableHead
th
  tbs' :: [TableBody]
tbs' = (TableBody -> TableBody) -> [TableBody] -> [TableBody]
forall a b. (a -> b) -> [a] -> [b]
map TableBody -> TableBody
fromTableBody [TableBody]
tbs
  tf' :: TableFoot
tf'  = TableFoot -> TableFoot
fromTableFoot TableFoot
tf

fromTableHead :: TableHead -> B.TableHead
fromTableHead :: TableHead -> TableHead
fromTableHead (TableHead Attr
attr [HeaderRow]
rows) = Attr -> [Row] -> TableHead
B.TableHead Attr
attr ([Row] -> TableHead) -> [Row] -> TableHead
forall a b. (a -> b) -> a -> b
$ HeaderRow -> Row
fromHeaderRow (HeaderRow -> Row) -> [HeaderRow] -> [Row]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [HeaderRow]
rows

fromTableBody :: TableBody -> B.TableBody
fromTableBody :: TableBody -> TableBody
fromTableBody (TableBody Attr
attr RowHeadColumns
rhc [HeaderRow]
th [BodyRow]
tb) =
  Attr -> RowHeadColumns -> [Row] -> [Row] -> TableBody
B.TableBody Attr
attr RowHeadColumns
rhc (HeaderRow -> Row
fromHeaderRow (HeaderRow -> Row) -> [HeaderRow] -> [Row]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [HeaderRow]
th) (BodyRow -> Row
fromBodyRow (BodyRow -> Row) -> [BodyRow] -> [Row]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [BodyRow]
tb)

fromTableFoot :: TableFoot -> B.TableFoot
fromTableFoot :: TableFoot -> TableFoot
fromTableFoot (TableFoot Attr
attr [HeaderRow]
rows) = Attr -> [Row] -> TableFoot
B.TableFoot Attr
attr ([Row] -> TableFoot) -> [Row] -> TableFoot
forall a b. (a -> b) -> a -> b
$ HeaderRow -> Row
fromHeaderRow (HeaderRow -> Row) -> [HeaderRow] -> [Row]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [HeaderRow]
rows

fromHeaderRow :: HeaderRow -> B.Row
fromHeaderRow :: HeaderRow -> Row
fromHeaderRow (HeaderRow Attr
attr RowNumber
_ [Cell]
cells) = Attr -> [Cell] -> Row
B.Row Attr
attr ([Cell] -> Row) -> [Cell] -> Row
forall a b. (a -> b) -> a -> b
$ Cell -> Cell
fromCell (Cell -> Cell) -> [Cell] -> [Cell]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Cell]
cells

fromBodyRow :: BodyRow -> B.Row
fromBodyRow :: BodyRow -> Row
fromBodyRow (BodyRow Attr
attr RowNumber
_ [Cell]
rh [Cell]
rb) =
  Attr -> [Cell] -> Row
B.Row Attr
attr ((Cell -> Cell
fromCell (Cell -> Cell) -> [Cell] -> [Cell]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Cell]
rh) [Cell] -> [Cell] -> [Cell]
forall a. Semigroup a => a -> a -> a
<> (Cell -> Cell
fromCell (Cell -> Cell) -> [Cell] -> [Cell]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Cell]
rb))

fromCell :: Cell -> B.Cell
fromCell :: Cell -> Cell
fromCell (Cell NonEmpty ColSpec
_ ColNumber
_ Cell
c) = Cell
c