Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Text.Layout.Table.Primitives.Basic
Description
This module contains primitive modifiers for lists and String
s to be
filled or fitted to a specific length.
- data CutMarkSpec
- cutMark :: String -> String -> CutMarkSpec
- singleCutMark :: String -> CutMarkSpec
- noCutMark :: CutMarkSpec
- ellipsisCutMark :: CutMarkSpec
- spaces :: Int -> String
- fillLeft' :: Int -> Int -> String -> String
- fillLeft :: Int -> String -> String
- fillRight :: Int -> String -> String
- fillCenter' :: Int -> Int -> String -> String
- fillCenter :: Int -> String -> String
- fitRightWith :: CutMarkSpec -> Int -> String -> String
- fitLeftWith :: CutMarkSpec -> Int -> String -> String
- fitCenterWith :: CutMarkSpec -> Int -> String -> String
- applyMarkLeftWith :: CutMarkSpec -> String -> String
- applyMarkRightWith :: CutMarkSpec -> String -> String
- fillStart' :: a -> Int -> Int -> [a] -> [a]
- fillStart :: a -> Int -> [a] -> [a]
- fillEnd :: a -> Int -> [a] -> [a]
- fillBoth' :: a -> Int -> Int -> [a] -> [a]
- fillBoth :: a -> Int -> [a] -> [a]
Cut marks
data CutMarkSpec Source
Specifies how the place looks where a String
has been cut. Note that the
cut mark may be cut itself, to fit into a column.
Instances
cutMark :: String -> String -> CutMarkSpec Source
Display custom characters on a cut.
singleCutMark :: String -> CutMarkSpec Source
Use the same cut mark for left and right.
noCutMark :: CutMarkSpec Source
Don't use a cut mark.
ellipsisCutMark :: CutMarkSpec Source
A single unicode character showing three dots is used as cut mark.
String-related tools
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.
fitRightWith :: CutMarkSpec -> Int -> String -> String Source
Fits to the given length by either trimming or filling it to the right.
fitLeftWith :: CutMarkSpec -> Int -> String -> String Source
Fits to the given length by either trimming or filling it to the right.
fitCenterWith :: CutMarkSpec -> 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.
applyMarkLeftWith :: CutMarkSpec -> String -> String Source
Applies a CutMarkSpec
to the left of a String
, while preserving the length.
applyMarkRightWith :: CutMarkSpec -> String -> String Source
Applies a CutMarkSpec
to the right of a String
, while preserving the length.
List-related tools
fillStart' :: a -> Int -> Int -> [a] -> [a] Source