|
| Data.String.Combinators | | Portability | Requires OverloadedStrings | | Stability | Stable | | Maintainer | Bas van Dijk <v.dijk.bas@gmail.com> |
|
|
|
|
|
| Description |
| 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.
|
|
| Synopsis |
|
| (<>) :: Monoid s => s -> s -> s | | | mid :: Monoid s => s -> s -> s -> s | | | (<+>) :: (Monoid s, IsString s) => s -> s -> s | | | ($$) :: (Monoid s, IsString s) => s -> s -> s | | | hcat :: Monoid s => [s] -> s | | | hsep :: (Monoid s, IsString s) => [s] -> s | | | vcat :: (Monoid s, IsString s) => [s] -> s | | | punctuate :: Monoid s => s -> [s] -> [s] | | | between :: Monoid s => s -> s -> s -> s | | | paren :: (Monoid s, IsString s) => s -> s | | | brackets :: (Monoid s, IsString s) => s -> s | | | braces :: (Monoid s, IsString s) => s -> s | | | angleBrackets :: (Monoid s, IsString s) => s -> s | | | quotes :: (Monoid s, IsString s) => s -> s | | | doubleQuotes :: (Monoid s, IsString s) => s -> s | | | char :: IsString s => Char -> s | | | semi :: IsString s => s | | | colon :: IsString s => s | | | comma :: IsString s => s | | | space :: IsString s => s | | | newline :: IsString s => s | | | equals :: IsString s => s | | | lparen :: IsString s => s | | | rparen :: IsString s => s | | | lbrack :: IsString s => s | | | rbrack :: IsString s => s | | | lbrace :: IsString s => s | | | rbrace :: IsString s => s | | | labrack :: IsString s => s | | | rabrack :: IsString s => s | | | 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 |
|
|
|
| Combining
|
|
|
| Put two strings besides eachother.
Note that <> is just a synonym for mappend.
|
|
|
| mid m x y Puts x and y around m.
Note that: mid m x y = between x y m
|
|
|
| Put two strings besides eachother separated by a space.
|
|
|
| Put two strings above eachother.
|
|
|
| List version of <>
|
|
|
| List version of <+>
|
|
|
| List version of $$
|
|
|
punctuate p [d1, ... dn] = [d1 <> p, d2 <> p, ... dn-1 <> p, dn] |
|
| Wrapping in delimiters
|
|
|
| between b c s wraps the string s between b and c
|
|
|
| wrap a string in (...)
|
|
|
| wrap a string in [...]
|
|
|
| wrap a string in {...}
|
|
|
| wrap a string in <...>
|
|
|
| wrap a string in '...'
|
|
|
| wrap a string in "..."
|
|
| From characters
|
|
|
| convert a character to a string
|
|
|
| A ';' character
|
|
|
| A ':' character
|
|
|
| A ',' character
|
|
|
| A ' ' character
|
|
|
| A '\n' character
|
|
|
| A '=' character
|
|
|
| A '(' character
|
|
|
| A ')' character
|
|
|
| A '[' character
|
|
|
| A ']' character
|
|
|
| A '{' character
|
|
|
| A '}' character
|
|
|
| A '<' character
|
|
|
| A '>' character
|
|
| From showable values
|
|
|
| Convert a Show-able value to a string.
fromShow = fromString . show
|
|
|
|
|
|
|
|
|
|
|
|
| Produced by Haddock version 2.4.2 |