-- 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. <i>Subject to fusion.</i>
takeWord :: Text -> Text

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

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

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

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

-- | Lowercase the first character of a piece of text.
--   
--   <pre>
--   &gt;&gt;&gt; lowerHead "Title Cased"
--   "title Cased"
--   </pre>
lowerHead :: Text -> Text

-- | Uppercase the first character of a piece of text.
--   
--   <pre>
--   &gt;&gt;&gt; upperHead "snake_cased"
--   "Snake_cased"
--   </pre>
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.
--   
--   <i>See:</i> <a>toEllipsisWith</a>
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.
--   
--   <pre>
--   &gt;&gt;&gt; toAcronym "AmazonWebServices"
--   Just "AWS"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; toAcronym "Learn-You Some_Haskell"
--   Just "LYSH"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; toAcronym "this_is_all_lowercase"
--   Nothing
--   </pre>
toAcronym :: Text -> Maybe Text

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

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

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

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

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

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

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

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

-- | Returns <a>True</a> 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. <i>Subject to fusion.</i>
takeWord :: Text -> Text

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

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

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

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

-- | Lowercase the first character of a piece of text.
--   
--   <pre>
--   &gt;&gt;&gt; lowerHead "Title Cased"
--   "title Cased"
--   </pre>
lowerHead :: Text -> Text

-- | Uppercase the first character of a piece of text.
--   
--   <pre>
--   &gt;&gt;&gt; upperHead "snake_cased"
--   "Snake_cased"
--   </pre>
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.
--   
--   <i>See:</i> <a>prependLines</a>
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.
--   
--   <i>See:</i> <a>toEllipsisWith</a>
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.
--   
--   <pre>
--   &gt;&gt;&gt; toAcronym "AmazonWebServices"
--   Just "AWS"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; toAcronym "Learn-You Some_Haskell"
--   Just "LYSH"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; toAcronym "this_is_all_lowercase"
--   Nothing
--   </pre>
toAcronym :: Text -> Maybe Text

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

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

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

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

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

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

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

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

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