table-layout-0.9.0.1: Format tabular data as grid or table.

Safe HaskellSafe
LanguageHaskell2010

Text.Layout.Table.Primitives.Basic

Contents

Description

This module contains primitive modifiers for lists and Strings to be filled or fitted to a specific length.

Synopsis

String-related tools

Filling

fillLeft :: Int -> String -> String Source #

Fill on the left until the String has the desired length.

fillRight :: Int -> String -> String Source #

Fill on the right until the String has the desired length.

fillCenter :: Int -> String -> String Source #

Fill on both sides equally until the String has the desired length.

Fitting

fitRightWith :: CutMark -> Int -> String -> String Source #

Fits to the given length by either trimming or filling it to the right.

fitLeftWith :: CutMark -> Int -> String -> String Source #

Fits to the given length by either trimming or filling it to the right.

fitCenterWith :: CutMark -> Int -> String -> String Source #

Fits to the given length by either trimming or filling it on both sides, but when only 1 character should be trimmed it will trim left.

Applying cut marks

applyMarkLeftWith :: CutMark -> String -> String Source #

Applies a CutMark to the left of a String, while preserving the length.

applyMarkRightWith :: CutMark -> String -> String Source #

Applies a CutMark to the right of a String, while preserving the length.

List-related tools

Filling

fillStart' :: a -> Int -> Int -> [a] -> [a] Source #

fillStart :: a -> Int -> [a] -> [a] Source #

fillEnd :: a -> Int -> [a] -> [a] Source #

fillBoth' :: a -> Int -> Int -> [a] -> [a] Source #

fillBoth :: a -> Int -> [a] -> [a] Source #