Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data FillStrategy
- data FillScope
- data WrapSettings = WrapSettings {}
- defaultWrapSettings :: WrapSettings
- wrapTextToLines :: WrapSettings -> Int -> Text -> [Text]
- wrapText :: WrapSettings -> Int -> Text -> Text
Documentation
data FillStrategy Source #
How should wrapped lines be filled (i.e. what kind of prefix should be attached?)
NoFill | Don't do any filling (default) |
FillIndent Int | Indent by this many spaces |
FillPrefix Text | Prepend this text |
Instances
Eq FillStrategy Source # | |
Defined in Text.Wrap (==) :: FillStrategy -> FillStrategy -> Bool # (/=) :: FillStrategy -> FillStrategy -> Bool # | |
Read FillStrategy Source # | |
Defined in Text.Wrap readsPrec :: Int -> ReadS FillStrategy # readList :: ReadS [FillStrategy] # | |
Show FillStrategy Source # | |
Defined in Text.Wrap showsPrec :: Int -> FillStrategy -> ShowS # show :: FillStrategy -> String # showList :: [FillStrategy] -> ShowS # |
To which lines should the fill strategy be applied?
FillAfterFirst | Apply any fill prefix only to lines after the first line (default) |
FillAll | Apply any fill prefix to all lines, even if there is only one line |
data WrapSettings Source #
Settings to control how wrapping is performed.
WrapSettings | |
|
Instances
Eq WrapSettings Source # | |
Defined in Text.Wrap (==) :: WrapSettings -> WrapSettings -> Bool # (/=) :: WrapSettings -> WrapSettings -> Bool # | |
Read WrapSettings Source # | |
Defined in Text.Wrap readsPrec :: Int -> ReadS WrapSettings # readList :: ReadS [WrapSettings] # | |
Show WrapSettings Source # | |
Defined in Text.Wrap showsPrec :: Int -> WrapSettings -> ShowS # show :: WrapSettings -> String # showList :: [WrapSettings] -> ShowS # |
wrapTextToLines :: WrapSettings -> Int -> Text -> [Text] Source #
Wrap text at the specified width. Newlines and whitespace in the input text are preserved. Returns the lines of text in wrapped form. New lines introduced due to wrapping will have leading whitespace stripped prior to having any fill applied. Preserved indentation is always placed before any fill.
wrapText :: WrapSettings -> Int -> Text -> Text Source #
Like wrapTextToLines
, but returns the wrapped text reconstructed
with newlines inserted at wrap points.