This file is indexed.

/usr/share/doc/libghc-hspec-core-doc/html/Test-Hspec-Core-Formatters.html is in libghc-hspec-core-doc 2.2.4-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Test.Hspec.Core.Formatters</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="file:///usr/share/javascript/mathjax/MathJax.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Test-Hspec-Core-Formatters.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Test-Hspec-Core-Formatters.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">hspec-core-2.2.4: A Testing Framework for Haskell</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Stability</th><td>experimental</td></tr><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">Test.Hspec.Core.Formatters</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Formatters</a></li><li><a href="#g:2">Implementing a custom Formatter</a><ul><li><a href="#g:3">Accessing the runner state</a></li><li><a href="#g:4">Appending to the gerenated report</a></li><li><a href="#g:5">Dealing with colors</a></li><li><a href="#g:6">Helpers</a></li></ul></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>This module contains formatters that can be used with
 <code><a href="Test-Hspec-Runner.html#v:hspecWith">hspecWith</a></code>.</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:silent">silent</a> :: <a href="Test-Hspec-Core-Formatters.html#t:Formatter">Formatter</a></li><li class="src short"><a href="#v:specdoc">specdoc</a> :: <a href="Test-Hspec-Core-Formatters.html#t:Formatter">Formatter</a></li><li class="src short"><a href="#v:progress">progress</a> :: <a href="Test-Hspec-Core-Formatters.html#t:Formatter">Formatter</a></li><li class="src short"><a href="#v:failed_examples">failed_examples</a> :: <a href="Test-Hspec-Core-Formatters.html#t:Formatter">Formatter</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:Formatter">Formatter</a> = <a href="#v:Formatter">Formatter</a> {<ul class="subs"><li><a href="#v:headerFormatter">headerFormatter</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> ()</li><li><a href="#v:exampleGroupStarted">exampleGroupStarted</a> :: [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> ()</li><li><a href="#v:exampleGroupDone">exampleGroupDone</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> ()</li><li><a href="#v:exampleProgress">exampleProgress</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/GHC-IO-Handle.html#t:Handle">Handle</a> -&gt; <a href="Test-Hspec-Core-Util.html#t:Path">Path</a> -&gt; <a href="Test-Hspec-Core-Spec.html#t:Progress">Progress</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> ()</li><li><a href="#v:exampleSucceeded">exampleSucceeded</a> :: <a href="Test-Hspec-Core-Util.html#t:Path">Path</a> -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> ()</li><li><a href="#v:exampleFailed">exampleFailed</a> :: <a href="Test-Hspec-Core-Util.html#t:Path">Path</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:SomeException">SomeException</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> ()</li><li><a href="#v:examplePending">examplePending</a> :: <a href="Test-Hspec-Core-Util.html#t:Path">Path</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> ()</li><li><a href="#v:failedFormatter">failedFormatter</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> ()</li><li><a href="#v:footerFormatter">footerFormatter</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> ()</li></ul>}</li><li class="src short"><span class="keyword">data</span> <a href="#t:FormatM">FormatM</a> a</li><li class="src short"><a href="#v:getSuccessCount">getSuccessCount</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:getPendingCount">getPendingCount</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:getFailCount">getFailCount</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:getTotalCount">getTotalCount</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:FailureRecord">FailureRecord</a> = <a href="#v:FailureRecord">FailureRecord</a> {<ul class="subs"><li><a href="#v:failureRecordLocation">failureRecordLocation</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Test-Hspec-Core-Spec.html#t:Location">Location</a></li><li><a href="#v:failureRecordPath">failureRecordPath</a> :: <a href="Test-Hspec-Core-Util.html#t:Path">Path</a></li><li><a href="#v:failureRecordMessage">failureRecordMessage</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:SomeException">SomeException</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></li></ul>}</li><li class="src short"><a href="#v:getFailMessages">getFailMessages</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> [<a href="Test-Hspec-Core-Formatters.html#t:FailureRecord">FailureRecord</a>]</li><li class="src short"><a href="#v:usedSeed">usedSeed</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Integer">Integer</a></li><li class="src short"><a href="#v:getCPUTime">getCPUTime</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Double">Double</a>)</li><li class="src short"><a href="#v:getRealTime">getRealTime</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Double">Double</a></li><li class="src short"><a href="#v:write">write</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> ()</li><li class="src short"><a href="#v:writeLine">writeLine</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> ()</li><li class="src short"><a href="#v:newParagraph">newParagraph</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> ()</li><li class="src short"><a href="#v:withInfoColor">withInfoColor</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a</li><li class="src short"><a href="#v:withSuccessColor">withSuccessColor</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a</li><li class="src short"><a href="#v:withPendingColor">withPendingColor</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a</li><li class="src short"><a href="#v:withFailColor">withFailColor</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a</li><li class="src short"><a href="#v:formatException">formatException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:SomeException">SomeException</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></li></ul></div><div id="interface"><h1 id="g:1">Formatters</h1><div class="top"><p class="src"><a id="v:silent" class="def">silent</a> :: <a href="Test-Hspec-Core-Formatters.html#t:Formatter">Formatter</a> <a href="src/Test-Hspec-Core-Formatters.html#silent" class="link">Source</a> <a href="#v:silent" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:specdoc" class="def">specdoc</a> :: <a href="Test-Hspec-Core-Formatters.html#t:Formatter">Formatter</a> <a href="src/Test-Hspec-Core-Formatters.html#specdoc" class="link">Source</a> <a href="#v:specdoc" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:progress" class="def">progress</a> :: <a href="Test-Hspec-Core-Formatters.html#t:Formatter">Formatter</a> <a href="src/Test-Hspec-Core-Formatters.html#progress" class="link">Source</a> <a href="#v:progress" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:failed_examples" class="def">failed_examples</a> :: <a href="Test-Hspec-Core-Formatters.html#t:Formatter">Formatter</a> <a href="src/Test-Hspec-Core-Formatters.html#failed_examples" class="link">Source</a> <a href="#v:failed_examples" class="selflink">#</a></p></div><h1 id="g:2">Implementing a custom Formatter</h1><div class="doc"><p>A formatter is a set of actions.  Each action is evaluated when a certain
 situation is encountered during a test run.</p><p>Actions live in the <code><a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a></code> monad.  It provides access to the runner state
 and primitives for appending to the generated report.</p></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Formatter" class="def">Formatter</a> <a href="src/Test-Hspec-Core-Formatters-Internal.html#Formatter" class="link">Source</a> <a href="#t:Formatter" class="selflink">#</a></p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:Formatter" class="def">Formatter</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:headerFormatter" class="def">headerFormatter</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> ()</dfn><div class="doc empty">&nbsp;</div></li><li><dfn class="src"><a id="v:exampleGroupStarted" class="def">exampleGroupStarted</a> :: [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> ()</dfn><div class="doc"><p>evaluated before each test group</p><p>The given number indicates the position within the parent group.</p></div></li><li><dfn class="src"><a id="v:exampleGroupDone" class="def">exampleGroupDone</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> ()</dfn><div class="doc empty">&nbsp;</div></li><li><dfn class="src"><a id="v:exampleProgress" class="def">exampleProgress</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/GHC-IO-Handle.html#t:Handle">Handle</a> -&gt; <a href="Test-Hspec-Core-Util.html#t:Path">Path</a> -&gt; <a href="Test-Hspec-Core-Spec.html#t:Progress">Progress</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> ()</dfn><div class="doc"><p>used to notify the progress of the currently evaluated example</p><p><em>Note</em>: This is only called when interactive/color mode.</p></div></li><li><dfn class="src"><a id="v:exampleSucceeded" class="def">exampleSucceeded</a> :: <a href="Test-Hspec-Core-Util.html#t:Path">Path</a> -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> ()</dfn><div class="doc"><p>evaluated after each successful example</p></div></li><li><dfn class="src"><a id="v:exampleFailed" class="def">exampleFailed</a> :: <a href="Test-Hspec-Core-Util.html#t:Path">Path</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:SomeException">SomeException</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> ()</dfn><div class="doc"><p>evaluated after each failed example</p></div></li><li><dfn class="src"><a id="v:examplePending" class="def">examplePending</a> :: <a href="Test-Hspec-Core-Util.html#t:Path">Path</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> ()</dfn><div class="doc"><p>evaluated after each pending example</p></div></li><li><dfn class="src"><a id="v:failedFormatter" class="def">failedFormatter</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> ()</dfn><div class="doc"><p>evaluated after a test run</p></div></li><li><dfn class="src"><a id="v:footerFormatter" class="def">footerFormatter</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> ()</dfn><div class="doc"><p>evaluated after <code>failuresFormatter</code></p></div></li></ul></div></td></tr></table></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:FormatM" class="def">FormatM</a> a <a href="src/Test-Hspec-Core-Formatters-Internal.html#FormatM" class="link">Source</a> <a href="#t:FormatM" class="selflink">#</a></p><div class="subs instances"><p id="control.i:FormatM" class="caption collapser" onclick="toggleSection('i:FormatM')">Instances</p><div id="section.i:FormatM" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:FormatM:Monad:1" class="instance expander" onclick="toggleSection('i:id:FormatM:Monad:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:Monad">Monad</a> <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a></span> <a href="src/Test-Hspec-Core-Formatters-Internal.html#line-88" class="link">Source</a> <a href="#t:FormatM" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:FormatM:Monad:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-62--62--61-">(&gt;&gt;=)</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a -&gt; (a -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> b) -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> b <a href="#v:-62--62--61-" class="selflink">#</a></p><p class="src"><a href="#v:-62--62-">(&gt;&gt;)</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> b -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> b <a href="#v:-62--62-" class="selflink">#</a></p><p class="src"><a href="#v:return">return</a> :: a -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a <a href="#v:return" class="selflink">#</a></p><p class="src"><a href="#v:fail">fail</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a <a href="#v:fail" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:FormatM:Functor:2" class="instance expander" onclick="toggleSection('i:id:FormatM:Functor:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a> <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a></span> <a href="src/Test-Hspec-Core-Formatters-Internal.html#line-88" class="link">Source</a> <a href="#t:FormatM" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:FormatM:Functor:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:fmap">fmap</a> :: (a -&gt; b) -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> b <a href="#v:fmap" class="selflink">#</a></p><p class="src"><a href="#v:-60--36-">(&lt;$)</a> :: a -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> b -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a <a href="#v:-60--36-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:FormatM:Applicative:3" class="instance expander" onclick="toggleSection('i:id:FormatM:Applicative:3')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Applicative">Applicative</a> <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a></span> <a href="src/Test-Hspec-Core-Formatters-Internal.html#line-88" class="link">Source</a> <a href="#t:FormatM" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:FormatM:Applicative:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:pure">pure</a> :: a -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a <a href="#v:pure" class="selflink">#</a></p><p class="src"><a href="#v:-60--42--62-">(&lt;*&gt;)</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> (a -&gt; b) -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> b <a href="#v:-60--42--62-" class="selflink">#</a></p><p class="src"><a href="#v:-42--62-">(*&gt;)</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> b -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> b <a href="#v:-42--62-" class="selflink">#</a></p><p class="src"><a href="#v:-60--42-">(&lt;*)</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> b -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a <a href="#v:-60--42-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:FormatM:MonadIO:4" class="instance expander" onclick="toggleSection('i:id:FormatM:MonadIO:4')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a></span> <a href="src/Test-Hspec-Core-Formatters-Internal.html#line-88" class="link">Source</a> <a href="#t:FormatM" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:FormatM:MonadIO:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:liftIO">liftIO</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> a -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a <a href="#v:liftIO" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><h2 id="g:3">Accessing the runner state</h2><div class="top"><p class="src"><a id="v:getSuccessCount" class="def">getSuccessCount</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> <a href="src/Test-Hspec-Core-Formatters-Internal.html#getSuccessCount" class="link">Source</a> <a href="#v:getSuccessCount" class="selflink">#</a></p><div class="doc"><p>Get the number of successful examples encountered so far.</p></div></div><div class="top"><p class="src"><a id="v:getPendingCount" class="def">getPendingCount</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> <a href="src/Test-Hspec-Core-Formatters-Internal.html#getPendingCount" class="link">Source</a> <a href="#v:getPendingCount" class="selflink">#</a></p><div class="doc"><p>Get the number of pending examples encountered so far.</p></div></div><div class="top"><p class="src"><a id="v:getFailCount" class="def">getFailCount</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> <a href="src/Test-Hspec-Core-Formatters-Internal.html#getFailCount" class="link">Source</a> <a href="#v:getFailCount" class="selflink">#</a></p><div class="doc"><p>Get the number of failed examples encountered so far.</p></div></div><div class="top"><p class="src"><a id="v:getTotalCount" class="def">getTotalCount</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> <a href="src/Test-Hspec-Core-Formatters-Internal.html#getTotalCount" class="link">Source</a> <a href="#v:getTotalCount" class="selflink">#</a></p><div class="doc"><p>Get the total number of examples encountered so far.</p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:FailureRecord" class="def">FailureRecord</a> <a href="src/Test-Hspec-Core-Formatters-Internal.html#FailureRecord" class="link">Source</a> <a href="#t:FailureRecord" class="selflink">#</a></p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:FailureRecord" class="def">FailureRecord</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:failureRecordLocation" class="def">failureRecordLocation</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Test-Hspec-Core-Spec.html#t:Location">Location</a></dfn><div class="doc empty">&nbsp;</div></li><li><dfn class="src"><a id="v:failureRecordPath" class="def">failureRecordPath</a> :: <a href="Test-Hspec-Core-Util.html#t:Path">Path</a></dfn><div class="doc empty">&nbsp;</div></li><li><dfn class="src"><a id="v:failureRecordMessage" class="def">failureRecordMessage</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:SomeException">SomeException</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></dfn><div class="doc empty">&nbsp;</div></li></ul></div></td></tr></table></div></div><div class="top"><p class="src"><a id="v:getFailMessages" class="def">getFailMessages</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> [<a href="Test-Hspec-Core-Formatters.html#t:FailureRecord">FailureRecord</a>] <a href="src/Test-Hspec-Core-Formatters-Internal.html#getFailMessages" class="link">Source</a> <a href="#v:getFailMessages" class="selflink">#</a></p><div class="doc"><p>Get the list of accumulated failure messages.</p></div></div><div class="top"><p class="src"><a id="v:usedSeed" class="def">usedSeed</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Integer">Integer</a> <a href="src/Test-Hspec-Core-Formatters-Internal.html#usedSeed" class="link">Source</a> <a href="#v:usedSeed" class="selflink">#</a></p><div class="doc"><p>The random seed that is used for QuickCheck.</p></div></div><div class="top"><p class="src"><a id="v:getCPUTime" class="def">getCPUTime</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Double">Double</a>) <a href="src/Test-Hspec-Core-Formatters-Internal.html#getCPUTime" class="link">Source</a> <a href="#v:getCPUTime" class="selflink">#</a></p><div class="doc"><p>Get the used CPU time since the test run has been started.</p></div></div><div class="top"><p class="src"><a id="v:getRealTime" class="def">getRealTime</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#t:Double">Double</a> <a href="src/Test-Hspec-Core-Formatters-Internal.html#getRealTime" class="link">Source</a> <a href="#v:getRealTime" class="selflink">#</a></p><div class="doc"><p>Get the passed real time since the test run has been started.</p></div></div><h2 id="g:4">Appending to the gerenated report</h2><div class="top"><p class="src"><a id="v:write" class="def">write</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> () <a href="src/Test-Hspec-Core-Formatters-Internal.html#write" class="link">Source</a> <a href="#v:write" class="selflink">#</a></p><div class="doc"><p>Append some output to the report.</p></div></div><div class="top"><p class="src"><a id="v:writeLine" class="def">writeLine</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> () <a href="src/Test-Hspec-Core-Formatters-Internal.html#writeLine" class="link">Source</a> <a href="#v:writeLine" class="selflink">#</a></p><div class="doc"><p>The same as <code><a href="Test-Hspec-Core-Formatters.html#v:write">write</a></code>, but adds a newline character.</p></div></div><div class="top"><p class="src"><a id="v:newParagraph" class="def">newParagraph</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> () <a href="src/Test-Hspec-Core-Formatters-Internal.html#newParagraph" class="link">Source</a> <a href="#v:newParagraph" class="selflink">#</a></p><div class="doc"><div class="warning"><p>Deprecated: use <code>writeLine &quot;&quot;</code> instead</p></div><p>Append an empty line to the report.</p><p>Calling this multiple times has the same effect as calling it once.</p></div></div><h2 id="g:5">Dealing with colors</h2><div class="top"><p class="src"><a id="v:withInfoColor" class="def">withInfoColor</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a <a href="src/Test-Hspec-Core-Formatters-Internal.html#withInfoColor" class="link">Source</a> <a href="#v:withInfoColor" class="selflink">#</a></p><div class="doc"><p>Set output color to cyan, run given action, and finally restore the
 default color.</p></div></div><div class="top"><p class="src"><a id="v:withSuccessColor" class="def">withSuccessColor</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a <a href="src/Test-Hspec-Core-Formatters-Internal.html#withSuccessColor" class="link">Source</a> <a href="#v:withSuccessColor" class="selflink">#</a></p><div class="doc"><p>Set output color to green, run given action, and finally restore the
 default color.</p></div></div><div class="top"><p class="src"><a id="v:withPendingColor" class="def">withPendingColor</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a <a href="src/Test-Hspec-Core-Formatters-Internal.html#withPendingColor" class="link">Source</a> <a href="#v:withPendingColor" class="selflink">#</a></p><div class="doc"><p>Set output color to yellow, run given action, and finally restore the
 default color.</p></div></div><div class="top"><p class="src"><a id="v:withFailColor" class="def">withFailColor</a> :: <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a -&gt; <a href="Test-Hspec-Core-Formatters.html#t:FormatM">FormatM</a> a <a href="src/Test-Hspec-Core-Formatters-Internal.html#withFailColor" class="link">Source</a> <a href="#v:withFailColor" class="selflink">#</a></p><div class="doc"><p>Set output color to red, run given action, and finally restore the default
 color.</p></div></div><h2 id="g:6">Helpers</h2><div class="top"><p class="src"><a id="v:formatException" class="def">formatException</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:SomeException">SomeException</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="src/Test-Hspec-Core-Util.html#formatException" class="link">Source</a> <a href="#v:formatException" class="selflink">#</a></p><div class="doc"><p>The function <code><a href="Test-Hspec-Core-Formatters.html#v:formatException">formatException</a></code> converts an exception to a string.</p><p>This is different from <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#v:show">show</a></code>.  The type of the exception is included, e.g.:</p><pre class="screen"><code class="prompt">&gt;&gt;&gt; </code><strong class="userinput"><code>formatException (toException DivideByZero)
</code></strong>&quot;ArithException (divide by zero)&quot;
</pre><p>For <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Exception-Base.html#t:IOException">IOException</a></code>s the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO-Error.html#t:IOErrorType">IOErrorType</a></code> is included, as well.</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.2</p></div></body></html>