-- 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 stringlike values. -- -- All functions are polymorphic in their string type but usually have a -- Monoid or IsString constraint. -- -- Conditionally a module Data.String.Stringable is provided. This module -- exports a typeclass Stringable for converting values to and from -- Strings. A bunch of instances is defined for some common stringlike -- types. @package string-combinators @version 0.1 -- | Note that I am thinking about putting some of the combinators -- ((<>), (<+>), ($$) and maybe more) in -- a type class. This allows the 'pretty' package to use this package. module Data.String.Combinators -- | Put two strings besides eachother. Note that <> is just a -- synonym for 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 strings besides eachother separated by a space. (<+>) :: (Monoid s, IsString s) => s -> s -> s -- | Put two strings above eachother. ($$) :: (Monoid s, IsString s) => s -> s -> s -- | List version of <> hcat :: (Monoid s) => [s] -> s -- | List version of <+> hsep :: (Monoid s, IsString s) => [s] -> s -- | List version of $$ vcat :: (Monoid s, IsString s) => [s] -> s -- |
-- punctuate p [d1, ... dn] = [d1 <> p, d2 <> p, ... dn-1 <> p, dn] --punctuate :: (Monoid s) => s -> [s] -> [s] -- | between b c s wraps the string s between b -- and c between :: (Monoid s) => s -> s -> (s -> s) -- | wrap a string in (...) paren :: (Monoid s, IsString s) => s -> s -- | wrap a string in [...] brackets :: (Monoid s, IsString s) => s -> s -- | wrap a string in {...} braces :: (Monoid s, IsString s) => s -> s -- | wrap a string in <...> angleBrackets :: (Monoid s, IsString s) => s -> s -- | wrap a string in '...' quotes :: (Monoid s, IsString s) => s -> s -- | wrap a string in "..." doubleQuotes :: (Monoid s, IsString s) => s -> s -- | convert a character to a string 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 Show-able value to a string. fromShow = fromString . -- show fromShow :: (Show a, IsString s) => a -> s int :: (IsString s) => Int -> s integer :: (IsString s) => Integer -> s float :: (IsString s) => Float -> s double :: (IsString s) => Double -> s rational :: (IsString s) => Rational -> s module Data.String.Stringable -- | Class of types that can be converted to and from a String. class (IsString s) => Stringable s toString :: (Stringable s) => s -> String instance IsString Doc instance IsString ShowS instance Stringable Text instance Stringable DString instance Stringable ShowS instance Stringable Doc instance Stringable ByteString instance Stringable String