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

-- | Case conversion, word boundary manipulation, and textual subjugation.
--   
--   Manipulate identifiers and structurally non-complex pieces of text by
--   delimiting word boundaries via a combination of whitespace,
--   control-characters, and case-sensitivity.
--   
--   Has support for common idioms like casing of programmatic variable
--   names, taking, dropping, and splitting by word, and modifying the
--   first character of a piece of text.
@package text-manipulate
@version 0.3.1.0

-- | Manipulate identifiers and structurally non-complex pieces of text by
--   delimiting word boundaries via a combination of whitespace,
--   control-characters, and case-sensitivity.
--   
--   Assumptions have been made about word boundary characteristics
--   inherint in predominantely English text, please see individual
--   function documentation for further details and behaviour.
module Data.Text.Lazy.Manipulate

-- | O(n) Returns the first word, or the original text if no word boundary
--   is encountered. Subject to fusion.
takeWord :: Text -> Text

-- | O(n) Return the suffix after dropping the first word. If no word
--   boundary is encountered, the result will be empty. Subject to
--   fusion.
dropWord :: Text -> Text

-- | O(n) Return the suffix after removing the first word, or
--   Nothing if no word boundary is encountered.
--   
--   
--   >>> stripWord "HTML5Spaghetti"
--   Just "Spaghetti"
--   
--   
--   
--   >>> stripWord "noboundaries"
--   Nothing
--   
stripWord :: Text -> Maybe Text

-- | Break a piece of text after the first word boundary is encountered.
--   
--   
--   >>> breakWord "PascalCasedVariable"
--   ("Pacal", "CasedVariable")
--   
--   
--   
--   >>> breakWord "spinal-cased-variable"
--   ("spinal", "cased-variable")
--   
breakWord :: Text -> (Text, Text)

-- | O(n) Split into a list of words delimited by boundaries.
--   
--   
--   >>> splitWords "SupercaliFrag_ilistic"
--   ["Supercali","Frag","ilistic"]
--   
splitWords :: Text -> [Text]

-- | Lowercase the first character of a piece of text.
--   
--   
--   >>> lowerHead "Title Cased"
--   "title Cased"
--   
lowerHead :: Text -> Text

-- | Uppercase the first character of a piece of text.
--   
--   
--   >>> upperHead "snake_cased"
--   "Snake_cased"
--   
upperHead :: Text -> Text

-- | Apply a function to the first character of a piece of text.
mapHead :: (Char -> Char) -> Text -> Text

-- | Indent newlines by the given number of spaces.
indentLines :: Int -> Text -> Text

-- | Prepend newlines with the given separator
prependLines :: Text -> Text -> Text

-- | O(n) Truncate text to a specific length. If the text was truncated the
--   ellipsis sign "..." will be appended.
--   
--   See: toEllipsisWith
toEllipsis :: Int64 -> Text -> Text

-- | O(n) Truncate text to a specific length. If the text was truncated the
--   given ellipsis sign will be appended.
toEllipsisWith :: Int64 -> Text -> Text -> Text

-- | O(n) Create an adhoc acronym from a piece of cased text.
--   
--   
--   >>> toAcronym "AmazonWebServices"
--   Just "AWS"
--   
--   
--   
--   >>> toAcronym "Learn-You Some_Haskell"
--   Just "LYSH"
--   
--   
--   
--   >>> toAcronym "this_is_all_lowercase"
--   Nothing
--   
toAcronym :: Text -> Maybe Text

-- | Render an ordinal used to denote the position in an ordered sequence.
--   
--   
--   >>> toOrdinal (101 :: Int)
--   "101st"
--   
--   
--   
--   >>> toOrdinal (12 :: Int)
--   "12th"
--   
toOrdinal :: Integral a => a -> Text

-- | O(n) Convert casing to Title Cased Phrase. Subject to
--   fusion.
toTitle :: Text -> Text

-- | O(n) Convert casing to camelCasedPhrase. Subject to
--   fusion.
toCamel :: Text -> Text

-- | O(n) Convert casing to PascalCasePhrase. Subject to
--   fusion.
toPascal :: Text -> Text

-- | O(n) Convert casing to snake_cased_phrase. Subject to
--   fusion.
toSnake :: Text -> Text

-- | O(n) Convert casing to spinal-cased-phrase. Subject to
--   fusion.
toSpinal :: Text -> Text

-- | O(n) Convert casing to Train-Cased-Phrase. Subject to
--   fusion.
toTrain :: Text -> Text

-- | Returns True for any boundary character.
isBoundary :: Char -> Bool

-- | Returns True for any boundary or uppercase character.
isWordBoundary :: Char -> Bool

-- | Manipulate identifiers and structurally non-complex pieces of text by
--   delimiting word boundaries via a combination of whitespace,
--   control-characters, and case-sensitivity.
--   
--   Assumptions have been made about word boundary characteristics
--   inherint in predominantely English text, please see individual
--   function documentation for further details and behaviour.
module Data.Text.Manipulate

-- | O(n) Returns the first word, or the original text if no word boundary
--   is encountered. Subject to fusion.
takeWord :: Text -> Text

-- | O(n) Return the suffix after dropping the first word. If no word
--   boundary is encountered, the result will be empty. Subject to
--   fusion.
dropWord :: Text -> Text

-- | O(n) Return the suffix after removing the first word, or
--   Nothing if no word boundary is encountered.
--   
--   
--   >>> stripWord "HTML5Spaghetti"
--   Just "Spaghetti"
--   
--   
--   
--   >>> stripWord "noboundaries"
--   Nothing
--   
stripWord :: Text -> Maybe Text

-- | Break a piece of text after the first word boundary is encountered.
--   
--   
--   >>> breakWord "PascalCasedVariable"
--   ("Pacal", "CasedVariable")
--   
--   
--   
--   >>> breakWord "spinal-cased-variable"
--   ("spinal", "cased-variable")
--   
breakWord :: Text -> (Text, Text)

-- | O(n) Split into a list of words delimited by boundaries.
--   
--   
--   >>> splitWords "SupercaliFrag_ilistic"
--   ["Supercali","Frag","ilistic"]
--   
splitWords :: Text -> [Text]

-- | Lowercase the first character of a piece of text.
--   
--   
--   >>> lowerHead "Title Cased"
--   "title Cased"
--   
lowerHead :: Text -> Text

-- | Uppercase the first character of a piece of text.
--   
--   
--   >>> upperHead "snake_cased"
--   "Snake_cased"
--   
upperHead :: Text -> Text

-- | Apply a function to the first character of a piece of text.
mapHead :: (Char -> Char) -> Text -> Text

-- | Indent newlines by the given number of spaces.
--   
--   See: prependLines
indentLines :: Int -> Text -> Text

-- | Prepend newlines with the given separator
prependLines :: Text -> Text -> Text

-- | O(n) Truncate text to a specific length. If the text was truncated the
--   ellipsis sign "..." will be appended.
--   
--   See: toEllipsisWith
toEllipsis :: Int -> Text -> Text

-- | O(n) Truncate text to a specific length. If the text was truncated the
--   given ellipsis sign will be appended.
toEllipsisWith :: Int -> Text -> Text -> Text

-- | O(n) Create an adhoc acronym from a piece of cased text.
--   
--   
--   >>> toAcronym "AmazonWebServices"
--   Just "AWS"
--   
--   
--   
--   >>> toAcronym "Learn-You Some_Haskell"
--   Just "LYSH"
--   
--   
--   
--   >>> toAcronym "this_is_all_lowercase"
--   Nothing
--   
toAcronym :: Text -> Maybe Text

-- | Render an ordinal used to denote the position in an ordered sequence.
--   
--   
--   >>> toOrdinal (101 :: Int)
--   "101st"
--   
--   
--   
--   >>> toOrdinal (12 :: Int)
--   "12th"
--   
toOrdinal :: Integral a => a -> Text

-- | O(n) Convert casing to Title Cased Phrase. Subject to
--   fusion.
toTitle :: Text -> Text

-- | O(n) Convert casing to camelCasedPhrase. Subject to
--   fusion.
toCamel :: Text -> Text

-- | O(n) Convert casing to PascalCasePhrase. Subject to
--   fusion.
toPascal :: Text -> Text

-- | O(n) Convert casing to snake_cased_phrase. Subject to
--   fusion.
toSnake :: Text -> Text

-- | O(n) Convert casing to spinal-cased-phrase. Subject to
--   fusion.
toSpinal :: Text -> Text

-- | O(n) Convert casing to Train-Cased-Phrase. Subject to
--   fusion.
toTrain :: Text -> Text

-- | Returns True for any boundary character.
isBoundary :: Char -> Bool

-- | Returns True for any boundary or uppercase character.
isWordBoundary :: Char -> Bool
