text-format-0.3.2.1: Text formatting
Copyright(c) 2011 MailRank Inc.
LicenseBSD-style
Maintainerbos@serpentine.com
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell98

Data.Text.Format.Types

Description

Types for text mangling.

Synopsis

Documentation

data Format Source #

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.

newtype Only a Source #

Use this newtype wrapper for your single parameter if you are formatting a string containing exactly one substitution site.

Constructors

Only 

Fields

Instances

Instances details
Bounded a => Bounded (Only a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Enum a => Enum (Only a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Methods

succ :: Only a -> Only a Source #

pred :: Only a -> Only a Source #

toEnum :: Int -> Only a Source #

fromEnum :: Only a -> Int Source #

enumFrom :: Only a -> [Only a] Source #

enumFromThen :: Only a -> Only a -> [Only a] Source #

enumFromTo :: Only a -> Only a -> [Only a] Source #

enumFromThenTo :: Only a -> Only a -> Only a -> [Only a] Source #

Eq a => Eq (Only a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Methods

(==) :: Only a -> Only a -> Bool Source #

(/=) :: Only a -> Only a -> Bool Source #

Floating a => Floating (Only a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Methods

pi :: Only a Source #

exp :: Only a -> Only a Source #

log :: Only a -> Only a Source #

sqrt :: Only a -> Only a Source #

(**) :: Only a -> Only a -> Only a Source #

logBase :: Only a -> Only a -> Only a Source #

sin :: Only a -> Only a Source #

cos :: Only a -> Only a Source #

tan :: Only a -> Only a Source #

asin :: Only a -> Only a Source #

acos :: Only a -> Only a Source #

atan :: Only a -> Only a Source #

sinh :: Only a -> Only a Source #

cosh :: Only a -> Only a Source #

tanh :: Only a -> Only a Source #

asinh :: Only a -> Only a Source #

acosh :: Only a -> Only a Source #

atanh :: Only a -> Only a Source #

log1p :: Only a -> Only a Source #

expm1 :: Only a -> Only a Source #

log1pexp :: Only a -> Only a Source #

log1mexp :: Only a -> Only a Source #

Fractional a => Fractional (Only a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Methods

(/) :: Only a -> Only a -> Only a Source #

recip :: Only a -> Only a Source #

fromRational :: Rational -> Only a Source #

Integral a => Integral (Only a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Methods

quot :: Only a -> Only a -> Only a Source #

rem :: Only a -> Only a -> Only a Source #

div :: Only a -> Only a -> Only a Source #

mod :: Only a -> Only a -> Only a Source #

quotRem :: Only a -> Only a -> (Only a, Only a) Source #

divMod :: Only a -> Only a -> (Only a, Only a) Source #

toInteger :: Only a -> Integer Source #

Num a => Num (Only a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Methods

(+) :: Only a -> Only a -> Only a Source #

(-) :: Only a -> Only a -> Only a Source #

(*) :: Only a -> Only a -> Only a Source #

negate :: Only a -> Only a Source #

abs :: Only a -> Only a Source #

signum :: Only a -> Only a Source #

fromInteger :: Integer -> Only a Source #

Ord a => Ord (Only a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Methods

compare :: Only a -> Only a -> Ordering Source #

(<) :: Only a -> Only a -> Bool Source #

(<=) :: Only a -> Only a -> Bool Source #

(>) :: Only a -> Only a -> Bool Source #

(>=) :: Only a -> Only a -> Bool Source #

max :: Only a -> Only a -> Only a Source #

min :: Only a -> Only a -> Only a Source #

Read a => Read (Only a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Real a => Real (Only a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

RealFloat a => RealFloat (Only a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

RealFrac a => RealFrac (Only a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Methods

properFraction :: Integral b => Only a -> (b, Only a) Source #

truncate :: Integral b => Only a -> b Source #

round :: Integral b => Only a -> b Source #

ceiling :: Integral b => Only a -> b Source #

floor :: Integral b => Only a -> b Source #

Show a => Show (Only a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Methods

showsPrec :: Int -> Only a -> ShowS Source #

show :: Only a -> String Source #

showList :: [Only a] -> ShowS Source #

Buildable a => Params (Only a) Source # 
Instance details

Defined in Data.Text.Format.Params

Methods

buildParams :: Only a -> [Builder] Source #

newtype Shown a Source #

Render a value using its Show instance.

Constructors

Shown 

Fields

Instances

Instances details
Bounded a => Bounded (Shown a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Enum a => Enum (Shown a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Methods

succ :: Shown a -> Shown a Source #

pred :: Shown a -> Shown a Source #

toEnum :: Int -> Shown a Source #

fromEnum :: Shown a -> Int Source #

enumFrom :: Shown a -> [Shown a] Source #

enumFromThen :: Shown a -> Shown a -> [Shown a] Source #

enumFromTo :: Shown a -> Shown a -> [Shown a] Source #

enumFromThenTo :: Shown a -> Shown a -> Shown a -> [Shown a] Source #

Eq a => Eq (Shown a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Methods

(==) :: Shown a -> Shown a -> Bool Source #

(/=) :: Shown a -> Shown a -> Bool Source #

Floating a => Floating (Shown a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Methods

pi :: Shown a Source #

exp :: Shown a -> Shown a Source #

log :: Shown a -> Shown a Source #

sqrt :: Shown a -> Shown a Source #

(**) :: Shown a -> Shown a -> Shown a Source #

logBase :: Shown a -> Shown a -> Shown a Source #

sin :: Shown a -> Shown a Source #

cos :: Shown a -> Shown a Source #

tan :: Shown a -> Shown a Source #

asin :: Shown a -> Shown a Source #

acos :: Shown a -> Shown a Source #

atan :: Shown a -> Shown a Source #

sinh :: Shown a -> Shown a Source #

cosh :: Shown a -> Shown a Source #

tanh :: Shown a -> Shown a Source #

asinh :: Shown a -> Shown a Source #

acosh :: Shown a -> Shown a Source #

atanh :: Shown a -> Shown a Source #

log1p :: Shown a -> Shown a Source #

expm1 :: Shown a -> Shown a Source #

log1pexp :: Shown a -> Shown a Source #

log1mexp :: Shown a -> Shown a Source #

Fractional a => Fractional (Shown a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Methods

(/) :: Shown a -> Shown a -> Shown a Source #

recip :: Shown a -> Shown a Source #

fromRational :: Rational -> Shown a Source #

Integral a => Integral (Shown a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Methods

quot :: Shown a -> Shown a -> Shown a Source #

rem :: Shown a -> Shown a -> Shown a Source #

div :: Shown a -> Shown a -> Shown a Source #

mod :: Shown a -> Shown a -> Shown a Source #

quotRem :: Shown a -> Shown a -> (Shown a, Shown a) Source #

divMod :: Shown a -> Shown a -> (Shown a, Shown a) Source #

toInteger :: Shown a -> Integer Source #

Num a => Num (Shown a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Methods

(+) :: Shown a -> Shown a -> Shown a Source #

(-) :: Shown a -> Shown a -> Shown a Source #

(*) :: Shown a -> Shown a -> Shown a Source #

negate :: Shown a -> Shown a Source #

abs :: Shown a -> Shown a Source #

signum :: Shown a -> Shown a Source #

fromInteger :: Integer -> Shown a Source #

Ord a => Ord (Shown a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Methods

compare :: Shown a -> Shown a -> Ordering Source #

(<) :: Shown a -> Shown a -> Bool Source #

(<=) :: Shown a -> Shown a -> Bool Source #

(>) :: Shown a -> Shown a -> Bool Source #

(>=) :: Shown a -> Shown a -> Bool Source #

max :: Shown a -> Shown a -> Shown a Source #

min :: Shown a -> Shown a -> Shown a Source #

Read a => Read (Shown a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Real a => Real (Shown a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

RealFloat a => RealFloat (Shown a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

RealFrac a => RealFrac (Shown a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Methods

properFraction :: Integral b => Shown a -> (b, Shown a) Source #

truncate :: Integral b => Shown a -> b Source #

round :: Integral b => Shown a -> b Source #

ceiling :: Integral b => Shown a -> b Source #

floor :: Integral b => Shown a -> b Source #

Show a => Show (Shown a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Show a => Buildable (Shown a) Source # 
Instance details

Defined in Data.Text.Buildable

Methods

build :: Shown a -> Builder Source #

Integer format control

newtype Hex a Source #

Render an integral type in hexadecimal.

Constructors

Hex a 

Instances

Instances details
Enum a => Enum (Hex a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Methods

succ :: Hex a -> Hex a Source #

pred :: Hex a -> Hex a Source #

toEnum :: Int -> Hex a Source #

fromEnum :: Hex a -> Int Source #

enumFrom :: Hex a -> [Hex a] Source #

enumFromThen :: Hex a -> Hex a -> [Hex a] Source #

enumFromTo :: Hex a -> Hex a -> [Hex a] Source #

enumFromThenTo :: Hex a -> Hex a -> Hex a -> [Hex a] Source #

Eq a => Eq (Hex a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Methods

(==) :: Hex a -> Hex a -> Bool Source #

(/=) :: Hex a -> Hex a -> Bool Source #

Integral a => Integral (Hex a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Methods

quot :: Hex a -> Hex a -> Hex a Source #

rem :: Hex a -> Hex a -> Hex a Source #

div :: Hex a -> Hex a -> Hex a Source #

mod :: Hex a -> Hex a -> Hex a Source #

quotRem :: Hex a -> Hex a -> (Hex a, Hex a) Source #

divMod :: Hex a -> Hex a -> (Hex a, Hex a) Source #

toInteger :: Hex a -> Integer Source #

Num a => Num (Hex a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Methods

(+) :: Hex a -> Hex a -> Hex a Source #

(-) :: Hex a -> Hex a -> Hex a Source #

(*) :: Hex a -> Hex a -> Hex a Source #

negate :: Hex a -> Hex a Source #

abs :: Hex a -> Hex a Source #

signum :: Hex a -> Hex a Source #

fromInteger :: Integer -> Hex a Source #

Ord a => Ord (Hex a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Methods

compare :: Hex a -> Hex a -> Ordering Source #

(<) :: Hex a -> Hex a -> Bool Source #

(<=) :: Hex a -> Hex a -> Bool Source #

(>) :: Hex a -> Hex a -> Bool Source #

(>=) :: Hex a -> Hex a -> Bool Source #

max :: Hex a -> Hex a -> Hex a Source #

min :: Hex a -> Hex a -> Hex a Source #

Read a => Read (Hex a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Real a => Real (Hex a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Methods

toRational :: Hex a -> Rational Source #

Show a => Show (Hex a) Source # 
Instance details

Defined in Data.Text.Format.Types.Internal

Methods

showsPrec :: Int -> Hex a -> ShowS Source #

show :: Hex a -> String Source #

showList :: [Hex a] -> ShowS Source #

Integral a => Buildable (Hex a) Source # 
Instance details

Defined in Data.Text.Buildable

Methods

build :: Hex a -> Builder Source #