-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | A Testing Framework for Haskell
--   
--   This package provides a stable API that can be used to extend Hspec's
--   functionality.
@package hspec-api
@version 2.11.16


module Test.Hspec.Api.Format.V2
type Format = Event -> IO ()

data FormatConfig
FormatConfig :: Bool -> Bool -> Bool -> Bool -> Maybe Int -> Maybe (String -> String -> IO ()) -> Maybe (String -> String -> (String, String)) -> (SomeException -> String) -> Bool -> Bool -> Bool -> Integer -> Int -> FormatConfig
[formatConfigUseColor] :: FormatConfig -> Bool
[formatConfigReportProgress] :: FormatConfig -> Bool
[formatConfigOutputUnicode] :: FormatConfig -> Bool
[formatConfigUseDiff] :: FormatConfig -> Bool
[formatConfigDiffContext] :: FormatConfig -> Maybe Int
[formatConfigExternalDiff] :: FormatConfig -> Maybe (String -> String -> IO ())
[formatConfigPrettyPrintFunction] :: FormatConfig -> Maybe (String -> String -> (String, String))

[formatConfigFormatException] :: FormatConfig -> SomeException -> String
[formatConfigPrintTimes] :: FormatConfig -> Bool
[formatConfigHtmlOutput] :: FormatConfig -> Bool
[formatConfigPrintCpuTime] :: FormatConfig -> Bool
[formatConfigUsedSeed] :: FormatConfig -> Integer
[formatConfigExpectedTotalCount] :: FormatConfig -> Int
defaultFormatConfig :: FormatConfig
data Event
Started :: Event
GroupStarted :: Path -> Event
GroupDone :: Path -> Event
Progress :: Path -> Progress -> Event
ItemStarted :: Path -> Event
ItemDone :: Path -> Item -> Event
Done :: [(Path, Item)] -> Event

-- | <tt>(CurrentItem, TotalItems)</tt> tuple.
type Progress = (Int, Int)

-- | A <a>Path</a> describes the location of a spec item within a spec
--   tree.
--   
--   It consists of a list of group descriptions and a requirement
--   description.
type Path = ([String], String)

-- | <tt>Location</tt> is used to represent source locations.
data Location
Location :: FilePath -> Int -> Int -> Location
[locationFile] :: Location -> FilePath
[locationLine] :: Location -> Int
[locationColumn] :: Location -> Int
newtype Seconds
Seconds :: Double -> Seconds
data Item
Item :: Maybe Location -> Seconds -> String -> Result -> Item
[itemLocation] :: Item -> Maybe Location
[itemDuration] :: Item -> Seconds
[itemInfo] :: Item -> String
[itemResult] :: Item -> Result
data Result
Success :: Result
Pending :: Maybe Location -> Maybe String -> Result
Failure :: Maybe Location -> FailureReason -> Result
data FailureReason
NoReason :: FailureReason
Reason :: String -> FailureReason
ColorizedReason :: String -> FailureReason
ExpectedButGot :: Maybe String -> String -> String -> FailureReason
Error :: Maybe String -> SomeException -> FailureReason
monadic :: MonadIO m => (m () -> IO ()) -> (Event -> m ()) -> IO Format

-- | Make a formatter available for use with <tt>--format</tt>.
registerFormatter :: (String, FormatConfig -> IO Format) -> Config -> Config

-- | Make a formatter available for use with <tt>--format</tt> and use it
--   by default.
useFormatter :: (String, FormatConfig -> IO Format) -> Config -> Config

-- | Make a formatter compatible with types from
--   <a>Test.Hspec.Core.Format</a>.
liftFormatter :: (String, FormatConfig -> IO Format) -> (String, FormatConfig -> IO Format)

-- | A <tt><a>SpecWith</a> a</tt> represents a test or group of tests that
--   require an <tt>a</tt> value to run.
--   
--   In the common case, a <a>Spec</a> is a <tt><a>SpecWith</a> ()</tt>
--   which requires <tt>()</tt> and can thus be executed with <a>hspec</a>.
--   
--   To supply an argument to <a>SpecWith</a> tests to turn them into
--   <a>Spec</a>, use functions from <a>Test.Hspec.Core.Hooks</a> such as
--   <a>around</a>, <a>before</a>, <a>mapSubject</a> and similar.
--   
--   Values of this type are created by <a>it</a>, <a>describe</a> and
--   similar.
type SpecWith a = SpecM a ()
data Config

modifyConfig :: (Config -> Config) -> SpecWith a


module Test.Hspec.Api.Format.V1
type Format = Event -> IO ()
data FormatConfig
FormatConfig :: Bool -> Bool -> Bool -> Bool -> Maybe Int -> Maybe (String -> String -> IO ()) -> Bool -> Maybe (String -> String -> (String, String)) -> Bool -> Bool -> Bool -> Integer -> Int -> FormatConfig
[formatConfigUseColor] :: FormatConfig -> Bool
[formatConfigReportProgress] :: FormatConfig -> Bool
[formatConfigOutputUnicode] :: FormatConfig -> Bool
[formatConfigUseDiff] :: FormatConfig -> Bool
[formatConfigDiffContext] :: FormatConfig -> Maybe Int
[formatConfigExternalDiff] :: FormatConfig -> Maybe (String -> String -> IO ())

-- | Deprecated: use <a>formatConfigPrettyPrintFunction</a> instead
[formatConfigPrettyPrint] :: FormatConfig -> Bool
[formatConfigPrettyPrintFunction] :: FormatConfig -> Maybe (String -> String -> (String, String))
[formatConfigPrintTimes] :: FormatConfig -> Bool
[formatConfigHtmlOutput] :: FormatConfig -> Bool
[formatConfigPrintCpuTime] :: FormatConfig -> Bool
[formatConfigUsedSeed] :: FormatConfig -> Integer
[formatConfigExpectedTotalCount] :: FormatConfig -> Int
data Event
Started :: Event
GroupStarted :: Path -> Event
GroupDone :: Path -> Event
Progress :: Path -> Progress -> Event
ItemStarted :: Path -> Event
ItemDone :: Path -> Item -> Event
Done :: [(Path, Item)] -> Event

-- | <tt>(CurrentItem, TotalItems)</tt> tuple.
type Progress = (Int, Int)

-- | A <a>Path</a> describes the location of a spec item within a spec
--   tree.
--   
--   It consists of a list of group descriptions and a requirement
--   description.
type Path = ([String], String)

-- | <tt>Location</tt> is used to represent source locations.
data Location
Location :: FilePath -> Int -> Int -> Location
[locationFile] :: Location -> FilePath
[locationLine] :: Location -> Int
[locationColumn] :: Location -> Int
newtype Seconds
Seconds :: Double -> Seconds
data Item
Item :: Maybe Location -> Seconds -> String -> Result -> Item
[itemLocation] :: Item -> Maybe Location
[itemDuration] :: Item -> Seconds
[itemInfo] :: Item -> String
[itemResult] :: Item -> Result
data Result
Success :: Result
Pending :: Maybe Location -> Maybe String -> Result
Failure :: Maybe Location -> FailureReason -> Result
data FailureReason
NoReason :: FailureReason
Reason :: String -> FailureReason
ExpectedButGot :: Maybe String -> String -> String -> FailureReason
Error :: Maybe String -> SomeException -> FailureReason
monadic :: MonadIO m => (m () -> IO ()) -> (Event -> m ()) -> IO Format

-- | Make a formatter available for use with <tt>--format</tt>.
registerFormatter :: (String, FormatConfig -> IO Format) -> Config -> Config

-- | Make a formatter available for use with <tt>--format</tt> and use it
--   by default.
useFormatter :: (String, FormatConfig -> IO Format) -> Config -> Config

-- | Make a formatter compatible with types from
--   <a>Test.Hspec.Core.Format</a>.
liftFormatter :: (String, FormatConfig -> IO Format) -> (String, FormatConfig -> IO Format)

-- | A <tt><a>SpecWith</a> a</tt> represents a test or group of tests that
--   require an <tt>a</tt> value to run.
--   
--   In the common case, a <a>Spec</a> is a <tt><a>SpecWith</a> ()</tt>
--   which requires <tt>()</tt> and can thus be executed with <a>hspec</a>.
--   
--   To supply an argument to <a>SpecWith</a> tests to turn them into
--   <a>Spec</a>, use functions from <a>Test.Hspec.Core.Hooks</a> such as
--   <a>around</a>, <a>before</a>, <a>mapSubject</a> and similar.
--   
--   Values of this type are created by <a>it</a>, <a>describe</a> and
--   similar.
type SpecWith a = SpecM a ()
data Config

modifyConfig :: (Config -> Config) -> SpecWith a
instance GHC.Internal.Show.Show Test.Hspec.Api.Format.V1.Event


-- | This module contains formatters that can be used with
--   <tt>hspecWith</tt>:
--   
--   <pre>
--   import Test.Hspec
--   import Test.Hspec.Api.Formatters.V1
--   
--   main :: IO ()
--   main = hspecWith (useFormatter ("my-formatter", formatter) defaultConfig) spec
--   
--   formatter :: Formatter
--   formatter = ...
--   
--   spec :: Spec
--   spec = ...
--   </pre>
module Test.Hspec.Api.Formatters.V1

-- | Make a formatter available for use with <tt>--format</tt> and use it
--   by default.
useFormatter :: (String, Formatter) -> Config -> Config
formatterToFormat :: Formatter -> FormatConfig -> IO Format
silent :: Formatter
checks :: Formatter
specdoc :: Formatter
progress :: Formatter
failed_examples :: Formatter
data Formatter
Formatter :: FormatM () -> ([String] -> String -> FormatM ()) -> FormatM () -> (Path -> FormatM ()) -> (Path -> Progress -> FormatM ()) -> (Path -> String -> FormatM ()) -> (Path -> String -> FailureReason -> FormatM ()) -> (Path -> String -> Maybe String -> FormatM ()) -> FormatM () -> FormatM () -> Formatter
[headerFormatter] :: Formatter -> FormatM ()
[exampleGroupStarted] :: Formatter -> [String] -> String -> FormatM ()
[exampleGroupDone] :: Formatter -> FormatM ()
[exampleStarted] :: Formatter -> Path -> FormatM ()
[exampleProgress] :: Formatter -> Path -> Progress -> FormatM ()
[exampleSucceeded] :: Formatter -> Path -> String -> FormatM ()
[exampleFailed] :: Formatter -> Path -> String -> FailureReason -> FormatM ()
[examplePending] :: Formatter -> Path -> String -> Maybe String -> FormatM ()
[failedFormatter] :: Formatter -> FormatM ()
[footerFormatter] :: Formatter -> FormatM ()
data FailureReason
NoReason :: FailureReason
Reason :: String -> FailureReason
ExpectedButGot :: Maybe String -> String -> String -> FailureReason
Error :: Maybe String -> SomeException -> FailureReason
type FormatM = Free FormatF

-- | Get the number of successful examples encountered so far.
getSuccessCount :: FormatM Int

-- | Get the number of pending examples encountered so far.
getPendingCount :: FormatM Int

-- | Get the number of failed examples encountered so far.
getFailCount :: FormatM Int

-- | Get the total number of examples encountered so far.
getTotalCount :: FormatM Int
data FailureRecord
FailureRecord :: Maybe Location -> Path -> FailureReason -> FailureRecord
[failureRecordLocation] :: FailureRecord -> Maybe Location
[failureRecordPath] :: FailureRecord -> Path
[failureRecordMessage] :: FailureRecord -> FailureReason

-- | Get the list of accumulated failure messages.
getFailMessages :: FormatM [FailureRecord]

-- | The random seed that is used for QuickCheck.
usedSeed :: FormatM Integer
newtype Seconds
Seconds :: Double -> Seconds

-- | Get the used CPU time since the test run has been started.
getCPUTime :: FormatM (Maybe Seconds)

-- | Get the passed real time since the test run has been started.
getRealTime :: FormatM Seconds

-- | Append some output to the report.
write :: String -> FormatM ()

-- | The same as <a>write</a>, but adds a newline character.
writeLine :: String -> FormatM ()
writeTransient :: String -> FormatM ()

-- | Set output color to cyan, run given action, and finally restore the
--   default color.
withInfoColor :: FormatM a -> FormatM a

-- | Set output color to green, run given action, and finally restore the
--   default color.
withSuccessColor :: FormatM a -> FormatM a

-- | Set output color to yellow, run given action, and finally restore the
--   default color.
withPendingColor :: FormatM a -> FormatM a

-- | Set output color to red, run given action, and finally restore the
--   default color.
withFailColor :: FormatM a -> FormatM a

-- | Return <a>True</a> if the user requested colorized diffs, <a>False</a>
--   otherwise.
useDiff :: FormatM Bool

-- | Output given chunk in red.
extraChunk :: String -> FormatM ()

-- | Output given chunk in green.
missingChunk :: String -> FormatM ()

-- | The function <a>formatException</a> converts an exception to a string.
--   
--   This is different from <a>show</a>. The type of the exception is
--   included, e.g.:
--   
--   <pre>
--   &gt;&gt;&gt; formatException (toException DivideByZero)
--   "ArithException\ndivide by zero"
--   </pre>
--   
--   For <a>IOException</a>s the <a>IOErrorType</a> is included, as well.
formatException :: SomeException -> String

-- | <tt>Location</tt> is used to represent source locations.
data Location
Location :: FilePath -> Int -> Int -> Location
[locationFile] :: Location -> FilePath
[locationLine] :: Location -> Int
[locationColumn] :: Location -> Int

-- | <tt>(CurrentItem, TotalItems)</tt> tuple.
type Progress = (Int, Int)

-- | A <tt><a>SpecWith</a> a</tt> represents a test or group of tests that
--   require an <tt>a</tt> value to run.
--   
--   In the common case, a <a>Spec</a> is a <tt><a>SpecWith</a> ()</tt>
--   which requires <tt>()</tt> and can thus be executed with <a>hspec</a>.
--   
--   To supply an argument to <a>SpecWith</a> tests to turn them into
--   <a>Spec</a>, use functions from <a>Test.Hspec.Core.Hooks</a> such as
--   <a>around</a>, <a>before</a>, <a>mapSubject</a> and similar.
--   
--   Values of this type are created by <a>it</a>, <a>describe</a> and
--   similar.
type SpecWith a = SpecM a ()
data Config

modifyConfig :: (Config -> Config) -> SpecWith a


-- | This module contains formatters that can be used with
--   <tt>hspecWith</tt>:
--   
--   <pre>
--   import Test.Hspec
--   import Test.Hspec.Api.Formatters.V1
--   
--   main :: IO ()
--   main = hspecWith (useFormatter ("my-formatter", formatter) defaultConfig) spec
--   
--   formatter :: Formatter
--   formatter = ...
--   
--   spec :: Spec
--   spec = ...
--   </pre>
module Test.Hspec.Api.Formatters.V3

-- | Make a formatter available for use with <tt>--format</tt>.
registerFormatter :: (String, Formatter) -> Config -> Config

-- | Make a formatter available for use with <tt>--format</tt> and use it
--   by default.
useFormatter :: (String, Formatter) -> Config -> Config
formatterToFormat :: Formatter -> FormatConfig -> IO Format
silent :: Formatter
checks :: Formatter
specdoc :: Formatter
progress :: Formatter
failed_examples :: Formatter
data Formatter
Formatter :: FormatM () -> (Path -> FormatM ()) -> (Path -> FormatM ()) -> (Path -> Progress -> FormatM ()) -> (Path -> FormatM ()) -> (Path -> Item -> FormatM ()) -> FormatM () -> Formatter
[formatterStarted] :: Formatter -> FormatM ()
[formatterGroupStarted] :: Formatter -> Path -> FormatM ()
[formatterGroupDone] :: Formatter -> Path -> FormatM ()
[formatterProgress] :: Formatter -> Path -> Progress -> FormatM ()
[formatterItemStarted] :: Formatter -> Path -> FormatM ()
[formatterItemDone] :: Formatter -> Path -> Item -> FormatM ()
[formatterDone] :: Formatter -> FormatM ()

-- | A <a>Path</a> describes the location of a spec item within a spec
--   tree.
--   
--   It consists of a list of group descriptions and a requirement
--   description.
type Path = ([String], String)

-- | <tt>(CurrentItem, TotalItems)</tt> tuple.
type Progress = (Int, Int)

-- | <tt>Location</tt> is used to represent source locations.
data Location
Location :: FilePath -> Int -> Int -> Location
[locationFile] :: Location -> FilePath
[locationLine] :: Location -> Int
[locationColumn] :: Location -> Int
data Item
Item :: Maybe Location -> Seconds -> String -> Result -> Item
[itemLocation] :: Item -> Maybe Location
[itemDuration] :: Item -> Seconds
[itemInfo] :: Item -> String
[itemResult] :: Item -> Result
data Result
Success :: Result
Pending :: Maybe Location -> Maybe String -> Result
Failure :: Maybe Location -> FailureReason -> Result
data FailureReason
NoReason :: FailureReason
Reason :: String -> FailureReason
ColorizedReason :: String -> FailureReason
ExpectedButGot :: Maybe String -> String -> String -> FailureReason
Error :: Maybe String -> SomeException -> FailureReason
data FormatM a

getConfig :: FormatM FormatConfig

getConfigValue :: (FormatConfig -> a) -> FormatM a

data FormatConfig
FormatConfig :: Bool -> Bool -> Bool -> Bool -> Maybe Int -> Maybe (String -> String -> IO ()) -> Maybe (String -> String -> (String, String)) -> (SomeException -> String) -> Bool -> Bool -> Bool -> Integer -> Int -> FormatConfig
[formatConfigUseColor] :: FormatConfig -> Bool
[formatConfigReportProgress] :: FormatConfig -> Bool
[formatConfigOutputUnicode] :: FormatConfig -> Bool
[formatConfigUseDiff] :: FormatConfig -> Bool
[formatConfigDiffContext] :: FormatConfig -> Maybe Int
[formatConfigExternalDiff] :: FormatConfig -> Maybe (String -> String -> IO ())
[formatConfigPrettyPrintFunction] :: FormatConfig -> Maybe (String -> String -> (String, String))

[formatConfigFormatException] :: FormatConfig -> SomeException -> String
[formatConfigPrintTimes] :: FormatConfig -> Bool
[formatConfigHtmlOutput] :: FormatConfig -> Bool
[formatConfigPrintCpuTime] :: FormatConfig -> Bool
[formatConfigUsedSeed] :: FormatConfig -> Integer
[formatConfigExpectedTotalCount] :: FormatConfig -> Int
defaultFormatConfig :: FormatConfig

-- | Get the number of successful examples encountered so far.
getSuccessCount :: FormatM Int

-- | Get the number of pending examples encountered so far.
getPendingCount :: FormatM Int

-- | Get the number of failed examples encountered so far.
getFailCount :: FormatM Int

-- | Get the total number of examples encountered so far.
getTotalCount :: FormatM Int

-- | Get the number of spec items that will have been encountered when this
--   run completes (if it is not terminated early).
getExpectedTotalCount :: FormatM Int
data FailureRecord
FailureRecord :: Maybe Location -> Path -> FailureReason -> FailureRecord
[failureRecordLocation] :: FailureRecord -> Maybe Location
[failureRecordPath] :: FailureRecord -> Path
[failureRecordMessage] :: FailureRecord -> FailureReason

-- | Get the list of accumulated failure messages.
getFailMessages :: FormatM [FailureRecord]

-- | The random seed that is used for QuickCheck.
usedSeed :: FormatM Integer

-- | Return <a>True</a> if the user requested time reporting for individual
--   spec items, <a>False</a> otherwise.
printTimes :: FormatM Bool
newtype Seconds
Seconds :: Double -> Seconds

-- | Get the used CPU time since the test run has been started.
getCPUTime :: FormatM (Maybe Seconds)

-- | Get the passed real time since the test run has been started.
getRealTime :: FormatM Seconds

-- | Append some output to the report.
write :: String -> FormatM ()

-- | The same as <a>write</a>, but adds a newline character.
writeLine :: String -> FormatM ()
writeTransient :: String -> FormatM ()

-- | Set output color to cyan, run given action, and finally restore the
--   default color.
withInfoColor :: FormatM a -> FormatM a

-- | Set output color to green, run given action, and finally restore the
--   default color.
withSuccessColor :: FormatM a -> FormatM a

-- | Set output color to yellow, run given action, and finally restore the
--   default color.
withPendingColor :: FormatM a -> FormatM a

-- | Set output color to red, run given action, and finally restore the
--   default color.
withFailColor :: FormatM a -> FormatM a

-- | Return <a>True</a> if the user requested unicode output, <a>False</a>
--   otherwise.
outputUnicode :: FormatM Bool

-- | Return <a>True</a> if the user requested colorized diffs, <a>False</a>
--   otherwise.
useDiff :: FormatM Bool

-- | Return the value of <a>configDiffContext</a>.
diffContext :: FormatM (Maybe Int)

-- | An action for printing diffs.
--   
--   The action takes <tt>expected</tt> and <tt>actual</tt> as arguments.
--   
--   When this is a <a>Just</a>-value then it should be used instead of any
--   built-in diff implementation. A <a>Just</a>-value also implies that
--   <a>useDiff</a> returns <a>True</a>.
externalDiffAction :: FormatM (Maybe (String -> String -> IO ()))

-- | Return <a>True</a> if the user requested pretty diffs, <a>False</a>
--   otherwise.
prettyPrint :: FormatM Bool

-- | Return a function for pretty-printing if the user requested pretty
--   diffs, <a>Nothing</a> otherwise.
prettyPrintFunction :: FormatM (Maybe (String -> String -> (String, String)))

-- | Output given chunk in red.
extraChunk :: String -> FormatM ()

-- | Output given chunk in green.
missingChunk :: String -> FormatM ()

-- | Do nothing on `--expert`, otherwise run the given action.
unlessExpert :: FormatM () -> FormatM ()
formatLocation :: Location -> String

-- | The function <a>formatException</a> converts an exception to a string.
--   
--   This is different from <a>show</a>. The type of the exception is
--   included, e.g.:
--   
--   <pre>
--   &gt;&gt;&gt; formatException (toException DivideByZero)
--   "ArithException\ndivide by zero"
--   </pre>
--   
--   For <a>IOException</a>s the <a>IOErrorType</a> is included, as well.
formatException :: SomeException -> String

-- | A <tt><a>SpecWith</a> a</tt> represents a test or group of tests that
--   require an <tt>a</tt> value to run.
--   
--   In the common case, a <a>Spec</a> is a <tt><a>SpecWith</a> ()</tt>
--   which requires <tt>()</tt> and can thus be executed with <a>hspec</a>.
--   
--   To supply an argument to <a>SpecWith</a> tests to turn them into
--   <a>Spec</a>, use functions from <a>Test.Hspec.Core.Hooks</a> such as
--   <a>around</a>, <a>before</a>, <a>mapSubject</a> and similar.
--   
--   Values of this type are created by <a>it</a>, <a>describe</a> and
--   similar.
type SpecWith a = SpecM a ()
data Config

modifyConfig :: (Config -> Config) -> SpecWith a


-- | This module contains formatters that can be used with
--   <tt>hspecWith</tt>:
--   
--   <pre>
--   import Test.Hspec
--   import Test.Hspec.Api.Formatters.V1
--   
--   main :: IO ()
--   main = hspecWith (useFormatter ("my-formatter", formatter) defaultConfig) spec
--   
--   formatter :: Formatter
--   formatter = ...
--   
--   spec :: Spec
--   spec = ...
--   </pre>
module Test.Hspec.Api.Formatters.V2

-- | Make a formatter available for use with <tt>--format</tt>.
registerFormatter :: (String, Formatter) -> Config -> Config

-- | Make a formatter available for use with <tt>--format</tt> and use it
--   by default.
useFormatter :: (String, Formatter) -> Config -> Config
formatterToFormat :: Formatter -> FormatConfig -> IO Format
silent :: Formatter
checks :: Formatter
specdoc :: Formatter
progress :: Formatter
failed_examples :: Formatter
data Formatter
Formatter :: FormatM () -> (Path -> FormatM ()) -> (Path -> FormatM ()) -> (Path -> Progress -> FormatM ()) -> (Path -> FormatM ()) -> (Path -> Item -> FormatM ()) -> FormatM () -> Formatter
[formatterStarted] :: Formatter -> FormatM ()
[formatterGroupStarted] :: Formatter -> Path -> FormatM ()
[formatterGroupDone] :: Formatter -> Path -> FormatM ()
[formatterProgress] :: Formatter -> Path -> Progress -> FormatM ()
[formatterItemStarted] :: Formatter -> Path -> FormatM ()
[formatterItemDone] :: Formatter -> Path -> Item -> FormatM ()
[formatterDone] :: Formatter -> FormatM ()

-- | A <a>Path</a> describes the location of a spec item within a spec
--   tree.
--   
--   It consists of a list of group descriptions and a requirement
--   description.
type Path = ([String], String)

-- | <tt>(CurrentItem, TotalItems)</tt> tuple.
type Progress = (Int, Int)

-- | <tt>Location</tt> is used to represent source locations.
data Location
Location :: FilePath -> Int -> Int -> Location
[locationFile] :: Location -> FilePath
[locationLine] :: Location -> Int
[locationColumn] :: Location -> Int
data Item
Item :: Maybe Location -> Seconds -> String -> Result -> Item
[itemLocation] :: Item -> Maybe Location
[itemDuration] :: Item -> Seconds
[itemInfo] :: Item -> String
[itemResult] :: Item -> Result
data Result
Success :: Result
Pending :: Maybe Location -> Maybe String -> Result
Failure :: Maybe Location -> FailureReason -> Result
data FailureReason
NoReason :: FailureReason
Reason :: String -> FailureReason
ExpectedButGot :: Maybe String -> String -> String -> FailureReason
Error :: Maybe String -> SomeException -> FailureReason
data FormatM a

-- | Get the number of successful examples encountered so far.
getSuccessCount :: FormatM Int

-- | Get the number of pending examples encountered so far.
getPendingCount :: FormatM Int

-- | Get the number of failed examples encountered so far.
getFailCount :: FormatM Int

-- | Get the total number of examples encountered so far.
getTotalCount :: FormatM Int

-- | Get the number of spec items that will have been encountered when this
--   run completes (if it is not terminated early).
getExpectedTotalCount :: FormatM Int
data FailureRecord
FailureRecord :: Maybe Location -> Path -> FailureReason -> FailureRecord
[failureRecordLocation] :: FailureRecord -> Maybe Location
[failureRecordPath] :: FailureRecord -> Path
[failureRecordMessage] :: FailureRecord -> FailureReason

-- | Get the list of accumulated failure messages.
getFailMessages :: FormatM [FailureRecord]

-- | The random seed that is used for QuickCheck.
usedSeed :: FormatM Integer

-- | Return <a>True</a> if the user requested time reporting for individual
--   spec items, <a>False</a> otherwise.
printTimes :: FormatM Bool
newtype Seconds
Seconds :: Double -> Seconds

-- | Get the used CPU time since the test run has been started.
getCPUTime :: FormatM (Maybe Seconds)

-- | Get the passed real time since the test run has been started.
getRealTime :: FormatM Seconds

-- | Append some output to the report.
write :: String -> FormatM ()

-- | The same as <a>write</a>, but adds a newline character.
writeLine :: String -> FormatM ()
writeTransient :: String -> FormatM ()

-- | Set output color to cyan, run given action, and finally restore the
--   default color.
withInfoColor :: FormatM a -> FormatM a

-- | Set output color to green, run given action, and finally restore the
--   default color.
withSuccessColor :: FormatM a -> FormatM a

-- | Set output color to yellow, run given action, and finally restore the
--   default color.
withPendingColor :: FormatM a -> FormatM a

-- | Set output color to red, run given action, and finally restore the
--   default color.
withFailColor :: FormatM a -> FormatM a

-- | Return <a>True</a> if the user requested unicode output, <a>False</a>
--   otherwise.
outputUnicode :: FormatM Bool

-- | Return <a>True</a> if the user requested colorized diffs, <a>False</a>
--   otherwise.
useDiff :: FormatM Bool

-- | Return the value of <a>configDiffContext</a>.
diffContext :: FormatM (Maybe Int)

-- | An action for printing diffs.
--   
--   The action takes <tt>expected</tt> and <tt>actual</tt> as arguments.
--   
--   When this is a <a>Just</a>-value then it should be used instead of any
--   built-in diff implementation. A <a>Just</a>-value also implies that
--   <a>useDiff</a> returns <a>True</a>.
externalDiffAction :: FormatM (Maybe (String -> String -> IO ()))

-- | Return <a>True</a> if the user requested pretty diffs, <a>False</a>
--   otherwise.
prettyPrint :: FormatM Bool

-- | Return a function for pretty-printing if the user requested pretty
--   diffs, <a>Nothing</a> otherwise.
prettyPrintFunction :: FormatM (Maybe (String -> String -> (String, String)))

-- | Output given chunk in red.
extraChunk :: String -> FormatM ()

-- | Output given chunk in green.
missingChunk :: String -> FormatM ()
formatLocation :: Location -> String

-- | The function <a>formatException</a> converts an exception to a string.
--   
--   This is different from <a>show</a>. The type of the exception is
--   included, e.g.:
--   
--   <pre>
--   &gt;&gt;&gt; formatException (toException DivideByZero)
--   "ArithException\ndivide by zero"
--   </pre>
--   
--   For <a>IOException</a>s the <a>IOErrorType</a> is included, as well.
formatException :: SomeException -> String

-- | A <tt><a>SpecWith</a> a</tt> represents a test or group of tests that
--   require an <tt>a</tt> value to run.
--   
--   In the common case, a <a>Spec</a> is a <tt><a>SpecWith</a> ()</tt>
--   which requires <tt>()</tt> and can thus be executed with <a>hspec</a>.
--   
--   To supply an argument to <a>SpecWith</a> tests to turn them into
--   <a>Spec</a>, use functions from <a>Test.Hspec.Core.Hooks</a> such as
--   <a>around</a>, <a>before</a>, <a>mapSubject</a> and similar.
--   
--   Values of this type are created by <a>it</a>, <a>describe</a> and
--   similar.
type SpecWith a = SpecM a ()
data Config

modifyConfig :: (Config -> Config) -> SpecWith a
