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


-- | Integrate Hedgehog and Hspec!
--   
--   Please see the README on GitHub at
--   <a>https://github.com/parsonsmatt/hspec-hedgehog#readme</a>
@package hspec-hedgehog
@version 0.1.1.0


-- | This module allows you to easily integrate the <a>Hedgehog</a> library
--   with <a>Test.Hspec</a> test-suites.
--   
--   To get started, check out the <a>hedgehog</a> function, which lets you
--   embed a <a>PropertyT</a> directly.
--   
--   <pre>
--   spec :: <a>Spec</a>
--   spec =
--     <a>describe</a> "my great test" <a>$</a> do
--       <a>it</a> "generates stuff" <a>$</a>
--         <a>hedgehog</a> <a>$</a> do
--           a &lt;- <a>forAll</a> generator
--           a <a>===</a> expected
--   </pre>
--   
--   Truth be told, the functionality is in the two orphan instances of
--   <a>Example</a> for <a>PropertyT</a>. You can directly use code in the
--   <tt><a>PropertyT</a> <a>IO</a></tt> type. However, because most
--   <a>Hedgehog</a> functions are abstract in <a>MonadTest</a>, you might
--   get errors about ambiguous types. The <a>hedgehog</a> function fixes
--   the type to <tt><a>PropertyT</a> <a>IO</a> <tt>()</tt></tt>, which
--   works out just fine.
--   
--   You can use all of <tt>hspec</tt>'s hooks with this, of course.
--   
--   <pre>
--   spec :: Spec
--   spec = <a>before</a> (<a>pure</a> "Hello!") <a>$</a> do
--     <a>describe</a> "with a string" <a>$</a> do
--       <a>it</a> "gets a string" <a>$</a> \ str -&gt;
--         <a>hedgehog</a> <a>$</a> do
--           wrongLen &lt;- <a>forAll</a> $ <a>integral</a> (<a>linear</a> 0 3)
--           length str <a>/==</a> wrongLen
--   </pre>
--   
--   The function <a>before</a> will make all the following spec items a
--   function, accepting that as a parameter. You should call
--   <a>hedgehog</a> after the lambda.
--   
--   If you are morally opposed to the pattern:
--   
--   <pre>
--   <a>it</a> "message" $ <a>hedgehog</a> $ do
--     True <a>===</a> False
--   </pre>
--   
--   Then you can alternatively force the type some other way. One option
--   is to use a no-op function, like this:
--   
--   <pre>
--   <a>it</a> "message" $ do
--     <a>pure</a> () :: <a>PropertyT</a> <a>IO</a> ()
--     True <a>===</a> False
--   </pre>
--   
--   This style has the advantage that parameters via hooks are less
--   difficult to get right.
--   
--   <pre>
--   <a>before</a> (<a>pure</a> "Hello!") $ do
--     <a>it</a> "message" $ \str -&gt; do
--       <a>pure</a> () :: <a>PropertyT</a> <a>IO</a> ()
--       wrongLen &lt;- <a>forAll</a> $ <a>integral</a> (<a>linear</a> 0 3)
--       <a>length</a> str <a>/==</a> wrongLen
--   </pre>
--   
--   You don't have to remember to put the <a>hedgehog</a> call after the
--   lambda.
module Test.Hspec.Hedgehog

-- | Embed a <a>Hedgehog</a> <tt><a>PropertyT</a> <a>IO</a> ()</tt> in an
--   <tt>hspec</tt> test.
--   
--   <pre>
--   spec :: <a>Spec</a>
--   spec =
--     <a>describe</a> "my great test" <a>$</a> do
--       <a>it</a> "generates stuff" <a>$</a>
--         <a>hedgehog</a> <a>$</a> do
--           a &lt;- <a>forAll</a> generator
--           a <a>===</a> expected
--   </pre>
--   
--   This function is only used to fix the type of the
--   <tt><a>PropertyT</a></tt> monad transformer. The functions in
--   <a>Hedgehog</a> are typically abstract in a <a>MonadTest</a>, and it's
--   easy to get ambiguous type errors if you leave this out.
hedgehog :: HasCallStack => PropertyT IO () -> PropertyT IO ()

-- | Use modified <a>Args</a> for given spec.
modifyArgs :: (Args -> Args) -> SpecWith a -> SpecWith a

-- | 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
instance (m GHC.Types.~ GHC.Types.IO) => Test.Hspec.Core.Example.Example (Hedgehog.Internal.Property.PropertyT m ())
instance (m GHC.Types.~ GHC.Types.IO) => Test.Hspec.Core.Example.Example (a -> Hedgehog.Internal.Property.PropertyT m ())
