-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Text formatting -- -- A text formatting library optimized for both ease of use and high -- performance. @package text-format @version 0.3.0.4 -- | 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 -- | 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 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 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 :: (MonadIO m, Params ps) => Format -> ps -> m () -- | Render a format string and arguments, then print the result to the -- given file handle. hprint :: (MonadIO m, Params ps) => Handle -> Format -> ps -> m () -- | 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. right :: Buildable a => Int -> Char -> a -> Builder -- | Render an integer using hexadecimal notation. (No leading 0x is -- added.) hex :: Integral a => a -> Builder -- | Render a floating point number using scientific/engineering notation -- (e.g. 2.3e123), with the given number of decimal places. expt :: Real a => Int -> a -> Builder -- | Render a floating point number using normal notation, with the given -- number of decimal places. fixed :: Real a => Int -> a -> Builder -- | Render a floating point number, with the given number of digits of -- precision. Uses decimal notation for values between 0.1 and -- 9,999,999, and scientific notation otherwise. prec :: Real a => Int -> a -> Builder -- | Render a floating point number using the smallest number of digits -- that correctly represent it. shortest :: Real a => a -> Builder