-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | A library for wrapping long lines of text.
@package word-wrap
@version 0.5

module Text.Wrap

-- | How should wrapped lines be filled (i.e. what kind of prefix should be
--   attached?)
data FillStrategy

-- | Don't do any filling (default)
NoFill :: FillStrategy

-- | Indent by this many spaces
FillIndent :: Int -> FillStrategy

-- | Prepend this text
FillPrefix :: Text -> FillStrategy

-- | To which lines should the fill strategy be applied?
data FillScope

-- | Apply any fill prefix only to lines after the first line (default)
FillAfterFirst :: FillScope

-- | Apply any fill prefix to all lines, even if there is only one line
FillAll :: FillScope

-- | Settings to control how wrapping is performed.
data WrapSettings
WrapSettings :: Bool -> Bool -> FillStrategy -> FillScope -> WrapSettings

-- | Whether to indent new lines created by wrapping when their original
--   line was indented.
[preserveIndentation] :: WrapSettings -> Bool

-- | Whether to break in the middle of the first word on a line when that
--   word exceeds the wrapping width.
[breakLongWords] :: WrapSettings -> Bool

-- | What kind of prefix should be applied to lines after wrapping?
--   (default: none)
[fillStrategy] :: WrapSettings -> FillStrategy

-- | To which lines should the fill strategy be applied? (default: all but
--   the first)
[fillScope] :: WrapSettings -> FillScope
defaultWrapSettings :: WrapSettings

-- | 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.
wrapTextToLines :: WrapSettings -> Int -> Text -> [Text]

-- | Like <a>wrapTextToLines</a>, but returns the wrapped text
--   reconstructed with newlines inserted at wrap points.
wrapText :: WrapSettings -> Int -> Text -> Text
instance GHC.Classes.Eq Text.Wrap.FillScope
instance GHC.Classes.Eq Text.Wrap.FillStrategy
instance GHC.Classes.Eq Text.Wrap.WrapSettings
instance GHC.Internal.Read.Read Text.Wrap.FillScope
instance GHC.Internal.Read.Read Text.Wrap.FillStrategy
instance GHC.Internal.Read.Read Text.Wrap.WrapSettings
instance GHC.Internal.Show.Show Text.Wrap.FillScope
instance GHC.Internal.Show.Show Text.Wrap.FillStrategy
instance GHC.Internal.Show.Show Text.Wrap.Token
instance GHC.Internal.Show.Show Text.Wrap.WrapSettings
