Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Data.Text.AlignEqual
Description
A module providing functions for text alignment and padding.
Synopsis
- prefixLength :: Text -> Maybe Int
- adjustLine :: Int -> Text -> Text
- adjustText :: Text -> Text
Documentation
Adjusts the prefix of a text line to a desired length by adding padding spaces.
>>>
adjustLine 5 "key=value"
"key =value">>>
adjustLine 3 "a=b"
"a =b"
Processes multi-line text to align all '=' signs across lines. It adjusts the prefix length of each line to match the maximum prefix length. If a line does not contain '=', it will be left as-is.
>>>
adjustText "key=value\na=b"
"key=value\na =b">>>
adjustText "x=y\nlong=var"
"x =y\nlong=var"