hledger-lib-1.50.3: A library providing the core functionality of hledger
Safe HaskellNone
LanguageGHC2021

Hledger.Write.Spreadsheet

Description

Rich data type to describe data in a table. This is the basis for ODS and HTML export.

Synopsis

Documentation

data Type Source #

Instances

Instances details
Show Type Source # 
Instance details

Defined in Hledger.Write.Spreadsheet

Eq Type Source # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

(==) :: Type -> Type -> Bool Source #

(/=) :: Type -> Type -> Bool Source #

Ord Type Source # 
Instance details

Defined in Hledger.Write.Spreadsheet

data Style Source #

Constructors

Body Emphasis 
Head 

Instances

Instances details
Show Style Source # 
Instance details

Defined in Hledger.Write.Spreadsheet

Eq Style Source # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

(==) :: Style -> Style -> Bool Source #

(/=) :: Style -> Style -> Bool Source #

Ord Style Source # 
Instance details

Defined in Hledger.Write.Spreadsheet

data Cell border text Source #

Constructors

Cell 

Instances

Instances details
Functor (Cell border) Source # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

fmap :: (a -> b) -> Cell border a -> Cell border b Source #

(<$) :: a -> Cell border b -> Cell border a Source #

newtype Class Source #

Constructors

Class Text 

data Span Source #

  • NoSpan means a single unmerged cell.
  • Covered is a cell if it is part of a horizontally or vertically merged cell. We maintain these cells although they are ignored in HTML output. In contrast to that, FODS can store covered cells and allows to access the hidden cell content via formulas. CSV does not support merged cells and thus simply writes the content of covered cells. Maintaining Covered cells also simplifies transposing.
  • SpanHorizontal n denotes the first cell in a row that is part of a merged cell. The merged cell contains n atomic cells, including the first one. That is SpanHorizontal 1 is actually like NoSpan. The content of this cell is shown as content of the merged cell.
  • SpanVertical n starts a vertically merged cell.

The writer functions expect consistent data, that is, Covered cells must actually be part of a merged cell and merged cells must only cover Covered cells.

Instances

Instances details
Eq Span Source # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

(==) :: Span -> Span -> Bool Source #

(/=) :: Span -> Span -> Bool Source #

data Border lines Source #

Constructors

Border 

Fields

Instances

Instances details
Applicative Border Source # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

pure :: a -> Border a Source #

(<*>) :: Border (a -> b) -> Border a -> Border b Source #

liftA2 :: (a -> b -> c) -> Border a -> Border b -> Border c Source #

(*>) :: Border a -> Border b -> Border b Source #

(<*) :: Border a -> Border b -> Border a Source #

Functor Border Source # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

fmap :: (a -> b) -> Border a -> Border b Source #

(<$) :: a -> Border b -> Border a Source #

Foldable Border Source # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

fold :: Monoid m => Border m -> m Source #

foldMap :: Monoid m => (a -> m) -> Border a -> m Source #

foldMap' :: Monoid m => (a -> m) -> Border a -> m Source #

foldr :: (a -> b -> b) -> b -> Border a -> b Source #

foldr' :: (a -> b -> b) -> b -> Border a -> b Source #

foldl :: (b -> a -> b) -> b -> Border a -> b Source #

foldl' :: (b -> a -> b) -> b -> Border a -> b Source #

foldr1 :: (a -> a -> a) -> Border a -> a Source #

foldl1 :: (a -> a -> a) -> Border a -> a Source #

toList :: Border a -> [a] Source #

null :: Border a -> Bool Source #

length :: Border a -> Int Source #

elem :: Eq a => a -> Border a -> Bool Source #

maximum :: Ord a => Border a -> a Source #

minimum :: Ord a => Border a -> a Source #

sum :: Num a => Border a -> a Source #

product :: Num a => Border a -> a Source #

Show lines => Show (Border lines) Source # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

showsPrec :: Int -> Border lines -> ShowS Source #

show :: Border lines -> String Source #

showList :: [Border lines] -> ShowS Source #

Eq lines => Eq (Border lines) Source # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

(==) :: Border lines -> Border lines -> Bool Source #

(/=) :: Border lines -> Border lines -> Bool Source #

Ord lines => Ord (Border lines) Source # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

compare :: Border lines -> Border lines -> Ordering Source #

(<) :: Border lines -> Border lines -> Bool Source #

(<=) :: Border lines -> Border lines -> Bool Source #

(>) :: Border lines -> Border lines -> Bool Source #

(>=) :: Border lines -> Border lines -> Bool Source #

max :: Border lines -> Border lines -> Border lines Source #

min :: Border lines -> Border lines -> Border lines Source #

class Lines border where Source #

Methods

noLine :: border Source #

Instances

Instances details
Lines NumLines Source # 
Instance details

Defined in Hledger.Write.Spreadsheet

Lines () Source # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

noLine :: () Source #

data NumLines Source #

The same as Tab.Properties, but has Eq and Ord instances. We need those for storing NumLines in Sets.

Constructors

NoLine 
SingleLine 
DoubleLine 

noBorder :: Lines border => Border border Source #

defaultCell :: Lines border => text -> Cell border text Source #

headerCell :: Lines borders => Text -> Cell borders Text Source #

emptyCell :: (Lines border, Monoid text) => Cell border text Source #

transposeCell :: Cell border text -> Cell border text Source #

transpose :: [[Cell border text]] -> [[Cell border text]] Source #

horizontalSpan :: (Lines border, Monoid text) => [a] -> Cell border text -> [Cell border text] Source #

addHeaderBorders :: [Cell () text] -> [Cell NumLines text] Source #

addRowSpanHeader :: Cell border text -> [[Cell border text]] -> [[Cell border text]] Source #

rawTableContent :: [[Cell border text]] -> [[text]] Source #

cellFromAmount :: Lines border => AmountFormat -> (Class, (wb, Amount)) -> Cell border wb Source #

integerCell :: Lines border => Integer -> Cell border Text Source #