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

-- | A Testing Framework for Haskell
--   
--   This package exposes internal types and functions that can be used to
--   extend Hspec's functionality.
@package hspec-core
@version 2.11.16

module Test.Hspec.Core.Util

-- | pluralize count singular pluralizes the given
--   singular word unless given count is 1.
--   
--   Examples:
--   
--   
--   >>> pluralize 0 "example"
--   "0 examples"
--   
--   
--   
--   >>> pluralize 1 "example"
--   "1 example"
--   
--   
--   
--   >>> pluralize 2 "example"
--   "2 examples"
--   
pluralize :: Int -> String -> String

-- | Strip leading and trailing whitespace
strip :: String -> String

-- | Ensure that lines are not longer than given n, insert line
--   breaks at word boundaries
lineBreaksAt :: Int -> String -> [String]

-- | Remove ANSI color escape sequences.
stripAnsi :: String -> String

-- | A Path 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)

-- | Join a Path with slashes. The result will have a leading and a
--   trailing slash.
joinPath :: Path -> String

-- | Try to create a proper English sentence from a path by applying some
--   heuristics.
formatRequirement :: Path -> String

-- | A predicate that can be used to filter a spec tree.
filterPredicate :: String -> Path -> Bool

-- | safeTry evaluates given action and returns its result. If an
--   exception occurs, the exception is returned instead. Unlike try
--   it is agnostic to asynchronous exceptions.
safeTry :: IO a -> IO (Either SomeException a)

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

formatExceptionWith :: (SomeException -> String) -> SomeException -> String

-- | This is an unstable API. Use Test.Hspec.Api.Format.V2 instead.
module Test.Hspec.Core.Format
type Format = Event -> IO ()

data FormatConfig
FormatConfig :: Bool -> Bool -> Bool -> Bool -> Maybe Int -> Maybe (String -> String -> IO ()) -> Bool -> Maybe (String -> String -> (String, String)) -> (SomeException -> String) -> Bool -> Bool -> Bool -> Integer -> Int -> Bool -> 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 formatConfigPrettyPrintFunction instead
[formatConfigPrettyPrint] :: FormatConfig -> Bool
[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
[formatConfigExpertMode] :: FormatConfig -> Bool
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

-- | (CurrentItem, TotalItems) tuple.
type Progress = (Int, Int)

-- | A Path 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)

-- | Location 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
instance GHC.Internal.Show.Show Test.Hspec.Core.Format.Event
instance GHC.Internal.Show.Show Test.Hspec.Core.Format.Item
instance GHC.Internal.Show.Show Test.Hspec.Core.Format.Result

-- | This is an unstable API. Use Test.Hspec.Api.Formatters.V3
--   instead.
module Test.Hspec.Core.Formatters.V2
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 Path 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)

-- | (CurrentItem, TotalItems) tuple.
type Progress = (Int, Int)

-- | Location 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
formatterToFormat :: Formatter -> FormatConfig -> IO Format

getConfig :: FormatM FormatConfig

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

data FormatConfig
FormatConfig :: Bool -> Bool -> Bool -> Bool -> Maybe Int -> Maybe (String -> String -> IO ()) -> Bool -> Maybe (String -> String -> (String, String)) -> (SomeException -> String) -> Bool -> Bool -> Bool -> Integer -> Int -> Bool -> 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 formatConfigPrettyPrintFunction instead
[formatConfigPrettyPrint] :: FormatConfig -> Bool
[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
[formatConfigExpertMode] :: FormatConfig -> Bool

-- | 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 True if the user requested time reporting for individual
--   spec items, False 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 write, 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 True if the user requested unicode output, False
--   otherwise.
outputUnicode :: FormatM Bool

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

-- | Return the value of configDiffContext.
diffContext :: FormatM (Maybe Int)

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

-- | Return True if the user requested pretty diffs, False
--   otherwise.

-- | Deprecated: use prettyPrintFunction instead
prettyPrint :: FormatM Bool

-- | Return a function for pretty-printing if the user requested pretty
--   diffs, Nothing 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 formatException converts an exception to a string.
--   
--   This is different from show. The type of the exception is
--   included, e.g.:
--   
--   
--   >>> formatException (toException DivideByZero)
--   "ArithException\ndivide by zero"
--   
--   
--   For IOExceptions the IOErrorType is included, as well.
formatException :: SomeException -> String
instance GHC.Classes.Eq Test.Hspec.Core.Formatters.V2.Chunk
instance GHC.Classes.Eq Test.Hspec.Core.Formatters.V2.ColorChunk
instance GHC.Internal.Show.Show Test.Hspec.Core.Formatters.V2.Chunk
instance GHC.Internal.Show.Show Test.Hspec.Core.Formatters.V2.ColorChunk

-- | This module contains formatters that can be used with
--   hspecWith.

-- | Deprecated: Use Test.Hspec.Api.Formatters.V1 instead.
module Test.Hspec.Core.Formatters.V1
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
formatterToFormat :: Formatter -> FormatConfig -> IO Format

-- | 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 write, 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 True if the user requested colorized diffs, False
--   otherwise.
useDiff :: FormatM Bool

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

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

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

-- | Deprecated: Use Test.Hspec.Api.Formatters.V1 instead.
module Test.Hspec.Core.Formatters

module Test.Hspec.Core.QuickCheck

-- | Use a modified maxSuccess for given spec.
modifyMaxSuccess :: (Int -> Int) -> SpecWith a -> SpecWith a

-- | Use a modified maxDiscardRatio for given spec.
modifyMaxDiscardRatio :: (Int -> Int) -> SpecWith a -> SpecWith a

-- | Use a modified maxSize for given spec.
modifyMaxSize :: (Int -> Int) -> SpecWith a -> SpecWith a

-- | Use a modified maxShrinks for given spec.
modifyMaxShrinks :: (Int -> Int) -> SpecWith a -> SpecWith a

-- | Use modified Args for given spec.
modifyArgs :: (Args -> Args) -> SpecWith a -> SpecWith a
instance Test.Hspec.Core.Example.Example (a -> Test.QuickCheck.Property.Property)
instance Test.Hspec.Core.Example.Example Test.QuickCheck.Property.Property

module Test.Hspec.Core.Hooks

-- | A SpecWith that can be evaluated directly by the hspec
--   function as it does not require any parameters.
type Spec = SpecWith ()

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

-- | An IO action that expects an argument of type a.
--   
--   This type is what Examples are ultimately unlifted into for
--   execution.
type ActionWith a = a -> IO ()

-- | Run a custom action before every spec item.
before :: IO a -> SpecWith a -> Spec

-- | Run a custom action before every spec item.
before_ :: IO () -> SpecWith a -> SpecWith a

-- | Run a custom action before every spec item.
beforeWith :: (b -> IO a) -> SpecWith a -> SpecWith b

-- | Run a custom action before the first spec item.
beforeAll :: HasCallStack => IO a -> SpecWith a -> Spec

-- | Run a custom action before the first spec item.
beforeAll_ :: HasCallStack => IO () -> SpecWith a -> SpecWith a

-- | Run a custom action with an argument before the first spec item.
beforeAllWith :: HasCallStack => (b -> IO a) -> SpecWith a -> SpecWith b

-- | Run a custom action after every spec item.
after :: ActionWith a -> SpecWith a -> SpecWith a

-- | Run a custom action after every spec item.
after_ :: IO () -> SpecWith a -> SpecWith a

-- | Run a custom action after the last spec item.
afterAll :: HasCallStack => ActionWith a -> SpecWith a -> SpecWith a

-- | Run a custom action after the last spec item.
afterAll_ :: HasCallStack => IO () -> SpecWith a -> SpecWith a

-- | Run a custom action before and/or after every spec item, supplying it
--   with an argument obtained via IO.
--   
--   This is useful for tasks like creating a file handle or similar
--   resource before a test and destroying it after the test.
around :: (ActionWith a -> IO ()) -> SpecWith a -> Spec

-- | Run a custom action before and/or after every spec item.
around_ :: (IO () -> IO ()) -> SpecWith a -> SpecWith a

-- | Run a custom action before and/or after every spec item.
aroundWith :: (ActionWith a -> ActionWith b) -> SpecWith a -> SpecWith b

-- | Wrap an action around the given spec.
aroundAll :: HasCallStack => (ActionWith a -> IO ()) -> SpecWith a -> Spec

-- | Wrap an action around the given spec.
aroundAll_ :: HasCallStack => (IO () -> IO ()) -> SpecWith a -> SpecWith a

-- | Wrap an action around the given spec. Changes the arg type inside.
aroundAllWith :: HasCallStack => (ActionWith a -> ActionWith b) -> SpecWith a -> SpecWith b

-- | Modify the subject under test.
--   
--   Note that this resembles a contravariant functor on the first type
--   parameter of SpecM. This is because the subject is passed
--   inwards, as an argument to the spec item.
mapSubject :: (b -> a) -> SpecWith a -> SpecWith b

-- | Ignore the subject under test for a given spec.
ignoreSubject :: SpecWith () -> SpecWith a

-- | This module provides access to Hspec's internals. It is less stable
--   than other parts of the API. For most users Test.Hspec is
--   more suitable!
module Test.Hspec.Core.Spec

-- | The it function creates a spec item.
--   
--   A spec item consists of:
--   
--   
--   
- a textual description of a desired behavior
--   
- an example for that behavior
--   
--   
--   
--   describe "absolute" $ do
--     it "returns a positive number when given a negative number" $
--       absolute (-1) == 1
--   
--   
--   Example a optionally accepts an argument
--   Arg a, which is then given to the test body. This is
--   useful for provisioning resources for a test which are created and
--   cleaned up outside the test itself. See Arg for details.
--   
--   Note that this function is often on the scene of nasty type errors due
--   to GHC failing to infer the type of do notation in the test
--   body. It can be helpful to use TypeApplications to explicitly
--   specify the intended Example type.
it :: (HasCallStack, Example a) => String -> a -> SpecWith (Arg a)

-- | specify is an alias for it.
specify :: (HasCallStack, Example a) => String -> a -> SpecWith (Arg a)

-- | The describe function combines a list of specs into a larger
--   spec.
describe :: HasCallStack => String -> SpecWith a -> SpecWith a

-- | context is an alias for describe.
context :: HasCallStack => String -> SpecWith a -> SpecWith a

-- | pending can be used to mark a spec item as pending.
--   
--   If you want to textually specify a behavior but do not have an example
--   yet, use this:
--   
--   
--   describe "fancyFormatter" $ do
--     it "can format text in a way that everyone likes" $
--       pending
--   
pending :: HasCallStack => Expectation

-- | pendingWith is similar to pending, but it takes an
--   additional string argument that can be used to specify the reason for
--   why the spec item is pending.
pendingWith :: HasCallStack => String -> Expectation

-- | Changing it to xit marks the corresponding spec item as
--   pending.
--   
--   This can be used to temporarily disable a spec item.
xit :: (HasCallStack, Example a) => String -> a -> SpecWith (Arg a)

-- | xspecify is an alias for xit.
xspecify :: (HasCallStack, Example a) => String -> a -> SpecWith (Arg a)

-- | Changing describe to xdescribe marks all spec items of
--   the corresponding subtree as pending.
--   
--   This can be used to temporarily disable spec items.
xdescribe :: HasCallStack => String -> SpecWith a -> SpecWith a

-- | xcontext is an alias for xdescribe.
xcontext :: HasCallStack => String -> SpecWith a -> SpecWith a

-- | focus focuses all spec items of the given spec.
--   
--   Applying focus to a spec with focused spec items has no effect.
focus :: SpecWith a -> SpecWith a

-- | fit is an alias for fmap focus . it
fit :: (HasCallStack, Example a) => String -> a -> SpecWith (Arg a)

-- | fspecify is an alias for fit.
fspecify :: (HasCallStack, Example a) => String -> a -> SpecWith (Arg a)

-- | fdescribe is an alias for fmap focus . describe
fdescribe :: HasCallStack => String -> SpecWith a -> SpecWith a

-- | fcontext is an alias for fdescribe.
fcontext :: HasCallStack => String -> SpecWith a -> SpecWith a

-- | parallel marks all spec items of the given spec to be safe for
--   parallel evaluation.
parallel :: SpecWith a -> SpecWith a

-- | sequential marks all spec items of the given spec to be
--   evaluated sequentially.
sequential :: SpecWith a -> SpecWith a

-- | A SpecWith that can be evaluated directly by the hspec
--   function as it does not require any parameters.
type Spec = SpecWith ()

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

-- | A writer monad for SpecTree forests.
--   
--   This is used by describe and is used to construct the forest of
--   spec items.
--   
--   It allows for dynamically generated spec trees, for example, by using
--   data obtained by performing IO actions with runIO.
newtype SpecM a r
SpecM :: WriterT (Endo Config, [SpecTree a]) (ReaderT Env IO) r -> SpecM a r

-- | Convert a Spec to a forest of SpecTrees.
runSpecM :: SpecWith a -> IO (Endo Config, [SpecTree a])

-- | Create a Spec from a forest of SpecTrees.
fromSpecList :: [SpecTree a] -> SpecWith a

-- | Run an IO action while constructing the spec tree.
--   
--   SpecM is a monad to construct a spec tree, without executing
--   any spec items itself. runIO allows you to run IO actions
--   during this construction phase. The IO action is always run when the
--   spec tree is constructed (e.g. even when --dry-run is
--   specified). If you do not need the result of the IO action to
--   construct the spec tree, beforeAll may be more suitable for
--   your use case.
runIO :: IO r -> SpecM a r
mapSpecForest :: ([SpecTree a] -> [SpecTree b]) -> SpecM a r -> SpecM b r

-- | Deprecated: Use mapSpecItem_ instead.
mapSpecItem :: (ActionWith a -> ActionWith b) -> (Item a -> Item b) -> SpecWith a -> SpecWith b
mapSpecItem_ :: (Item a -> Item b) -> SpecWith a -> SpecWith b

-- | Modifies the Params on the spec items to be generated by
--   SpecWith.
modifyParams :: (Params -> Params) -> SpecWith a -> SpecWith a

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

-- | Get the path of describe labels, from the root all the way in
--   to the call-site of this function.
--   
--   
Example
--   
--   
--   >>> :{
--   runSpecM $ do
--     describe "foo" $ do
--       describe "bar" $ do
--         getSpecDescriptionPath >>= runIO . print
--   :}
--   ["foo","bar"]
--   
getSpecDescriptionPath :: SpecM a [String]

-- | A type class for examples, that is to say, test bodies as used in
--   it and similar functions.
class Example e where {
    
    -- | The argument type that is needed to run this <a>Example</a>. If
    --   <a>Arg</a> is <tt>()</tt>, no argument is required and the
    --   <a>Example</a> can be run as-is.
    --   
    --   The value of <a>Arg</a> is the difference between <a>Spec</a> (aka
    --   <tt><a>SpecWith</a> ()</tt>), which can be executed, and
    --   <tt><a>SpecWith</a> a</tt>, which cannot be executed without turning
    --   it into <a>Spec</a> first.
    --   
    --   To supply an argument to examples, use the functions in
    --   <a>Test.Hspec.Core.Hooks</a> such as <a>around</a>, <a>before</a>,
    --   <a>mapSubject</a> and similar.
    type Arg e;
    type Arg e = ();
}

-- | Evaluates an example.
--   
--   evaluateExample is expected to execute the test body inside the
--   IO action passed to the hook. It's often necessary to use an
--   IORef to pass data out like whether the test succeeded to the
--   outer IO action so it can be returned as a Result.
--   
--   Example:
--   
--   
--   newtype MyAction = MyAction (Int -> IO Bool)
--   
--   instance Example MyAction where
--     type Arg MyAction = Int
--   
--     evaluateExample (MyAction act) _params hook _progress = do
--       result <- newIORef (Result "" Success)
--       hook $ arg -> do
--         -- e.g. determines if arg is 42
--         ok <- act arg
--         let result' = Result "" $ if ok then Success else Failure Nothing NoReason
--         writeIORef result result'
--       readIORef result
--   
evaluateExample :: Example e => e -> Params -> (ActionWith (Arg e) -> IO ()) -> ProgressCallback -> IO Result

-- | QuickCheck and SmallCheck related parameters.
data Params
Params :: Args -> Maybe Int -> Params
[paramsQuickCheckArgs] :: Params -> Args
[paramsSmallCheckDepth] :: Params -> Maybe Int
defaultParams :: Params

-- | An IO action that expects an argument of type a.
--   
--   This type is what Examples are ultimately unlifted into for
--   execution.
type ActionWith a = a -> IO ()

-- | (CurrentItem, TotalItems) tuple.
type Progress = (Int, Int)

-- | Callback used by composite test items that contain many tests to
--   report their progress towards finishing them all.
--   
--   This is used, for example, to report how many QuickCheck examples are
--   finished.
type ProgressCallback = Progress -> IO ()

-- | The result of running an example
data Result
Result :: String -> ResultStatus -> Result
[resultInfo] :: Result -> String
[resultStatus] :: Result -> ResultStatus
data ResultStatus
Success :: ResultStatus
Pending :: Maybe Location -> Maybe String -> ResultStatus
Failure :: Maybe Location -> FailureReason -> ResultStatus

-- | Location is used to represent source locations.
data Location
Location :: FilePath -> Int -> Int -> Location
[locationFile] :: Location -> FilePath
[locationLine] :: Location -> Int
[locationColumn] :: Location -> Int
data FailureReason
NoReason :: FailureReason
Reason :: String -> FailureReason
ColorizedReason :: String -> FailureReason
ExpectedButGot :: Maybe String -> String -> String -> FailureReason
Error :: Maybe String -> SomeException -> FailureReason
safeEvaluate :: IO Result -> IO Result
safeEvaluateExample :: Example e => e -> Params -> (ActionWith (Arg e) -> IO ()) -> ProgressCallback -> IO Result

-- | A tree is used to represent a spec internally. The tree is
--   parameterized over the type of cleanup actions and the type of the
--   actual spec items.
type SpecTree a = Tree IO () Item a

-- | Internal tree data structure
data Tree c a
Node :: String -> [Tree c a] -> Tree c a
NodeWithCleanup :: Maybe (String, Location) -> c -> [Tree c a] -> Tree c a
Leaf :: a -> Tree c a

-- | Item is used to represent spec items internally. A spec item
--   consists of:
--   
--   
--   
- a textual description of a desired behavior
--   
- an example for that behavior
--   
- additional meta information
--   
--   
--   Everything that is an instance of the Example type class can be
--   used as an example, including QuickCheck properties, Hspec
--   expectations and HUnit assertions.
data Item a
Item :: String -> Maybe Location -> Maybe Bool -> Bool -> Annotations -> (Params -> (ActionWith a -> IO ()) -> ProgressCallback -> IO Result) -> Item a

-- | Textual description of behavior
[itemRequirement] :: Item a -> String

-- | Source location of the spec item
[itemLocation] :: Item a -> Maybe Location

-- | A flag that indicates whether it is safe to evaluate this spec item in
--   parallel with other spec items
[itemIsParallelizable] :: Item a -> Maybe Bool

-- | A flag that indicates whether this spec item is focused
[itemIsFocused] :: Item a -> Bool

-- | Arbitrary additional data that can be used by third-party extensions.
[itemAnnotations] :: Item a -> Annotations

-- | Example for behavior
[itemExample] :: Item a -> Params -> (ActionWith a -> IO ()) -> ProgressCallback -> IO Result

-- | The specGroup function combines a list of specs into a larger
--   spec.
specGroup :: HasCallStack => String -> [SpecTree a] -> SpecTree a

-- | The specItem function creates a spec item.
specItem :: (HasCallStack, Example e) => String -> e -> SpecTree (Arg e)
bimapTree :: (a -> b) -> (c -> d) -> Tree a c -> Tree b d
bimapForest :: (a -> b) -> (c -> d) -> [Tree a c] -> [Tree b d]
filterTree :: (a -> Bool) -> Tree c a -> Maybe (Tree c a)
filterForest :: (a -> Bool) -> [Tree c a] -> [Tree c a]
filterTreeWithLabels :: ([String] -> a -> Bool) -> Tree c a -> Maybe (Tree c a)
filterForestWithLabels :: ([String] -> a -> Bool) -> [Tree c a] -> [Tree c a]
pruneTree :: Tree c a -> Maybe (Tree c a)
pruneForest :: [Tree c a] -> [Tree c a]
location :: HasCallStack => Maybe Location

-- | Marks an entire spec forest as focused if nothing in it is already
--   focused.
focusForest :: [SpecTree a] -> [SpecTree a]

-- | Request a CallStack.
--   
--   NOTE: The implicit parameter ?callStack :: CallStack is an
--   implementation detail and should not be considered part of the
--   CallStack API, we may decide to change the implementation in
--   the future.
type HasCallStack = ?callStack :: CallStack
type Expectation = Assertion

-- | Warning: This API is experimental.
module Test.Hspec.Core.Extension.Tree
type SpecTree = SpecTree ()
mapItems :: (Item () -> Item ()) -> [SpecTree] -> [SpecTree]
filterItems :: (Item () -> Bool) -> [SpecTree] -> [SpecTree]

-- | Warning: This API is experimental.
module Test.Hspec.Core.Extension.Spec
mapItems :: (Item a -> Item b) -> SpecWith a -> SpecWith b

-- | Warning: This API is experimental.
module Test.Hspec.Core.Extension.Item

-- | Item is used to represent spec items internally. A spec item
--   consists of:
--   
--   
--   
- a textual description of a desired behavior
--   
- an example for that behavior
--   
- additional meta information
--   
--   
--   Everything that is an instance of the Example type class can be
--   used as an example, including QuickCheck properties, Hspec
--   expectations and HUnit assertions.
data Item a
Item :: String -> Maybe Location -> Maybe Bool -> Bool -> Annotations -> (Params -> (ActionWith a -> IO ()) -> ProgressCallback -> IO Result) -> Item a

-- | Textual description of behavior
[itemRequirement] :: Item a -> String

-- | Source location of the spec item
[itemLocation] :: Item a -> Maybe Location

-- | A flag that indicates whether it is safe to evaluate this spec item in
--   parallel with other spec items
[itemIsParallelizable] :: Item a -> Maybe Bool

-- | A flag that indicates whether this spec item is focused
[itemIsFocused] :: Item a -> Bool

-- | Arbitrary additional data that can be used by third-party extensions.
[itemAnnotations] :: Item a -> Annotations

-- | Example for behavior
[itemExample] :: Item a -> Params -> (ActionWith a -> IO ()) -> ProgressCallback -> IO Result

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

-- | QuickCheck and SmallCheck related parameters.
data Params
Params :: Args -> Maybe Int -> Params
[paramsQuickCheckArgs] :: Params -> Args
[paramsSmallCheckDepth] :: Params -> Maybe Int

-- | An IO action that expects an argument of type a.
--   
--   This type is what Examples are ultimately unlifted into for
--   execution.
type ActionWith a = a -> IO ()

-- | (CurrentItem, TotalItems) tuple.
type Progress = (Int, Int)

-- | Callback used by composite test items that contain many tests to
--   report their progress towards finishing them all.
--   
--   This is used, for example, to report how many QuickCheck examples are
--   finished.
type ProgressCallback = Progress -> IO ()

-- | The result of running an example
data Result
Result :: String -> ResultStatus -> Result
[resultInfo] :: Result -> String
[resultStatus] :: Result -> ResultStatus
data ResultStatus
Success :: ResultStatus
Pending :: Maybe Location -> Maybe String -> ResultStatus
Failure :: Maybe Location -> FailureReason -> ResultStatus
data FailureReason
NoReason :: FailureReason
Reason :: String -> FailureReason
ColorizedReason :: String -> FailureReason
ExpectedButGot :: Maybe String -> String -> String -> FailureReason
Error :: Maybe String -> SomeException -> FailureReason
isFocused :: Item a -> Bool
pending :: Item a -> Item a
pendingWith :: String -> Item a -> Item a
setAnnotation :: Typeable value => value -> Item a -> Item a
getAnnotation :: Typeable value => Item a -> Maybe value

-- | Warning: This API is experimental.
module Test.Hspec.Core.Extension.Option
data Option
flag :: String -> (Bool -> Config -> Config) -> String -> Option
argument :: String -> String -> (String -> Config -> Maybe Config) -> String -> Option
noArgument :: String -> (Config -> Config) -> String -> Option
optionalArgument :: String -> String -> (Maybe String -> Config -> Maybe Config) -> String -> Option

-- | Warning: This API is experimental.
module Test.Hspec.Core.Extension.Config
data Config
Config :: Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Maybe Int -> Bool -> Bool -> Bool -> Maybe Integer -> Maybe Integer -> Maybe FilePath -> Bool -> Bool -> Maybe (Path -> Bool) -> Maybe (Path -> Bool) -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> ColorMode -> UnicodeMode -> Bool -> Maybe Int -> Maybe (Maybe Int -> String -> String -> IO ()) -> Bool -> (Bool -> String -> String -> (String, String)) -> (SomeException -> String) -> Bool -> Bool -> [(String, FormatConfig -> IO Format)] -> Maybe (FormatConfig -> IO Format) -> Maybe Formatter -> Bool -> Maybe Int -> Annotations -> Config
[configIgnoreConfigFile] :: Config -> Bool
[configDryRun] :: Config -> Bool
[configFocusedOnly] :: Config -> Bool
[configFailOnEmpty] :: Config -> Bool
[configFailOnFocused] :: Config -> Bool
[configFailOnPending] :: Config -> Bool
[configFailOnEmptyDescription] :: Config -> Bool
[configPrintSlowItems] :: Config -> Maybe Int
[configPrintCpuTime] :: Config -> Bool
[configFailFast] :: Config -> Bool
[configRandomize] :: Config -> Bool
[configSeed] :: Config -> Maybe Integer

-- | Deprecated: Use configSeed instead.
[configQuickCheckSeed] :: Config -> Maybe Integer
[configFailureReport] :: Config -> Maybe FilePath
[configRerun] :: Config -> Bool
[configRerunAllOnSuccess] :: Config -> Bool
[configFilterPredicate] :: Config -> Maybe (Path -> Bool)
[configSkipPredicate] :: Config -> Maybe (Path -> Bool)
[configQuickCheckMaxSuccess] :: Config -> Maybe Int
[configQuickCheckMaxDiscardRatio] :: Config -> Maybe Int
[configQuickCheckMaxSize] :: Config -> Maybe Int
[configQuickCheckMaxShrinks] :: Config -> Maybe Int
[configSmallCheckDepth] :: Config -> Maybe Int
[configColorMode] :: Config -> ColorMode
[configUnicodeMode] :: Config -> UnicodeMode
[configDiff] :: Config -> Bool
[configDiffContext] :: Config -> Maybe Int
[configExternalDiff] :: Config -> Maybe (Maybe Int -> String -> String -> IO ())
[configPrettyPrint] :: Config -> Bool
[configPrettyPrintFunction] :: Config -> Bool -> String -> String -> (String, String)

[configFormatException] :: Config -> SomeException -> String
[configTimes] :: Config -> Bool

[configExpertMode] :: Config -> Bool

[configAvailableFormatters] :: Config -> [(String, FormatConfig -> IO Format)]
[configFormat] :: Config -> Maybe (FormatConfig -> IO Format)

-- | Deprecated: Use useFormatter instead.
[configFormatter] :: Config -> Maybe Formatter
[configHtmlOutput] :: Config -> Bool
[configConcurrentJobs] :: Config -> Maybe Int
[configAnnotations] :: Config -> Annotations

-- | A Path 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)
data ColorMode
ColorAuto :: ColorMode
ColorNever :: ColorMode
ColorAlways :: ColorMode
data UnicodeMode
UnicodeAuto :: UnicodeMode
UnicodeNever :: UnicodeMode
UnicodeAlways :: UnicodeMode
setAnnotation :: Typeable value => value -> Config -> Config
getAnnotation :: Typeable value => Config -> Maybe value

-- | Warning: This API is experimental.
module Test.Hspec.Core.Extension

-- | Run an IO action while constructing the spec tree.
--   
--   SpecM is a monad to construct a spec tree, without executing
--   any spec items itself. runIO allows you to run IO actions
--   during this construction phase. The IO action is always run when the
--   spec tree is constructed (e.g. even when --dry-run is
--   specified). If you do not need the result of the IO action to
--   construct the spec tree, beforeAll may be more suitable for
--   your use case.
runIO :: IO r -> SpecM a r

modifyConfig :: (Config -> Config) -> SpecWith a
data Option
registerOptions :: HasCallStack => [Option] -> SpecWith a

-- | Register a transformation that transforms the spec tree in phase 3.
--   
--   The registered transformation can use:
--   
--   
--   
- Tree.mapItems to modify spec items
--   
- Tree.filterItems to discard spec items
--   
- Config.getAnnotation to access custom config
--   metadata
--   
- Item.getAnnotation to access custom item
--   metadata
--   
registerTransformation :: (Config -> [SpecTree] -> [SpecTree]) -> SpecWith a
data Config

-- | Item is used to represent spec items internally. A spec item
--   consists of:
--   
--   
--   
- a textual description of a desired behavior
--   
- an example for that behavior
--   
- additional meta information
--   
--   
--   Everything that is an instance of the Example type class can be
--   used as an example, including QuickCheck properties, Hspec
--   expectations and HUnit assertions.
data Item a

-- | A writer monad for SpecTree forests.
--   
--   This is used by describe and is used to construct the forest of
--   spec items.
--   
--   It allows for dynamically generated spec trees, for example, by using
--   data obtained by performing IO actions with runIO.
data SpecM a r

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

module Test.Hspec.Core.Runner

-- | Run a given spec and write a report to stdout. Exit with
--   exitFailure if at least one spec item fails.
--   
--   Note: hspec handles command-line options and reads
--   config files. This is not always desirable. Use evalSpec and
--   runSpecForest if you need more control over these aspects.
hspec :: Spec -> IO ()

-- | Run given spec with custom options. This is similar to hspec,
--   but more flexible.
hspecWith :: Config -> Spec -> IO ()

-- | Run given spec and returns a summary of the test run.
--   
--   Note: hspecResult does not exit with exitFailure
--   on failing spec items. If you need this, you have to check the
--   Summary yourself and act accordingly.
hspecResult :: Spec -> IO Summary

-- | Run given spec with custom options and returns a summary of the test
--   run.
--   
--   Note: hspecWithResult does not exit with
--   exitFailure on failing spec items. If you need this, you have
--   to check the Summary yourself and act accordingly.
hspecWithResult :: Config -> Spec -> IO Summary

-- | Summary of a test run.
data Summary
Summary :: !Int -> !Int -> Summary
[summaryExamples] :: Summary -> !Int
[summaryFailures] :: Summary -> !Int

-- | True if the given Summary indicates that there were no
--   failures, False otherwise.
isSuccess :: Summary -> Bool

-- | Exit with exitFailure if the given Summary indicates
--   that there was at least one failure.
evaluateSummary :: Summary -> IO ()

-- | Evaluate a Spec to a forest of SpecTrees. This does not
--   execute any spec items, but it does run any IO that is used during
--   spec construction time (see runIO).
--   
--   A Spec may modify a Config through modifyConfig.
--   These modifications are applied to the given config (the first
--   argument).
evalSpec :: Config -> SpecWith a -> IO (Config, [SpecTree a])

-- | runSpecForest is the most basic primitive to run a spec.
--   hspec is defined in terms of runSpecForest:
--   
--   
--   hspec = evalSpec defaultConfig >=> \ (config, spec) ->
--         getArgs
--     >>= readConfig config
--     >>= withArgs [] . runSpecForest spec
--     >>= evaluateResult
--   
runSpecForest :: [SpecTree ()] -> Config -> IO SpecResult
evaluateResult :: SpecResult -> IO ()

data SpecResult

specResultItems :: SpecResult -> [ResultItem]

specResultSuccess :: SpecResult -> Bool
toSummary :: SpecResult -> Summary

data ResultItem

resultItemPath :: ResultItem -> Path

resultItemStatus :: ResultItem -> ResultItemStatus

resultItemIsFailure :: ResultItem -> Bool
data ResultItemStatus
ResultItemSuccess :: ResultItemStatus
ResultItemPending :: ResultItemStatus
ResultItemFailure :: ResultItemStatus
data Config
Config :: Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Maybe Int -> Bool -> Bool -> Bool -> Maybe Integer -> Maybe Integer -> Maybe FilePath -> Bool -> Bool -> Maybe (Path -> Bool) -> Maybe (Path -> Bool) -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> ColorMode -> UnicodeMode -> Bool -> Maybe Int -> Maybe (Maybe Int -> String -> String -> IO ()) -> Bool -> (Bool -> String -> String -> (String, String)) -> (SomeException -> String) -> Bool -> Bool -> [(String, FormatConfig -> IO Format)] -> Maybe (FormatConfig -> IO Format) -> Maybe Formatter -> Bool -> Maybe Int -> Annotations -> Config
[configIgnoreConfigFile] :: Config -> Bool
[configDryRun] :: Config -> Bool
[configFocusedOnly] :: Config -> Bool
[configFailOnEmpty] :: Config -> Bool
[configFailOnFocused] :: Config -> Bool
[configFailOnPending] :: Config -> Bool
[configFailOnEmptyDescription] :: Config -> Bool
[configPrintSlowItems] :: Config -> Maybe Int
[configPrintCpuTime] :: Config -> Bool
[configFailFast] :: Config -> Bool
[configRandomize] :: Config -> Bool
[configSeed] :: Config -> Maybe Integer

-- | Deprecated: Use configSeed instead.
[configQuickCheckSeed] :: Config -> Maybe Integer
[configFailureReport] :: Config -> Maybe FilePath
[configRerun] :: Config -> Bool
[configRerunAllOnSuccess] :: Config -> Bool
[configFilterPredicate] :: Config -> Maybe (Path -> Bool)
[configSkipPredicate] :: Config -> Maybe (Path -> Bool)
[configQuickCheckMaxSuccess] :: Config -> Maybe Int
[configQuickCheckMaxDiscardRatio] :: Config -> Maybe Int
[configQuickCheckMaxSize] :: Config -> Maybe Int
[configQuickCheckMaxShrinks] :: Config -> Maybe Int
[configSmallCheckDepth] :: Config -> Maybe Int
[configColorMode] :: Config -> ColorMode
[configUnicodeMode] :: Config -> UnicodeMode
[configDiff] :: Config -> Bool
[configDiffContext] :: Config -> Maybe Int
[configExternalDiff] :: Config -> Maybe (Maybe Int -> String -> String -> IO ())
[configPrettyPrint] :: Config -> Bool
[configPrettyPrintFunction] :: Config -> Bool -> String -> String -> (String, String)

[configFormatException] :: Config -> SomeException -> String
[configTimes] :: Config -> Bool

[configExpertMode] :: Config -> Bool

[configAvailableFormatters] :: Config -> [(String, FormatConfig -> IO Format)]
[configFormat] :: Config -> Maybe (FormatConfig -> IO Format)

-- | Deprecated: Use useFormatter instead.
[configFormatter] :: Config -> Maybe Formatter
[configHtmlOutput] :: Config -> Bool
[configConcurrentJobs] :: Config -> Maybe Int
[configAnnotations] :: Config -> Annotations
data ColorMode
ColorAuto :: ColorMode
ColorNever :: ColorMode
ColorAlways :: ColorMode
data UnicodeMode
UnicodeAuto :: UnicodeMode
UnicodeNever :: UnicodeMode
UnicodeAlways :: UnicodeMode

-- | A Path 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)
defaultConfig :: Config

-- | Make a formatter available for use with --format.

-- | Deprecated: Use registerFormatter instead.
registerFormatter :: (String, FormatConfig -> IO Format) -> Config -> Config

-- | Make a formatter available for use with --format and use it
--   by default.

-- | Deprecated: Use useFormatter instead.
registerDefaultFormatter :: (String, FormatConfig -> IO Format) -> Config -> Config

-- | Add a filter predicate to config. If there is already a filter
--   predicate, then combine them with ||.
configAddFilter :: (Path -> Bool) -> Config -> Config

-- | readConfig parses config options from several sources and
--   constructs a Config value. It takes options from:
--   
--   
--   
- ~/.hspec (a config file in the user's home
--   directory)
--   
- .hspec (a config file in the current working
--   directory)
--   
- environment variables starting with HSPEC_
--   
- the provided list of command-line options (the second argument to
--   readConfig)
--   
--   
--   (precedence from low to high)
--   
--   When parsing fails then readConfig writes an error message to
--   stderr and exits with exitFailure.
--   
--   When --help is provided as a command-line option then
--   readConfig writes a help message to stdout and exits
--   with exitSuccess.
--   
--   A common way to use readConfig is:
--   
--   
--   getArgs >>= readConfig defaultConfig
--   
readConfig :: Config -> [String] -> IO Config

-- | Note: runSpec is deprecated. It ignores any
--   modifications applied through modifyConfig. Use evalSpec
--   and runSpecForest instead.
runSpec :: Spec -> Config -> IO Summary

-- | A SpecWith that can be evaluated directly by the hspec
--   function as it does not require any parameters.
type Spec = SpecWith ()

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