-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Polymorphic functions to build and combine stringlike values -- -- string-combinators provides handy polymorphic functions to -- build and combine string-like values. -- -- All functions are polymorphic in their string-like type but usually -- have a Monoid or IsString constraint. @package string-combinators @version 0.6.0.2 module Data.String.Combinators -- | Put two string-likes besides eachother. -- -- Note that: <> = mappend. (<>) :: Monoid s => s -> s -> s -- | mid m x y Puts x and y around m. -- -- Note that: mid m x y = between x y m. mid :: Monoid s => s -> (s -> s -> s) -- | Put two string-likes besides eachother separated by a space. (<+>) :: (Monoid s, IsString s) => s -> s -> s -- | Put two string-likes above eachother (separated by a newline). ($$) :: (Monoid s, IsString s) => s -> s -> s -- | Combine the string-likes with a given function. -- --
--   intercalate f [s1, ... sn] = s1 `f` (s2 `f` (... (sn-1 `f` sn)))
--   
intercalate :: Monoid s => (s -> s -> s) -> [s] -> s -- | List version of <>. -- -- Note that: hcat = intercalate (<>). hcat :: Monoid s => [s] -> s -- | List version of <+>. -- -- Note that: unwords = intercalate (<+>). unwords :: (Monoid s, IsString s) => [s] -> s -- | List version of $$. -- -- Note that: unlines = foldr ($$) mempty unlines :: (Monoid s, IsString s) => [s] -> s -- | punctuate p [s1, ... sn] = [s1 <> p, s2 -- <> p, ... sn-1 <> p, sn]. -- -- (Idea and implementation taken from the pretty package.) punctuate :: Monoid s => s -> [s] -> [s] -- | between b c s wraps the string-like s between -- b and c. between :: Monoid s => s -> s -> (s -> s) -- | Wrap a string-like in (...). parens :: (Monoid s, IsString s) => s -> s -- | Like showParen conditionally wraps a string-like in -- (...) -- -- This function is supposed to be used infix as in: -- --
--   (precedence >= 10) `thenParens` ("fun" <+> "arg")
--   
thenParens :: (Monoid s, IsString s) => Bool -> s -> s -- | Wrap a string-like in [...]. brackets :: (Monoid s, IsString s) => s -> s -- | Wrap a string-like in {...}. braces :: (Monoid s, IsString s) => s -> s -- | Wrap a string-like in <...>. angleBrackets :: (Monoid s, IsString s) => s -> s -- | Wrap a string-like in '...'. quotes :: (Monoid s, IsString s) => s -> s -- | Wrap a string-like in "...". doubleQuotes :: (Monoid s, IsString s) => s -> s -- | Convert a character to a string-like. char :: IsString s => Char -> s -- | A ';' character. semi :: IsString s => s -- | A : character. colon :: IsString s => s -- | A ',' character. comma :: IsString s => s -- | A ' ' character. space :: IsString s => s -- | A '\n' character. newline :: IsString s => s -- | A '=' character. equals :: IsString s => s -- | A '(' character. lparen :: IsString s => s -- | A ')' character. rparen :: IsString s => s -- | A '[' character. lbrack :: IsString s => s -- | A ']' character. rbrack :: IsString s => s -- | A '{' character. lbrace :: IsString s => s -- | A '}' character. rbrace :: IsString s => s -- | A '<' character. labrack :: IsString s => s -- | A '>' character. rabrack :: IsString s => s -- | Convert a Showable value to a string-like. fromShow :: (Show α, IsString s) => α -> s -- | Convert an Int to a string-like. int :: IsString s => Int -> s -- | Convert an Integer to a string-like. integer :: IsString s => Integer -> s -- | Convert a Float to a string-like. float :: IsString s => Float -> s -- | Convert a Double to a string-like. double :: IsString s => Double -> s -- | Convert a Rational to a string-like. rational :: IsString s => Rational -> s