-- 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.9


module Test.Hspec.Core.Util

-- | <tt>pluralize count singular</tt> pluralizes the given
--   <tt>singular</tt> word unless given <tt>count</tt> is 1.
--   
--   Examples:
--   
--   <pre>
--   &gt;&gt;&gt; pluralize 0 "example"
--   "0 examples"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; pluralize 1 "example"
--   "1 example"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; pluralize 2 "example"
--   "2 examples"
--   </pre>
pluralize :: Int -> String -> String

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

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

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

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

-- | Join a <a>Path</a> 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

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

-- | 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

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


-- | This is an unstable API. Use <a>Test.Hspec.Api.Format.V2</a> 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 ())

-- | <i>Deprecated: Use <a>formatConfigPrettyPrintFunction</a> instead</i>
[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
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
instance GHC.Show.Show Test.Hspec.Core.Format.Result
instance GHC.Show.Show Test.Hspec.Core.Format.Item
instance GHC.Show.Show Test.Hspec.Core.Format.Event


-- | This is an unstable API. Use <a>Test.Hspec.Api.Formatters.V3</a>
--   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 <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)
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
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 ())

-- | <i>Deprecated: Use <a>formatConfigPrettyPrintFunction</a> instead</i>
[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 <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.

-- | <i>Deprecated: use <a>prettyPrintFunction</a> instead</i>
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
instance GHC.Show.Show Test.Hspec.Core.Formatters.V2.Chunk
instance GHC.Classes.Eq Test.Hspec.Core.Formatters.V2.Chunk
instance GHC.Show.Show Test.Hspec.Core.Formatters.V2.ColorChunk
instance GHC.Classes.Eq Test.Hspec.Core.Formatters.V2.ColorChunk
instance GHC.Classes.Eq Test.Hspec.Core.Formatters.V2.StartsWith


-- | This module contains formatters that can be used with
--   <a>hspecWith</a>.

-- | <i>Deprecated: Use <a>Test.Hspec.Api.Formatters.V1</a> instead.</i>
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 <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


-- | <i>Deprecated: Use <a>Test.Hspec.Api.Formatters.V1</a> instead.</i>
module Test.Hspec.Core.Formatters


module Test.Hspec.Core.QuickCheck

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

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

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

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

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


module Test.Hspec.Core.Hooks
type Spec = SpecWith ()
type SpecWith a = SpecM a ()

-- | An <a>IO</a> action that expects an argument of type <tt>a</tt>
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.
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 :: forall a b. 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 <a>SpecM</a>. 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 <tt>Test.Hspec</tt> is
--   more suitable!
module Test.Hspec.Core.Spec

-- | The <tt>it</tt> function creates a spec item.
--   
--   A spec item consists of:
--   
--   <ul>
--   <li>a textual description of a desired behavior</li>
--   <li>an example for that behavior</li>
--   </ul>
--   
--   <pre>
--   describe "absolute" $ do
--     it "returns a positive number when given a negative number" $
--       absolute (-1) == 1
--   </pre>
it :: (HasCallStack, Example a) => String -> a -> SpecWith (Arg a)

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

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

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

-- | <a>pending</a> 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:
--   
--   <pre>
--   describe "fancyFormatter" $ do
--     it "can format text in a way that everyone likes" $
--       pending
--   </pre>
pending :: HasCallStack => Expectation

-- | <a>pendingWith</a> is similar to <a>pending</a>, 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 <a>it</a> to <a>xit</a> 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)

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

-- | Changing <a>describe</a> to <a>xdescribe</a> 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

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

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

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

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

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

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

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

-- | <a>sequential</a> marks all spec items of the given spec to be
--   evaluated sequentially.
sequential :: SpecWith a -> SpecWith a
type Spec = SpecWith ()
type SpecWith a = SpecM a ()

-- | A writer monad for <a>SpecTree</a> forests
newtype SpecM a r
SpecM :: WriterT (Endo Config, [SpecTree a]) (ReaderT Env IO) r -> SpecM a r

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

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

-- | Run an IO action while constructing the spec tree.
--   
--   <a>SpecM</a> is a monad to construct a spec tree, without executing
--   any spec items. <tt>runIO</tt> 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 <tt>--dry-run</tt> is specified).
--   If you do not need the result of the IO action to construct the spec
--   tree, <a>beforeAll</a> 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 <a>mapSpecItem_</a> instead.
mapSpecItem :: (ActionWith a -> ActionWith b) -> (Item a -> Item b) -> SpecWith a -> SpecWith b
mapSpecItem_ :: (Item a -> Item b) -> SpecWith a -> SpecWith b
modifyParams :: (Params -> Params) -> SpecWith a -> SpecWith a

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

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

-- | A type class for examples
class Example e where {
    type Arg e;
    type Arg e = ();
}
evaluateExample :: Example e => e -> Params -> (ActionWith (Arg e) -> IO ()) -> ProgressCallback -> IO Result
data Params
Params :: Args -> Maybe Int -> Params
[paramsQuickCheckArgs] :: Params -> Args
[paramsSmallCheckDepth] :: Params -> Maybe Int
defaultParams :: Params

-- | An <a>IO</a> action that expects an argument of type <tt>a</tt>
type ActionWith a = a -> IO ()
type Progress = (Int, Int)
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

-- | <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 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

-- | <tt>Item</tt> is used to represent spec items internally. A spec item
--   consists of:
--   
--   <ul>
--   <li>a textual description of a desired behavior</li>
--   <li>an example for that behavior</li>
--   <li>additional meta information</li>
--   </ul>
--   
--   Everything that is an instance of the <a>Example</a> 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 -> (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

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

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

-- | The <tt>specItem</tt> 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
focusForest :: [SpecTree a] -> [SpecTree a]
type HasCallStack = ?callStack :: CallStack
type Expectation = Assertion


module Test.Hspec.Core.Runner

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

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

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

-- | Run given spec with custom options and returns a summary of the test
--   run.
--   
--   <i>Note</i>: <a>hspecWithResult</a> does not exit with
--   <a>exitFailure</a> on failing spec items. If you need this, you have
--   to check the <a>Summary</a> 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

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

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

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

-- | <a>runSpecForest</a> is the most basic primitive to run a spec.
--   <a>hspec</a> is defined in terms of <tt>runSpecForest</tt>:
--   
--   <pre>
--   hspec = <a>evalSpec</a> <a>defaultConfig</a> &gt;=&gt; \ (config, spec) -&gt;
--         <a>getArgs</a>
--     &gt;&gt;= <a>readConfig</a> config
--     &gt;&gt;= <a>withArgs</a> [] . runSpecForest spec
--     &gt;&gt;= <a>evaluateResult</a>
--   </pre>
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 -> 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

-- | <i>Deprecated: Use <a>configSeed</a> instead.</i>
[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)

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

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

-- | Make a formatter available for use with <tt>--format</tt>.

-- | <i>Deprecated: Use <a><tt>registerFormatter</tt></a> instead.</i>
registerFormatter :: (String, FormatConfig -> IO Format) -> Config -> Config

-- | Make a formatter available for use with <tt>--format</tt> and use it
--   by default.

-- | <i>Deprecated: Use <a><tt>useFormatter</tt></a> instead.</i>
registerDefaultFormatter :: (String, FormatConfig -> IO Format) -> Config -> Config

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

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

-- | <i>Note</i>: <a>runSpec</a> is deprecated. It ignores any
--   modifications applied through <a>modifyConfig</a>. Use <a>evalSpec</a>
--   and <a>runSpecForest</a> instead.
runSpec :: Spec -> Config -> IO Summary
type Spec = SpecWith ()
type SpecWith a = SpecM a ()
instance GHC.Show.Show Test.Hspec.Core.Runner.ProgressReporting
instance GHC.Classes.Eq Test.Hspec.Core.Runner.ProgressReporting
instance GHC.Show.Show Test.Hspec.Core.Runner.UseColor
instance GHC.Classes.Eq Test.Hspec.Core.Runner.UseColor
