hledger-lib-1.41: A library providing the core functionality of hledger
Safe HaskellNone
LanguageHaskell2010

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 #

Instances

Instances details
Show Type # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

showsPrec :: Int -> Type -> ShowS #

show :: Type -> String #

showList :: [Type] -> ShowS #

Eq Type # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

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

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

Ord Type # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

compare :: Type -> Type -> Ordering #

(<) :: Type -> Type -> Bool #

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

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

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

max :: Type -> Type -> Type #

min :: Type -> Type -> Type #

data Style #

Constructors

Body Emphasis 
Head 

Instances

Instances details
Show Style # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

showsPrec :: Int -> Style -> ShowS #

show :: Style -> String #

showList :: [Style] -> ShowS #

Eq Style # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

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

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

Ord Style # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

compare :: Style -> Style -> Ordering #

(<) :: Style -> Style -> Bool #

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

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

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

max :: Style -> Style -> Style #

min :: Style -> Style -> Style #

data Emphasis #

Constructors

Item 
Total 

Instances

Instances details
Show Emphasis # 
Instance details

Defined in Hledger.Write.Spreadsheet

Eq Emphasis # 
Instance details

Defined in Hledger.Write.Spreadsheet

Ord Emphasis # 
Instance details

Defined in Hledger.Write.Spreadsheet

data Cell border text #

Constructors

Cell 

Instances

Instances details
Functor (Cell border) # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

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

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

newtype Class #

Constructors

Class Text 

data Span #

  • 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 # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

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

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

data Border lines #

Constructors

Border 

Fields

Instances

Instances details
Applicative Border # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

pure :: a -> Border a #

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

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

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

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

Functor Border # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

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

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

Foldable Border # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

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

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

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

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

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

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

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

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

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

toList :: Border a -> [a] #

null :: Border a -> Bool #

length :: Border a -> Int #

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

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

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

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

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

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

Defined in Hledger.Write.Spreadsheet

Methods

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

show :: Border lines -> String #

showList :: [Border lines] -> ShowS #

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

Defined in Hledger.Write.Spreadsheet

Methods

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

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

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

Defined in Hledger.Write.Spreadsheet

Methods

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

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

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

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

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

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

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

class Lines border where #

Methods

noLine :: border #

Instances

Instances details
Lines NumLines # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

noLine :: NumLines #

Lines () # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

noLine :: () #

data NumLines #

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

Constructors

NoLine 
SingleLine 
DoubleLine 

Instances

Instances details
Show NumLines # 
Instance details

Defined in Hledger.Write.Spreadsheet

Eq NumLines # 
Instance details

Defined in Hledger.Write.Spreadsheet

Ord NumLines # 
Instance details

Defined in Hledger.Write.Spreadsheet

Lines NumLines # 
Instance details

Defined in Hledger.Write.Html

Methods

borderLines :: NumLines -> [Text] #

Lines NumLines # 
Instance details

Defined in Hledger.Write.Spreadsheet

Methods

noLine :: NumLines #

noBorder :: Lines border => Border border #

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

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

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

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

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

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

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

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

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

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

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