-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Non empty Data.Text type -- -- Typesafe thin wrapper around Data.Text to make impossible to be empty -- (to always hold at least on character) @package non-empty-text @version 0.2.0 module Data.NonEmptyText data NonEmptyText -- | O(1) Create a new NonEmptyText -- --
--   >>> new 'h' "ello world"
--   "hello world"
--   
new :: Char -> Text -> NonEmptyText -- | O(1) Convert a character into a NonEmptyText. -- --
--   >>> singleton 'a'
--   "a"
--   
singleton :: Char -> NonEmptyText -- | O(n) Convert to NonEmptyText to Text. -- -- The Text result is guaranteed to be non-empty. However, this is -- not reflected in the type. toText :: NonEmptyText -> Text -- | O(n) Create a NonEmptyText from Text. -- -- If the original text is empty, this will return Nothing. -- --
--   >>> fromText "hello"
--   Just "hello"
--   
--   >>> fromText ""
--   Nothing
--   
fromText :: Text -> Maybe NonEmptyText -- | O(n) Prefixes the NonEmptyText with one character cons :: Char -> NonEmptyText -> NonEmptyText -- | O(n) Suffixes the NonEmptyText with one character snoc :: NonEmptyText -> Char -> NonEmptyText -- | O(1) Return the first character and the rest of the -- NonEmptyText uncons :: NonEmptyText -> (Char, Text) -- | O(n) Return the beginning of the NonEmptyText, and its -- last character unsnoc :: NonEmptyText -> (Text, Char) -- | O(n) Appends one NonEmptyText to another -- --
--   >>> append <$> fromText "hello," <*> fromText " world."
--   Just "hello, world."
--   
append :: NonEmptyText -> NonEmptyText -> NonEmptyText -- | O(1) Return the first of the NonEmptyText -- -- As opposed to head, this is guaranteed to succeed, as the the -- text is never empty. head :: NonEmptyText -> Char -- | O(1) Return the last character of the NonEmptyText -- -- This never fails. last :: NonEmptyText -> Char -- | O(1) Return all characters of the NonEmptyText but the -- first one tail :: NonEmptyText -> Text -- | O(n) Return all character of the NonEmptyText but the -- last one init :: NonEmptyText -> Text -- | O(n) Return the length of the total NonEmptyText. length :: NonEmptyText -> Int -- | O(n) map f t is the -- NonEmptyText obtained by applying f to each element of -- t. map :: (Char -> Char) -> NonEmptyText -> NonEmptyText -- | O(1) Check if the string is composed of only one character isSingleton :: NonEmptyText -> Bool -- | O(n) foldl1 is a left associative fold with no base -- case, as we know the text cannot be empty. foldl1 :: (Char -> Char -> Char) -> NonEmptyText -> Char -- | O(n) A strict version of foldl1. foldl1' :: (Char -> Char -> Char) -> NonEmptyText -> Char instance GHC.Generics.Generic Data.NonEmptyText.NonEmptyText instance Control.DeepSeq.NFData Data.NonEmptyText.NonEmptyText instance GHC.Classes.Ord Data.NonEmptyText.NonEmptyText instance GHC.Classes.Eq Data.NonEmptyText.NonEmptyText instance GHC.Show.Show Data.NonEmptyText.NonEmptyText instance GHC.Base.Semigroup Data.NonEmptyText.NonEmptyText