| Safe Haskell | None | 
|---|---|
| Language | Haskell2010 | 
Agda.Utils.String
Contents
Synopsis
- quote :: String -> String
 - haskellStringLiteral :: String -> String
 - delimiter :: String -> String
 - addFinalNewLine :: String -> String
 - indent :: Integral i => i -> String -> String
 - unwords1 :: [String] -> String
 - pluralS :: Sized a => a -> String -> String
 - showThousandSep :: Show a => a -> String
 - ltrim :: String -> String
 - rtrim :: String -> String
 - trim :: String -> String
 
Documentation
quote :: String -> String Source #
quote adds double quotes around the string, replaces newline
 characters with n, and escapes double quotes and backslashes
 within the string. This is different from the behaviour of show:
>putStrLn$show"\x2200" "\8704" >putStrLn$quote"\x2200" "∀"
(The code examples above have been tested using version 4.2.0.0 of the base library.)
haskellStringLiteral :: String -> String Source #
Turns the string into a Haskell string literal, avoiding escape codes.
delimiter :: String -> String Source #
Adds hyphens around the given string
>>>putStrLn $ delimiter "Title"———— Title —————————————————————————————————————————————————
addFinalNewLine :: String -> String Source #
Adds a final newline if there is not already one.
pluralS :: Sized a => a -> String -> String Source #
Append an "s" to the second argument if the first has cardinality /= 1.
showThousandSep :: Show a => a -> String Source #
Show a number using comma to separate powers of 1,000.
Orphan instances
| IsString String1 Source # | |
Methods fromString :: String -> String1 #  | |
| (IsString (m a), Monad m) => IsString (MaybeT m a) Source # | |
Methods fromString :: String -> MaybeT m a #  | |
| (IsString (m a), Monad m) => IsString (ExceptT e m a) Source # | |
Methods fromString :: String -> ExceptT e m a #  | |
| (IsString (m a), Monad m) => IsString (ReaderT r m a) Source # | |
Methods fromString :: String -> ReaderT r m a #  | |
| (IsString (m a), Monad m) => IsString (StateT s m a) Source # | |
Methods fromString :: String -> StateT s m a #  | |
| (IsString (m a), Monad m, Monoid w) => IsString (WriterT w m a) Source # | |
Methods fromString :: String -> WriterT w m a #  | |