hledger-0.3: A ledger-compatible text-based accounting tool.

Ledger.Utils

Description

This is the bottom of the module hierarchy. It provides a number of standard modules and utilities which are useful everywhere (or, are needed low in the hierarchy). The hledger prelude.

Synopsis

Documentation

module Char

module Data.List

module Data.Maybe

module Data.Ord

module Data.Tree

concatTopPadded :: [String] -> StringSource

Join multi-line strings as side-by-side rectangular strings of the same height, top-padded.

concatBottomPadded :: [String] -> StringSource

Join multi-line strings as side-by-side rectangular strings of the same height, bottom-padded.

padtop :: Int -> String -> StringSource

Convert a multi-line string to a rectangular string top-padded to the specified height.

padbottom :: Int -> String -> StringSource

Convert a multi-line string to a rectangular string bottom-padded to the specified height.

padleft :: Int -> String -> StringSource

Convert a multi-line string to a rectangular string left-padded to the specified width.

padright :: Int -> String -> StringSource

Convert a multi-line string to a rectangular string right-padded to the specified width.

cliptopleft :: Int -> Int -> String -> StringSource

Clip a multi-line string to the specified width and height from the top left.

fitto :: Int -> Int -> String -> StringSource

Clip and pad a multi-line string to fill the specified width and height.

difforzero :: (Num a, Ord a) => a -> a -> aSource

splitAtElement :: Eq a => a -> [a] -> [[a]]Source

leaves :: Tree a -> [a]Source

List just the leaf nodes of a tree

subtreeat :: Eq a => a -> Tree a -> Maybe (Tree a)Source

get the sub-tree rooted at the first (left-most, depth-first) occurrence of the specified node value

subtreeinforest :: Eq a => a -> [Tree a] -> Maybe (Tree a)Source

get the sub-tree for the specified node value in the first tree in forest in which it occurs.

treeprune :: Int -> Tree a -> Tree aSource

remove all nodes past a certain depth

treemap :: (a -> b) -> Tree a -> Tree bSource

apply f to all tree nodes

treefilter :: (a -> Bool) -> Tree a -> Tree aSource

remove all subtrees whose nodes do not fulfill predicate

treeany :: (a -> Bool) -> Tree a -> BoolSource

is predicate true in any node of tree ?

showtree :: Show a => Tree a -> StringSource

show a compact ascii representation of a tree

showforest :: Show a => Forest a -> StringSource

show a compact ascii representation of a forest

strace :: Show a => a -> aSource

trace (print on stdout at runtime) a showable expression (for easily tracing in the middle of a complex expression)

module Text.Regex

module Test.HUnit