Bryan O'Sullivan avatar Bryan O'Sullivan committed b4c84bc

Fix up docs and formatting, quieting a haddock warning.

Comments (0)

Files changed (1)

 {-# LANGUAGE FlexibleInstances, Rank2Types, TypeSynonymInstances #-}
 module Criterion.IO
     (
-      note
+      CritHPrintfType
+    , note
     , printError
     , prolix
     , summary
 import qualified Text.Printf (HPrintfType, hPrintf)
 import Text.Printf (PrintfArg)
 
--- First item is the action to print now, given all the arguments gathered
--- together so far.  The second item is the function that will take a further argument
--- and give back a new PrintfCont.
+-- First item is the action to print now, given all the arguments
+-- gathered together so far.  The second item is the function that
+-- will take a further argument and give back a new PrintfCont.
 data PrintfCont = PrintfCont (IO ()) (PrintfArg a => a -> PrintfCont)
 
--- An internal class that acts like Printf/HPrintf.
+-- | An internal class that acts like Printf/HPrintf.
 --
--- The implementation is visible to the rest of the program, but the class is
+-- The implementation is visible to the rest of the program, but the
+-- details of the class are not.
 class CritHPrintfType a where
   chPrintfImpl :: (Config -> Bool) -> PrintfCont -> a
 
 
 chPrintf :: CritHPrintfType r => (Config -> Bool) -> Handle -> String -> r
 chPrintf shouldPrint h s
-  = chPrintfImpl shouldPrint (make (Text.Printf.hPrintf h s) (Text.Printf.hPrintf h s))
+  = chPrintfImpl shouldPrint (make (Text.Printf.hPrintf h s)
+                                   (Text.Printf.hPrintf h s))
   where
-    make :: IO () -> (forall a r. (PrintfArg a, Text.Printf.HPrintfType r) => a -> r) -> PrintfCont
-    make curCall curCall' = PrintfCont curCall (\x -> make (curCall' x) (curCall' x))
+    make :: IO () -> (forall a r. (PrintfArg a, Text.Printf.HPrintfType r) =>
+                      a -> r) -> PrintfCont
+    make curCall curCall' = PrintfCont curCall (\x -> make (curCall' x)
+                                                      (curCall' x))
 
-{- A demonstration of how to write printf in this style, in case it is ever needed
+{- A demonstration of how to write printf in this style, in case it is
+ever needed
   in fututre:
 
 cPrintf :: CritHPrintfType r => (Config -> Bool) -> String -> r
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.