Copyright | (c) 2011 MailRank Inc. |
---|---|
License | BSD-style |
Maintainer | bos@serpentine.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | Safe-Inferred |
Language | Haskell98 |
Types for text mangling.
Documentation
A format string. This is intentionally incompatible with other string types, to make it difficult to construct a format string by concatenating string fragments (a very common way to accidentally make code vulnerable to malicious data).
This type is an instance of IsString
, so the easiest way to
construct a query is to enable the OverloadedStrings
language
extension and then simply write the query in double quotes.
{-# LANGUAGE OverloadedStrings #-} import Data.Text.Format f :: Format f = "hello {}"
The underlying type is Text
, so literal Haskell strings that
contain Unicode characters will be correctly handled.
Use this newtype
wrapper for your single parameter if you are
formatting a string containing exactly one substitution site.
Instances
Render a value using its Show
instance.
Instances
Integer format control
Render an integral type in hexadecimal.
Hex a |
Instances
Enum a => Enum (Hex a) Source # | |
Defined in Data.Text.Format.Types.Internal | |
Num a => Num (Hex a) Source # | |
Read a => Read (Hex a) Source # | |
Integral a => Integral (Hex a) Source # | |
Real a => Real (Hex a) Source # | |
Defined in Data.Text.Format.Types.Internal toRational :: Hex a -> Rational # | |
Show a => Show (Hex a) Source # | |
Eq a => Eq (Hex a) Source # | |
Ord a => Ord (Hex a) Source # | |
Integral a => Buildable (Hex a) Source # | |