-- 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.2.1 -- | Types for text mangling. module Data.Text.Format.Types.Internal -- | 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 Format Format :: Text -> Format [fromFormat] :: Format -> Text -- | 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 instance GHC.Show.Show Data.Text.Format.Types.Internal.Format instance GHC.Classes.Ord Data.Text.Format.Types.Internal.Format instance GHC.Classes.Eq Data.Text.Format.Types.Internal.Format instance GHC.Real.Integral a => GHC.Real.Integral (Data.Text.Format.Types.Internal.Hex a) instance GHC.Enum.Enum a => GHC.Enum.Enum (Data.Text.Format.Types.Internal.Hex a) instance GHC.Real.Real a => GHC.Real.Real (Data.Text.Format.Types.Internal.Hex a) instance GHC.Num.Num a => GHC.Num.Num (Data.Text.Format.Types.Internal.Hex a) instance GHC.Show.Show a => GHC.Show.Show (Data.Text.Format.Types.Internal.Hex a) instance GHC.Read.Read a => GHC.Read.Read (Data.Text.Format.Types.Internal.Hex a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.Text.Format.Types.Internal.Hex a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Text.Format.Types.Internal.Hex a) instance GHC.Enum.Bounded a => GHC.Enum.Bounded (Data.Text.Format.Types.Internal.Only a) instance GHC.Real.Integral a => GHC.Real.Integral (Data.Text.Format.Types.Internal.Only a) instance GHC.Enum.Enum a => GHC.Enum.Enum (Data.Text.Format.Types.Internal.Only a) instance GHC.Float.RealFloat a => GHC.Float.RealFloat (Data.Text.Format.Types.Internal.Only a) instance GHC.Float.Floating a => GHC.Float.Floating (Data.Text.Format.Types.Internal.Only a) instance GHC.Real.RealFrac a => GHC.Real.RealFrac (Data.Text.Format.Types.Internal.Only a) instance GHC.Real.Real a => GHC.Real.Real (Data.Text.Format.Types.Internal.Only a) instance GHC.Real.Fractional a => GHC.Real.Fractional (Data.Text.Format.Types.Internal.Only a) instance GHC.Num.Num a => GHC.Num.Num (Data.Text.Format.Types.Internal.Only a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.Text.Format.Types.Internal.Only a) instance GHC.Read.Read a => GHC.Read.Read (Data.Text.Format.Types.Internal.Only a) instance GHC.Show.Show a => GHC.Show.Show (Data.Text.Format.Types.Internal.Only a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Text.Format.Types.Internal.Only a) instance GHC.Enum.Bounded a => GHC.Enum.Bounded (Data.Text.Format.Types.Internal.Shown a) instance GHC.Real.Integral a => GHC.Real.Integral (Data.Text.Format.Types.Internal.Shown a) instance GHC.Enum.Enum a => GHC.Enum.Enum (Data.Text.Format.Types.Internal.Shown a) instance GHC.Float.RealFloat a => GHC.Float.RealFloat (Data.Text.Format.Types.Internal.Shown a) instance GHC.Float.Floating a => GHC.Float.Floating (Data.Text.Format.Types.Internal.Shown a) instance GHC.Real.RealFrac a => GHC.Real.RealFrac (Data.Text.Format.Types.Internal.Shown a) instance GHC.Real.Real a => GHC.Real.Real (Data.Text.Format.Types.Internal.Shown a) instance GHC.Real.Fractional a => GHC.Real.Fractional (Data.Text.Format.Types.Internal.Shown a) instance GHC.Num.Num a => GHC.Num.Num (Data.Text.Format.Types.Internal.Shown a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.Text.Format.Types.Internal.Shown a) instance GHC.Read.Read a => GHC.Read.Read (Data.Text.Format.Types.Internal.Shown a) instance GHC.Show.Show a => GHC.Show.Show (Data.Text.Format.Types.Internal.Shown a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Text.Format.Types.Internal.Shown a) instance GHC.Base.Semigroup Data.Text.Format.Types.Internal.Format instance GHC.Base.Monoid Data.Text.Format.Types.Internal.Format instance Data.String.IsString Data.Text.Format.Types.Internal.Format -- | 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 Data.Text.Buildable.Buildable Data.Text.Internal.Builder.Builder instance Data.Text.Buildable.Buildable Data.Void.Void instance Data.Text.Buildable.Buildable Data.Text.Internal.Lazy.Text instance Data.Text.Buildable.Buildable Data.Text.Internal.Text instance Data.Text.Buildable.Buildable GHC.Types.Char instance Data.Text.Buildable.Buildable [GHC.Types.Char] instance GHC.Real.Integral a => Data.Text.Buildable.Buildable (Data.Text.Format.Types.Internal.Hex a) instance Data.Text.Buildable.Buildable GHC.Int.Int8 instance Data.Text.Buildable.Buildable GHC.Int.Int16 instance Data.Text.Buildable.Buildable GHC.Int.Int32 instance Data.Text.Buildable.Buildable GHC.Types.Int instance Data.Text.Buildable.Buildable GHC.Int.Int64 instance Data.Text.Buildable.Buildable GHC.Integer.Type.Integer instance Data.Fixed.HasResolution a => Data.Text.Buildable.Buildable (Data.Fixed.Fixed a) instance Data.Text.Buildable.Buildable GHC.Word.Word8 instance Data.Text.Buildable.Buildable GHC.Word.Word16 instance Data.Text.Buildable.Buildable GHC.Word.Word32 instance Data.Text.Buildable.Buildable GHC.Types.Word instance Data.Text.Buildable.Buildable GHC.Word.Word64 instance (GHC.Real.Integral a, Data.Text.Buildable.Buildable a) => Data.Text.Buildable.Buildable (GHC.Real.Ratio a) instance Data.Text.Buildable.Buildable GHC.Types.Float instance Data.Text.Buildable.Buildable GHC.Types.Double instance Data.Text.Buildable.Buildable Data.Time.Clock.Internal.DiffTime.DiffTime instance Data.Text.Buildable.Buildable Data.Time.Clock.Internal.NominalDiffTime.NominalDiffTime instance Data.Text.Buildable.Buildable Data.Time.Clock.Internal.UTCTime.UTCTime instance Data.Text.Buildable.Buildable Data.Time.Clock.Internal.UniversalTime.UniversalTime instance Data.Text.Buildable.Buildable Data.Time.Calendar.Days.Day instance GHC.Show.Show a => Data.Text.Buildable.Buildable (Data.Text.Format.Types.Internal.Shown a) instance Data.Text.Buildable.Buildable a => Data.Text.Buildable.Buildable (GHC.Maybe.Maybe a) instance Data.Text.Buildable.Buildable Data.Time.LocalTime.Internal.TimeOfDay.TimeOfDay instance Data.Text.Buildable.Buildable Data.Time.LocalTime.Internal.TimeZone.TimeZone instance Data.Text.Buildable.Buildable Data.Time.LocalTime.Internal.LocalTime.LocalTime instance Data.Text.Buildable.Buildable Data.Time.LocalTime.Internal.ZonedTime.ZonedTime instance Data.Text.Buildable.Buildable Foreign.Ptr.IntPtr instance Data.Text.Buildable.Buildable Foreign.Ptr.WordPtr instance Data.Text.Buildable.Buildable (GHC.Ptr.Ptr a) instance Data.Text.Buildable.Buildable GHC.Types.Bool -- | 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 Data.Text.Format.Params.Params () instance Data.Text.Buildable.Buildable a => Data.Text.Format.Params.Params (Data.Text.Format.Types.Internal.Only a) instance Data.Text.Buildable.Buildable a => Data.Text.Format.Params.Params [a] instance (Data.Text.Buildable.Buildable a, Data.Text.Buildable.Buildable b) => Data.Text.Format.Params.Params (a, b) instance (Data.Text.Buildable.Buildable a, Data.Text.Buildable.Buildable b, Data.Text.Buildable.Buildable c) => Data.Text.Format.Params.Params (a, b, c) instance (Data.Text.Buildable.Buildable a, Data.Text.Buildable.Buildable b, Data.Text.Buildable.Buildable c, Data.Text.Buildable.Buildable d) => Data.Text.Format.Params.Params (a, b, c, d) instance (Data.Text.Buildable.Buildable a, Data.Text.Buildable.Buildable b, Data.Text.Buildable.Buildable c, Data.Text.Buildable.Buildable d, Data.Text.Buildable.Buildable e) => Data.Text.Format.Params.Params (a, b, c, d, e) instance (Data.Text.Buildable.Buildable a, Data.Text.Buildable.Buildable b, Data.Text.Buildable.Buildable c, Data.Text.Buildable.Buildable d, Data.Text.Buildable.Buildable e, Data.Text.Buildable.Buildable f) => Data.Text.Format.Params.Params (a, b, c, d, e, f) instance (Data.Text.Buildable.Buildable a, Data.Text.Buildable.Buildable b, Data.Text.Buildable.Buildable c, Data.Text.Buildable.Buildable d, Data.Text.Buildable.Buildable e, Data.Text.Buildable.Buildable f, Data.Text.Buildable.Buildable g) => Data.Text.Format.Params.Params (a, b, c, d, e, f, g) instance (Data.Text.Buildable.Buildable a, Data.Text.Buildable.Buildable b, Data.Text.Buildable.Buildable c, Data.Text.Buildable.Buildable d, Data.Text.Buildable.Buildable e, Data.Text.Buildable.Buildable f, Data.Text.Buildable.Buildable g, Data.Text.Buildable.Buildable h) => Data.Text.Format.Params.Params (a, b, c, d, e, f, g, h) instance (Data.Text.Buildable.Buildable a, Data.Text.Buildable.Buildable b, Data.Text.Buildable.Buildable c, Data.Text.Buildable.Buildable d, Data.Text.Buildable.Buildable e, Data.Text.Buildable.Buildable f, Data.Text.Buildable.Buildable g, Data.Text.Buildable.Buildable h, Data.Text.Buildable.Buildable i) => Data.Text.Format.Params.Params (a, b, c, d, e, f, g, h, i) instance (Data.Text.Buildable.Buildable a, Data.Text.Buildable.Buildable b, Data.Text.Buildable.Buildable c, Data.Text.Buildable.Buildable d, Data.Text.Buildable.Buildable e, Data.Text.Buildable.Buildable f, Data.Text.Buildable.Buildable g, Data.Text.Buildable.Buildable h, Data.Text.Buildable.Buildable i, Data.Text.Buildable.Buildable j) => Data.Text.Format.Params.Params (a, b, c, d, e, f, g, h, i, j) instance (Data.Text.Buildable.Buildable a, Data.Text.Buildable.Buildable b, Data.Text.Buildable.Buildable c, Data.Text.Buildable.Buildable d, Data.Text.Buildable.Buildable e, Data.Text.Buildable.Buildable f, Data.Text.Buildable.Buildable g, Data.Text.Buildable.Buildable h, Data.Text.Buildable.Buildable i, Data.Text.Buildable.Buildable j, Data.Text.Buildable.Buildable k) => Data.Text.Format.Params.Params (a, b, c, d, e, f, g, h, i, j, k) instance (Data.Text.Buildable.Buildable a, Data.Text.Buildable.Buildable b, Data.Text.Buildable.Buildable c, Data.Text.Buildable.Buildable d, Data.Text.Buildable.Buildable e, Data.Text.Buildable.Buildable f, Data.Text.Buildable.Buildable g, Data.Text.Buildable.Buildable h, Data.Text.Buildable.Buildable i, Data.Text.Buildable.Buildable j, Data.Text.Buildable.Buildable k, Data.Text.Buildable.Buildable l) => Data.Text.Format.Params.Params (a, b, c, d, e, f, g, h, i, j, k, l) instance (Data.Text.Buildable.Buildable a, Data.Text.Buildable.Buildable b, Data.Text.Buildable.Buildable c, Data.Text.Buildable.Buildable d, Data.Text.Buildable.Buildable e, Data.Text.Buildable.Buildable f, Data.Text.Buildable.Buildable g, Data.Text.Buildable.Buildable h, Data.Text.Buildable.Buildable i, Data.Text.Buildable.Buildable j, Data.Text.Buildable.Buildable k, Data.Text.Buildable.Buildable l, Data.Text.Buildable.Buildable m) => Data.Text.Format.Params.Params (a, b, c, d, e, f, g, h, i, j, k, l, m) instance (Data.Text.Buildable.Buildable a, Data.Text.Buildable.Buildable b, Data.Text.Buildable.Buildable c, Data.Text.Buildable.Buildable d, Data.Text.Buildable.Buildable e, Data.Text.Buildable.Buildable f, Data.Text.Buildable.Buildable g, Data.Text.Buildable.Buildable h, Data.Text.Buildable.Buildable i, Data.Text.Buildable.Buildable j, Data.Text.Buildable.Buildable k, Data.Text.Buildable.Buildable l, Data.Text.Buildable.Buildable m, Data.Text.Buildable.Buildable n) => Data.Text.Format.Params.Params (a, b, c, d, e, f, g, h, i, j, k, l, m, n) instance (Data.Text.Buildable.Buildable a, Data.Text.Buildable.Buildable b, Data.Text.Buildable.Buildable c, Data.Text.Buildable.Buildable d, Data.Text.Buildable.Buildable e, Data.Text.Buildable.Buildable f, Data.Text.Buildable.Buildable g, Data.Text.Buildable.Buildable h, Data.Text.Buildable.Buildable i, Data.Text.Buildable.Buildable j, Data.Text.Buildable.Buildable k, Data.Text.Buildable.Buildable l, Data.Text.Buildable.Buildable m, Data.Text.Buildable.Buildable n, Data.Text.Buildable.Buildable o) => Data.Text.Format.Params.Params (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) instance (Data.Text.Buildable.Buildable a, Data.Text.Buildable.Buildable b, Data.Text.Buildable.Buildable c, Data.Text.Buildable.Buildable d, Data.Text.Buildable.Buildable e, Data.Text.Buildable.Buildable f, Data.Text.Buildable.Buildable g, Data.Text.Buildable.Buildable h, Data.Text.Buildable.Buildable i, Data.Text.Buildable.Buildable j, Data.Text.Buildable.Buildable k, Data.Text.Buildable.Buildable l, Data.Text.Buildable.Buildable m, Data.Text.Buildable.Buildable n, Data.Text.Buildable.Buildable o, Data.Text.Buildable.Buildable p) => Data.Text.Format.Params.Params (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) instance (Data.Text.Buildable.Buildable a, Data.Text.Buildable.Buildable b, Data.Text.Buildable.Buildable c, Data.Text.Buildable.Buildable d, Data.Text.Buildable.Buildable e, Data.Text.Buildable.Buildable f, Data.Text.Buildable.Buildable g, Data.Text.Buildable.Buildable h, Data.Text.Buildable.Buildable i, Data.Text.Buildable.Buildable j, Data.Text.Buildable.Buildable k, Data.Text.Buildable.Buildable l, Data.Text.Buildable.Buildable m, Data.Text.Buildable.Buildable n, Data.Text.Buildable.Buildable o, Data.Text.Buildable.Buildable p, Data.Text.Buildable.Buildable r) => Data.Text.Format.Params.Params (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, r) instance (Data.Text.Buildable.Buildable a, Data.Text.Buildable.Buildable b, Data.Text.Buildable.Buildable c, Data.Text.Buildable.Buildable d, Data.Text.Buildable.Buildable e, Data.Text.Buildable.Buildable f, Data.Text.Buildable.Buildable g, Data.Text.Buildable.Buildable h, Data.Text.Buildable.Buildable i, Data.Text.Buildable.Buildable j, Data.Text.Buildable.Buildable k, Data.Text.Buildable.Buildable l, Data.Text.Buildable.Buildable m, Data.Text.Buildable.Buildable n, Data.Text.Buildable.Buildable o, Data.Text.Buildable.Buildable p, Data.Text.Buildable.Buildable r, Data.Text.Buildable.Buildable s) => Data.Text.Format.Params.Params (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, r, s) instance (Data.Text.Buildable.Buildable a, Data.Text.Buildable.Buildable b, Data.Text.Buildable.Buildable c, Data.Text.Buildable.Buildable d, Data.Text.Buildable.Buildable e, Data.Text.Buildable.Buildable f, Data.Text.Buildable.Buildable g, Data.Text.Buildable.Buildable h, Data.Text.Buildable.Buildable i, Data.Text.Buildable.Buildable j, Data.Text.Buildable.Buildable k, Data.Text.Buildable.Buildable l, Data.Text.Buildable.Buildable m, Data.Text.Buildable.Buildable n, Data.Text.Buildable.Buildable o, Data.Text.Buildable.Buildable p, Data.Text.Buildable.Buildable r, Data.Text.Buildable.Buildable s, Data.Text.Buildable.Buildable t) => Data.Text.Format.Params.Params (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, r, s, t) instance (Data.Text.Buildable.Buildable a, Data.Text.Buildable.Buildable b, Data.Text.Buildable.Buildable c, Data.Text.Buildable.Buildable d, Data.Text.Buildable.Buildable e, Data.Text.Buildable.Buildable f, Data.Text.Buildable.Buildable g, Data.Text.Buildable.Buildable h, Data.Text.Buildable.Buildable i, Data.Text.Buildable.Buildable j, Data.Text.Buildable.Buildable k, Data.Text.Buildable.Buildable l, Data.Text.Buildable.Buildable m, Data.Text.Buildable.Buildable n, Data.Text.Buildable.Buildable o, Data.Text.Buildable.Buildable p, Data.Text.Buildable.Buildable r, Data.Text.Buildable.Buildable s, Data.Text.Buildable.Buildable t, Data.Text.Buildable.Buildable u) => Data.Text.Format.Params.Params (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, r, s, t, u) -- | 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