-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Text formatting -- -- A text formatting library optimized for ease of use and high -- performance. @package text-format @version 0.2.0.0 -- | Types for text mangling. module Data.Text.Format.Types -- | 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. data Format -- | Use this newtype wrapper for your single parameter if you are -- formatting a string containing exactly one substitution site. newtype Only a Only :: a -> Only a fromOnly :: Only a -> a -- | Render a value using its Show instance. newtype Shown a Shown :: a -> Shown a shown :: Shown a -> a -- | Render an integral type in hexadecimal. newtype Hex a Hex :: a -> Hex a -- | A floating point number, complete with rendering instructions. data FPControl a -- | Render a floating point number using a much faster algorithm than the -- default (up to 10x faster). This performance comes with a potential -- cost in readability, as the faster algorithm can produce strings that -- are longer than the default algorithm (e.g. -- "1.3300000000000001" instead of "1.33"). newtype Fast a Fast :: a -> Fast a fromFast :: Fast a -> a -- | Class for specifying display parameters. The type a is -- supposed to be an IEEE-ish (real) floating-point type with -- floating-point radix 2, such that the mantissa returned by -- decodeFloat satisfies -- --
--   2^(binExp x) <= fst (decodeFloat x) < 2^(binExp x + 1)
--   
-- -- for x > 0, so binExp x = floatDigits x - -- 1. The number of decimal digits that may be required is -- calculated with the formula -- --
--   decDigits x = 2 + floor (floatDigits x * logBase 10 2).
--   
-- -- The default implementation uses an approximation of logBase -- 10 2 sufficient for mantissae of up to several thousand bits. -- Nevertheless, hardcoding the values in instance declarations may yield -- better performance. class RealFloat a => DispFloat a -- | Types that can be rendered to a Builder. module Data.Text.Buildable -- | The class of types that can be rendered to a Builder. class Buildable p build :: Buildable p => p -> Builder instance Buildable (Ptr a) instance Buildable WordPtr instance Buildable IntPtr instance Buildable ZonedTime instance Buildable LocalTime instance Buildable TimeZone instance Buildable TimeOfDay instance Show a => Buildable (Shown a) instance Buildable Day instance Buildable UniversalTime instance Buildable UTCTime instance Buildable NominalDiffTime instance Buildable DiffTime instance (RealFloat a, DispFloat a) => Buildable (Fast (FPControl a)) instance (RealFloat a, DispFloat a) => Buildable (Fast a) instance RealFloat a => Buildable (FPControl a) instance Buildable Double instance Buildable Float instance (Integral a, Buildable a) => Buildable (Ratio a) instance Buildable Word64 instance Buildable Word instance Buildable Word32 instance Buildable Word16 instance Buildable Word8 instance Buildable Integer instance Buildable Int64 instance Buildable Int instance Buildable Int32 instance Buildable Int16 instance Buildable Int8 instance Integral a => Buildable (Hex a) instance Buildable [Char] instance Buildable Char instance Buildable Text instance Buildable Text instance Buildable Builder -- | Types that can be used as a collection of arguments for formatting. module Data.Text.Format.Params -- | The class of types that can be used as a collection of arguments for -- formatting. class Params ps buildParams :: Params ps => ps -> [Builder] instance (Buildable a, Buildable b, Buildable c, Buildable d, Buildable e, Buildable f, Buildable g, Buildable h, Buildable i, Buildable j) => Params (a, b, c, d, e, f, g, h, i, j) instance (Buildable a, Buildable b, Buildable c, Buildable d, Buildable e, Buildable f, Buildable g, Buildable h, Buildable i) => Params (a, b, c, d, e, f, g, h, i) instance (Buildable a, Buildable b, Buildable c, Buildable d, Buildable e, Buildable f, Buildable g, Buildable h) => Params (a, b, c, d, e, f, g, h) instance (Buildable a, Buildable b, Buildable c, Buildable d, Buildable e, Buildable f, Buildable g) => Params (a, b, c, d, e, f, g) instance (Buildable a, Buildable b, Buildable c, Buildable d, Buildable e, Buildable f) => Params (a, b, c, d, e, f) instance (Buildable a, Buildable b, Buildable c, Buildable d, Buildable e) => Params (a, b, c, d, e) instance (Buildable a, Buildable b, Buildable c, Buildable d) => Params (a, b, c, d) instance (Buildable a, Buildable b, Buildable c) => Params (a, b, c) instance (Buildable a, Buildable b) => Params (a, b) instance Buildable a => Params [a] instance Buildable a => Params (Only a) instance Params () -- | Fast, efficient, flexible support for formatting text strings. module Data.Text.Format -- | 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. data Format -- | Use this newtype wrapper for your single parameter if you are -- formatting a string containing exactly one substitution site. newtype Only a Only :: a -> Only a fromOnly :: Only a -> a -- | Render a floating point number using a much faster algorithm than the -- default (up to 10x faster). This performance comes with a potential -- cost in readability, as the faster algorithm can produce strings that -- are longer than the default algorithm (e.g. -- "1.3300000000000001" instead of "1.33"). newtype Fast a Fast :: a -> Fast a fromFast :: Fast a -> a -- | Render a value using its Show instance. newtype Shown a Shown :: a -> Shown a shown :: Shown a -> a -- | Render a format string and arguments to a Text. format :: Params ps => Format -> ps -> Text -- | Render a format string and arguments, then print the result. print :: Params ps => Format -> ps -> IO () -- | Render a format string and arguments, then print the result to the -- given file handle. hprint :: Params ps => Handle -> Format -> ps -> IO () -- | Render a format string and arguments to a Builder. build :: Params ps => Format -> ps -> Builder -- | Pad the left hand side of a string until it reaches k -- characters wide, if necessary filling with character c. left :: Buildable a => Int -> Char -> a -> Builder -- | Pad the right hand side of a string until it reaches k -- characters wide, if necessary filling with character c. -- -- Render a floating point number using normal notation, with the given -- number of decimal places. right :: Buildable a => Int -> Char -> a -> Builder hex :: Integral a => a -> Builder -- | Render a floating point number using scientific/engineering notation -- (e.g. 2.3e123). expt :: (Buildable a, RealFloat a) => Int -> a -> Builder -- | Render an integer using hexadecimal notation. (No leading 0x is -- added.) expt_ :: (Buildable a, RealFloat a) => a -> Builder -- | Render a floating point number using normal notation. fixed :: (Buildable a, RealFloat a) => Int -> a -> Builder -- | Render a floating point number using scientific/engineering notation -- (e.g. 2.3e123), with the given number of decimal places. fixed_ :: (Buildable a, RealFloat a) => a -> Builder