scyther-proof-0.3.0: Automatic generation of Isabelle/HOL correctness proofs for security protocols.

Data.Table

Contents

Description

Simple table representation. This module is meant to be imported qualified.

Synopsis

Datatypes

data Alignment Source

A column alignment.

Constructors

AlignLeft 
AlignRight 

data Table a Source

A table with aligned rows.

Instances

Functor Table 
Eq a => Eq (Table a) 
Ord a => Ord (Table a) 
Show a => Show (Table a) 

Queries

toList :: a -> Table a -> [[a]]Source

alignments :: Table a -> IntMap AlignmentSource

The alignment for each column

defaultAlignment :: AlignmentSource

The default alignment to be used for a row.

columns :: Table a -> IntSource

The number of columns of the table.

rows :: Table a -> IntSource

The number of rows of the table.

Construction/Modification

empty :: Table aSource

Emtpy table.

fromList :: [[a]] -> Table aSource

Convert a list of rows to a table.

newRow :: Table a -> Table aSource

Add a new empty row to the table.

setAlignment :: Int -> Alignment -> Table a -> Table aSource

Set the alignment of the given column.

appendCell :: a -> Table a -> Table aSource

Append a cell at the end of the last row

appendNumCellSource

Arguments

:: RealFrac a 
=> Int

Number of digits after the decimal point

-> a 
-> Table String 
-> Table String 

Append a cell containing a number; i.e. round and right align.

Cell based access

getCell :: (Int, Int) -> Table a -> Maybe aSource

Retrieve the contents of a cell if it exists.

setCell :: (Int, Int) -> a -> Table a -> Table aSource

Set the contents of a cell.

alignLastCell :: Alignment -> Table a -> Table aSource

Set the alignemnt of the last cell.

Pretty Printing

toLaTeX :: (a -> String) -> Table a -> StringSource

Convert a table to the body of a LaTeX table.