-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Quasiquoters for printf -- -- Quasiquoters for string and text printf @package th-printf @version 0.8 module Language.Haskell.Printf.Lib -- | Takes a format string as input and produces a tuple (args, -- outputExpr). -- -- This function processes character escapes as they would appear in -- Haskell source code. It will emit warnings (or throw an error, as -- appropriate) when given an invalid format string. -- -- Use if you wish to leverage th-printf in conjunction with, -- for example, an existing logging library. toSplices :: String -> OutputType -> Q ([Pat], Exp) data OutputType OutputString :: OutputType OutputText :: OutputType instance GHC.Enum.Bounded Language.Haskell.Printf.Lib.OutputType instance GHC.Enum.Enum Language.Haskell.Printf.Lib.OutputType instance GHC.Generics.Generic Language.Haskell.Printf.Lib.OutputType instance GHC.Classes.Ord Language.Haskell.Printf.Lib.OutputType instance GHC.Classes.Eq Language.Haskell.Printf.Lib.OutputType instance GHC.Show.Show Language.Haskell.Printf.Lib.OutputType -- | Text.Printf is a useful module, but due to the typeclass hacks -- it uses, it can be hard to tell if the format string you wrote is -- well-formed or not. This package provides a mechanism to create -- formatting functions at compile time. -- -- Note that, to maintain consistency with other printf implementations, -- negative ints that are printed as unsigned will "underflow". -- (Text.Printf does this too.) -- --
-- >>> [s|%u|] (-1 :: Int32) -- WAS "4294967295" -- NOW Not in scope: type constructor or class `Int32' ---- -- Thus, any time you want to print a number using the unsigned, octal, -- or hex specifiers, your input must be an instance of Bounded. module Language.Haskell.Printf -- |
-- [s|Hello, %s! (%d people greeted)|] :: ... -> String ---- -- This formatter follows the guidelines listed here, except for -- %n (store number of printed characters) for obvious reasons. -- --
-- %c :: Char -- %s :: String -- %q :: Text -- lazy text -- %Q :: Text -- strict text -- -- -- datatypes with Show instances -- %? :: Show a => a -- -- -- signed integer types -- %d, %i :: Integral i => i -- -- -- unsigned integer types -- %u :: (Bounded i, Integral i) => i -- %o :: (Bounded i, Integral i) => i -- %x, %X :: (Bounded i, Integral i) => i -- -- -- floats -- %a, %A :: RealFloat f => f -- %e, %E :: RealFloat f => f -- %f, %F :: RealFloat f => f -- %g, %G :: RealFloat f => f -- -- %p :: Ptr a --s :: QuasiQuoter -- | Behaves identically to s, but produces lazy Text. t :: QuasiQuoter -- | Like s, but prints the resulting string to stdout. -- --
-- [p|Hello, %s! (%d people greeted)|] :: MonadIO m => ... -> m () --p :: QuasiQuoter -- | Like p, but takes as its first argument the Handle to -- print to. -- --
-- [hp|Hello, %s! (%d people greeted)|] :: MonadIO m => Handle -> ... -> m () --hp :: QuasiQuoter