summaryrefslogtreecommitdiff
path: root/libraries/base/Text
diff options
context:
space:
mode:
authorsimonmar <unknown>2005-02-24 09:58:24 +0000
committersimonmar <unknown>2005-02-24 09:58:24 +0000
commitab8e4ad05eaeb357d3ec07e268f2f4e9f4eb5c80 (patch)
treefa1a864739bbe86d124ae5221d36bd1afa96a691 /libraries/base/Text
parent3351d4b1eedc7bca22790cba271f5c51e5be8716 (diff)
downloadhaskell-ab8e4ad05eaeb357d3ec07e268f2f4e9f4eb5c80.tar.gz
[project @ 2005-02-24 09:58:23 by simonmar]
nDoc fixes from Sven Panne. Generally fixing of Haddock links, adding some signatures, and in some cases exporting type constructors that are mentioned in the types of exported identifiers.
Diffstat (limited to 'libraries/base/Text')
-rw-r--r--libraries/base/Text/Printf.hs23
1 files changed, 12 insertions, 11 deletions
diff --git a/libraries/base/Text/Printf.hs b/libraries/base/Text/Printf.hs
index 69bc7cda9e..ee0b51ce97 100644
--- a/libraries/base/Text/Printf.hs
+++ b/libraries/base/Text/Printf.hs
@@ -12,7 +12,10 @@
--
-----------------------------------------------------------------------------
-module Text.Printf(printf, hPrintf) where
+module Text.Printf(
+ printf, hPrintf,
+ PrintfType, HPrintfType, PrintfArg, IsChar
+) where
import Prelude
import Data.Array
@@ -23,7 +26,7 @@ import System.IO
-------------------
-- | Format a variable number of arguments with the C-style formatting string.
--- The return value is either 'String' or @(IO a)@.
+-- The return value is either 'String' or @('IO' a)@.
--
-- The format string consists of ordinary characters and /conversion
-- specifications/, which specify how to format one of the arguments
@@ -54,13 +57,6 @@ import System.IO
-- > e exponent format float Float, Double
-- > s string String
--
--- The @PrintfType@ class provides the variable argument magic for
--- 'printf'. Its implementation is intentionally not visible from
--- this module. The following argument types are supported: Char, String,
--- Int, Integer, Float, Double. If you attempt to pass an argument of a
--- different type to 'printf', then the compiler will report it as a
--- missing instance of @PrintfArg@.
---
-- Mismatch between the argument types and the format string will cause
-- an exception to be thrown at runtime.
--
@@ -77,14 +73,19 @@ printf :: (PrintfType r) => String -> r
printf fmt = spr fmt []
-- | Similar to 'printf', except that output is via the specified
--- 'Handle'. The return type is restricted to @(IO a)@.
+-- 'Handle'. The return type is restricted to @('IO' a)@.
hPrintf :: (HPrintfType r) => Handle -> String -> r
hPrintf hdl fmt = hspr hdl fmt []
+-- |The 'PrintfType' class provides the variable argument magic for
+-- 'printf'. Its implementation is intentionally not visible from
+-- this module. If you attempt to pass an argument of a type which
+-- is not an instance of this class to 'printf' or 'hPrintf', then
+-- the compiler will report it as a missing instance of 'PrintfArg'.
class PrintfType t where
spr :: String -> [UPrintf] -> t
--- | The @HPrintfType@ class provides the variable argument magic for
+-- | The 'HPrintfType' class provides the variable argument magic for
-- 'hPrintf'. Its implementation is intentionally not visible from
-- this module.
class HPrintfType t where