Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
This module contains primitive modifiers for lists and String
s to be
filled or fitted to a specific length.
Synopsis
- data CutMark
- doubleCutMark :: String -> String -> CutMark
- singleCutMark :: String -> CutMark
- noCutMark :: CutMark
- spaces :: Int -> String
- concatLines :: [String] -> String
- fillLeft' :: Int -> Int -> String -> String
- fillLeft :: Int -> String -> String
- fillRight :: Int -> String -> String
- fillCenter' :: Int -> Int -> String -> String
- fillCenter :: Int -> String -> String
- fitRightWith :: CutMark -> Int -> String -> String
- fitLeftWith :: CutMark -> Int -> String -> String
- fitCenterWith :: CutMark -> Int -> String -> String
- applyMarkLeftWith :: CutMark -> String -> String
- applyMarkRightWith :: CutMark -> 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
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.
doubleCutMark :: String -> String -> CutMark Source #
Specify two different cut marks, one for cuts on the left and one for cuts on the right.
singleCutMark :: String -> CutMark Source #
Use the cut mark on both sides by reversing it on the other.
String-related tools
concatLines :: [String] -> String Source #
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
List-related tools
Filling
fillStart' :: a -> Int -> Int -> [a] -> [a] Source #