| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Data.Text.AlignEqual
Description
A module providing functions for text alignment and padding.
Synopsis
- prefixLength :: Text -> Int
- adjustLine :: Int -> Text -> Text
- adjustText :: Text -> Text
Documentation
Calculates the number of characters preceding the first '=' sign in a text line.
>>>prefixLength "key=value"3>>>prefixLength "a=b"1>>>prefixLength "noequals"8
Adjusts the prefix of a text line to a desired length by adding padding.
>>>adjustLine 5 "key=value""key =value">>>adjustLine 3 "a=b""a =b"
Processes multi-line text to align all '=' signs across lines. Adjusts the prefix length of each line to match the maximum prefix length.
>>>adjustText "key=value\na=b""key=value\na =b">>>adjustText "x=y\nlong=var""x =y\nlong=var"