{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE InstanceSigs #-}

-- | The core Spec/SpecCommand types, used to define the test free monad.

module Test.Sandwich.Types.Spec where

import Control.Exception.Safe
import Control.Monad.Base
import Control.Monad.Except
import Control.Monad.Free
import Control.Monad.Free.TH
import Control.Monad.IO.Unlift
import Control.Monad.Logger
import Control.Monad.Reader
import Control.Monad.Trans.Control
import Data.Functor.Classes
import Data.Maybe
import Data.String.Interpolate
import GHC.Stack
import GHC.TypeLits
import Safe

-- * ExampleM monad

newtype ExampleT context m a = ExampleT { ExampleT context m a -> ReaderT context (LoggingT m) a
unExampleT :: ReaderT context (LoggingT m) a }
  deriving (a -> ExampleT context m b -> ExampleT context m a
(a -> b) -> ExampleT context m a -> ExampleT context m b
(forall a b.
 (a -> b) -> ExampleT context m a -> ExampleT context m b)
-> (forall a b. a -> ExampleT context m b -> ExampleT context m a)
-> Functor (ExampleT context m)
forall a b. a -> ExampleT context m b -> ExampleT context m a
forall a b.
(a -> b) -> ExampleT context m a -> ExampleT context m b
forall context (m :: * -> *) a b.
Functor m =>
a -> ExampleT context m b -> ExampleT context m a
forall context (m :: * -> *) a b.
Functor m =>
(a -> b) -> ExampleT context m a -> ExampleT context m b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> ExampleT context m b -> ExampleT context m a
$c<$ :: forall context (m :: * -> *) a b.
Functor m =>
a -> ExampleT context m b -> ExampleT context m a
fmap :: (a -> b) -> ExampleT context m a -> ExampleT context m b
$cfmap :: forall context (m :: * -> *) a b.
Functor m =>
(a -> b) -> ExampleT context m a -> ExampleT context m b
Functor, Functor (ExampleT context m)
a -> ExampleT context m a
Functor (ExampleT context m)
-> (forall a. a -> ExampleT context m a)
-> (forall a b.
    ExampleT context m (a -> b)
    -> ExampleT context m a -> ExampleT context m b)
-> (forall a b c.
    (a -> b -> c)
    -> ExampleT context m a
    -> ExampleT context m b
    -> ExampleT context m c)
-> (forall a b.
    ExampleT context m a
    -> ExampleT context m b -> ExampleT context m b)
-> (forall a b.
    ExampleT context m a
    -> ExampleT context m b -> ExampleT context m a)
-> Applicative (ExampleT context m)
ExampleT context m a
-> ExampleT context m b -> ExampleT context m b
ExampleT context m a
-> ExampleT context m b -> ExampleT context m a
ExampleT context m (a -> b)
-> ExampleT context m a -> ExampleT context m b
(a -> b -> c)
-> ExampleT context m a
-> ExampleT context m b
-> ExampleT context m c
forall a. a -> ExampleT context m a
forall a b.
ExampleT context m a
-> ExampleT context m b -> ExampleT context m a
forall a b.
ExampleT context m a
-> ExampleT context m b -> ExampleT context m b
forall a b.
ExampleT context m (a -> b)
-> ExampleT context m a -> ExampleT context m b
forall a b c.
(a -> b -> c)
-> ExampleT context m a
-> ExampleT context m b
-> ExampleT context m c
forall context (m :: * -> *).
Applicative m =>
Functor (ExampleT context m)
forall context (m :: * -> *) a.
Applicative m =>
a -> ExampleT context m a
forall context (m :: * -> *) a b.
Applicative m =>
ExampleT context m a
-> ExampleT context m b -> ExampleT context m a
forall context (m :: * -> *) a b.
Applicative m =>
ExampleT context m a
-> ExampleT context m b -> ExampleT context m b
forall context (m :: * -> *) a b.
Applicative m =>
ExampleT context m (a -> b)
-> ExampleT context m a -> ExampleT context m b
forall context (m :: * -> *) a b c.
Applicative m =>
(a -> b -> c)
-> ExampleT context m a
-> ExampleT context m b
-> ExampleT context m c
forall (f :: * -> *).
Functor f
-> (forall a. a -> f a)
-> (forall a b. f (a -> b) -> f a -> f b)
-> (forall a b c. (a -> b -> c) -> f a -> f b -> f c)
-> (forall a b. f a -> f b -> f b)
-> (forall a b. f a -> f b -> f a)
-> Applicative f
<* :: ExampleT context m a
-> ExampleT context m b -> ExampleT context m a
$c<* :: forall context (m :: * -> *) a b.
Applicative m =>
ExampleT context m a
-> ExampleT context m b -> ExampleT context m a
*> :: ExampleT context m a
-> ExampleT context m b -> ExampleT context m b
$c*> :: forall context (m :: * -> *) a b.
Applicative m =>
ExampleT context m a
-> ExampleT context m b -> ExampleT context m b
liftA2 :: (a -> b -> c)
-> ExampleT context m a
-> ExampleT context m b
-> ExampleT context m c
$cliftA2 :: forall context (m :: * -> *) a b c.
Applicative m =>
(a -> b -> c)
-> ExampleT context m a
-> ExampleT context m b
-> ExampleT context m c
<*> :: ExampleT context m (a -> b)
-> ExampleT context m a -> ExampleT context m b
$c<*> :: forall context (m :: * -> *) a b.
Applicative m =>
ExampleT context m (a -> b)
-> ExampleT context m a -> ExampleT context m b
pure :: a -> ExampleT context m a
$cpure :: forall context (m :: * -> *) a.
Applicative m =>
a -> ExampleT context m a
$cp1Applicative :: forall context (m :: * -> *).
Applicative m =>
Functor (ExampleT context m)
Applicative, Applicative (ExampleT context m)
a -> ExampleT context m a
Applicative (ExampleT context m)
-> (forall a b.
    ExampleT context m a
    -> (a -> ExampleT context m b) -> ExampleT context m b)
-> (forall a b.
    ExampleT context m a
    -> ExampleT context m b -> ExampleT context m b)
-> (forall a. a -> ExampleT context m a)
-> Monad (ExampleT context m)
ExampleT context m a
-> (a -> ExampleT context m b) -> ExampleT context m b
ExampleT context m a
-> ExampleT context m b -> ExampleT context m b
forall a. a -> ExampleT context m a
forall a b.
ExampleT context m a
-> ExampleT context m b -> ExampleT context m b
forall a b.
ExampleT context m a
-> (a -> ExampleT context m b) -> ExampleT context m b
forall context (m :: * -> *).
Monad m =>
Applicative (ExampleT context m)
forall context (m :: * -> *) a.
Monad m =>
a -> ExampleT context m a
forall context (m :: * -> *) a b.
Monad m =>
ExampleT context m a
-> ExampleT context m b -> ExampleT context m b
forall context (m :: * -> *) a b.
Monad m =>
ExampleT context m a
-> (a -> ExampleT context m b) -> ExampleT context m b
forall (m :: * -> *).
Applicative m
-> (forall a b. m a -> (a -> m b) -> m b)
-> (forall a b. m a -> m b -> m b)
-> (forall a. a -> m a)
-> Monad m
return :: a -> ExampleT context m a
$creturn :: forall context (m :: * -> *) a.
Monad m =>
a -> ExampleT context m a
>> :: ExampleT context m a
-> ExampleT context m b -> ExampleT context m b
$c>> :: forall context (m :: * -> *) a b.
Monad m =>
ExampleT context m a
-> ExampleT context m b -> ExampleT context m b
>>= :: ExampleT context m a
-> (a -> ExampleT context m b) -> ExampleT context m b
$c>>= :: forall context (m :: * -> *) a b.
Monad m =>
ExampleT context m a
-> (a -> ExampleT context m b) -> ExampleT context m b
$cp1Monad :: forall context (m :: * -> *).
Monad m =>
Applicative (ExampleT context m)
Monad, Monad (ExampleT context m)
Monad (ExampleT context m)
-> (forall a. IO a -> ExampleT context m a)
-> MonadIO (ExampleT context m)
IO a -> ExampleT context m a
forall a. IO a -> ExampleT context m a
forall context (m :: * -> *).
MonadIO m =>
Monad (ExampleT context m)
forall context (m :: * -> *) a.
MonadIO m =>
IO a -> ExampleT context m a
forall (m :: * -> *).
Monad m -> (forall a. IO a -> m a) -> MonadIO m
liftIO :: IO a -> ExampleT context m a
$cliftIO :: forall context (m :: * -> *) a.
MonadIO m =>
IO a -> ExampleT context m a
$cp1MonadIO :: forall context (m :: * -> *).
MonadIO m =>
Monad (ExampleT context m)
MonadIO, MonadReader context, Monad (ExampleT context m)
Monad (ExampleT context m)
-> (forall msg.
    ToLogStr msg =>
    Loc -> LogSource -> LogLevel -> msg -> ExampleT context m ())
-> MonadLogger (ExampleT context m)
Loc -> LogSource -> LogLevel -> msg -> ExampleT context m ()
forall msg.
ToLogStr msg =>
Loc -> LogSource -> LogLevel -> msg -> ExampleT context m ()
forall context (m :: * -> *).
MonadIO m =>
Monad (ExampleT context m)
forall context (m :: * -> *) msg.
(MonadIO m, ToLogStr msg) =>
Loc -> LogSource -> LogLevel -> msg -> ExampleT context m ()
forall (m :: * -> *).
Monad m
-> (forall msg.
    ToLogStr msg =>
    Loc -> LogSource -> LogLevel -> msg -> m ())
-> MonadLogger m
monadLoggerLog :: Loc -> LogSource -> LogLevel -> msg -> ExampleT context m ()
$cmonadLoggerLog :: forall context (m :: * -> *) msg.
(MonadIO m, ToLogStr msg) =>
Loc -> LogSource -> LogLevel -> msg -> ExampleT context m ()
$cp1MonadLogger :: forall context (m :: * -> *).
MonadIO m =>
Monad (ExampleT context m)
MonadLogger, MonadIO (ExampleT context m)
MonadLogger (ExampleT context m)
ExampleT
  context m (Loc -> LogSource -> LogLevel -> LogStr -> IO ())
MonadLogger (ExampleT context m)
-> MonadIO (ExampleT context m)
-> ExampleT
     context m (Loc -> LogSource -> LogLevel -> LogStr -> IO ())
-> MonadLoggerIO (ExampleT context m)
forall context (m :: * -> *).
MonadIO m =>
MonadIO (ExampleT context m)
forall context (m :: * -> *).
MonadIO m =>
MonadLogger (ExampleT context m)
forall context (m :: * -> *).
MonadIO m =>
ExampleT
  context m (Loc -> LogSource -> LogLevel -> LogStr -> IO ())
forall (m :: * -> *).
MonadLogger m
-> MonadIO m
-> m (Loc -> LogSource -> LogLevel -> LogStr -> IO ())
-> MonadLoggerIO m
askLoggerIO :: ExampleT
  context m (Loc -> LogSource -> LogLevel -> LogStr -> IO ())
$caskLoggerIO :: forall context (m :: * -> *).
MonadIO m =>
ExampleT
  context m (Loc -> LogSource -> LogLevel -> LogStr -> IO ())
$cp2MonadLoggerIO :: forall context (m :: * -> *).
MonadIO m =>
MonadIO (ExampleT context m)
$cp1MonadLoggerIO :: forall context (m :: * -> *).
MonadIO m =>
MonadLogger (ExampleT context m)
MonadLoggerIO, Monad (ExampleT context m)
e -> ExampleT context m a
Monad (ExampleT context m)
-> (forall e a. Exception e => e -> ExampleT context m a)
-> MonadThrow (ExampleT context m)
forall e a. Exception e => e -> ExampleT context m a
forall context (m :: * -> *).
MonadThrow m =>
Monad (ExampleT context m)
forall context (m :: * -> *) e a.
(MonadThrow m, Exception e) =>
e -> ExampleT context m a
forall (m :: * -> *).
Monad m -> (forall e a. Exception e => e -> m a) -> MonadThrow m
throwM :: e -> ExampleT context m a
$cthrowM :: forall context (m :: * -> *) e a.
(MonadThrow m, Exception e) =>
e -> ExampleT context m a
$cp1MonadThrow :: forall context (m :: * -> *).
MonadThrow m =>
Monad (ExampleT context m)
MonadThrow, MonadThrow (ExampleT context m)
MonadThrow (ExampleT context m)
-> (forall e a.
    Exception e =>
    ExampleT context m a
    -> (e -> ExampleT context m a) -> ExampleT context m a)
-> MonadCatch (ExampleT context m)
ExampleT context m a
-> (e -> ExampleT context m a) -> ExampleT context m a
forall e a.
Exception e =>
ExampleT context m a
-> (e -> ExampleT context m a) -> ExampleT context m a
forall context (m :: * -> *).
MonadCatch m =>
MonadThrow (ExampleT context m)
forall context (m :: * -> *) e a.
(MonadCatch m, Exception e) =>
ExampleT context m a
-> (e -> ExampleT context m a) -> ExampleT context m a
forall (m :: * -> *).
MonadThrow m
-> (forall e a. Exception e => m a -> (e -> m a) -> m a)
-> MonadCatch m
catch :: ExampleT context m a
-> (e -> ExampleT context m a) -> ExampleT context m a
$ccatch :: forall context (m :: * -> *) e a.
(MonadCatch m, Exception e) =>
ExampleT context m a
-> (e -> ExampleT context m a) -> ExampleT context m a
$cp1MonadCatch :: forall context (m :: * -> *).
MonadCatch m =>
MonadThrow (ExampleT context m)
MonadCatch, MonadCatch (ExampleT context m)
MonadCatch (ExampleT context m)
-> (forall b.
    ((forall a. ExampleT context m a -> ExampleT context m a)
     -> ExampleT context m b)
    -> ExampleT context m b)
-> (forall b.
    ((forall a. ExampleT context m a -> ExampleT context m a)
     -> ExampleT context m b)
    -> ExampleT context m b)
-> (forall a b c.
    ExampleT context m a
    -> (a -> ExitCase b -> ExampleT context m c)
    -> (a -> ExampleT context m b)
    -> ExampleT context m (b, c))
-> MonadMask (ExampleT context m)
ExampleT context m a
-> (a -> ExitCase b -> ExampleT context m c)
-> (a -> ExampleT context m b)
-> ExampleT context m (b, c)
((forall a. ExampleT context m a -> ExampleT context m a)
 -> ExampleT context m b)
-> ExampleT context m b
((forall a. ExampleT context m a -> ExampleT context m a)
 -> ExampleT context m b)
-> ExampleT context m b
forall b.
((forall a. ExampleT context m a -> ExampleT context m a)
 -> ExampleT context m b)
-> ExampleT context m b
forall a b c.
ExampleT context m a
-> (a -> ExitCase b -> ExampleT context m c)
-> (a -> ExampleT context m b)
-> ExampleT context m (b, c)
forall context (m :: * -> *).
MonadMask m =>
MonadCatch (ExampleT context m)
forall context (m :: * -> *) b.
MonadMask m =>
((forall a. ExampleT context m a -> ExampleT context m a)
 -> ExampleT context m b)
-> ExampleT context m b
forall context (m :: * -> *) a b c.
MonadMask m =>
ExampleT context m a
-> (a -> ExitCase b -> ExampleT context m c)
-> (a -> ExampleT context m b)
-> ExampleT context m (b, c)
forall (m :: * -> *).
MonadCatch m
-> (forall b. ((forall a. m a -> m a) -> m b) -> m b)
-> (forall b. ((forall a. m a -> m a) -> m b) -> m b)
-> (forall a b c.
    m a -> (a -> ExitCase b -> m c) -> (a -> m b) -> m (b, c))
-> MonadMask m
generalBracket :: ExampleT context m a
-> (a -> ExitCase b -> ExampleT context m c)
-> (a -> ExampleT context m b)
-> ExampleT context m (b, c)
$cgeneralBracket :: forall context (m :: * -> *) a b c.
MonadMask m =>
ExampleT context m a
-> (a -> ExitCase b -> ExampleT context m c)
-> (a -> ExampleT context m b)
-> ExampleT context m (b, c)
uninterruptibleMask :: ((forall a. ExampleT context m a -> ExampleT context m a)
 -> ExampleT context m b)
-> ExampleT context m b
$cuninterruptibleMask :: forall context (m :: * -> *) b.
MonadMask m =>
((forall a. ExampleT context m a -> ExampleT context m a)
 -> ExampleT context m b)
-> ExampleT context m b
mask :: ((forall a. ExampleT context m a -> ExampleT context m a)
 -> ExampleT context m b)
-> ExampleT context m b
$cmask :: forall context (m :: * -> *) b.
MonadMask m =>
((forall a. ExampleT context m a -> ExampleT context m a)
 -> ExampleT context m b)
-> ExampleT context m b
$cp1MonadMask :: forall context (m :: * -> *).
MonadMask m =>
MonadCatch (ExampleT context m)
MonadMask)
type ExampleM context = ExampleT context IO

instance (MonadIO m, MonadUnliftIO m) => MonadUnliftIO (ExampleT context m) where
  withRunInIO :: ((forall a. ExampleT context m a -> IO a) -> IO b)
-> ExampleT context m b
withRunInIO (forall a. ExampleT context m a -> IO a) -> IO b
inner = ReaderT context (LoggingT m) b -> ExampleT context m b
forall context (m :: * -> *) a.
ReaderT context (LoggingT m) a -> ExampleT context m a
ExampleT (ReaderT context (LoggingT m) b -> ExampleT context m b)
-> ReaderT context (LoggingT m) b -> ExampleT context m b
forall a b. (a -> b) -> a -> b
$ ((forall a. ReaderT context (LoggingT m) a -> IO a) -> IO b)
-> ReaderT context (LoggingT m) b
forall (m :: * -> *) b.
MonadUnliftIO m =>
((forall a. m a -> IO a) -> IO b) -> m b
withRunInIO (((forall a. ReaderT context (LoggingT m) a -> IO a) -> IO b)
 -> ReaderT context (LoggingT m) b)
-> ((forall a. ReaderT context (LoggingT m) a -> IO a) -> IO b)
-> ReaderT context (LoggingT m) b
forall a b. (a -> b) -> a -> b
$ \forall a. ReaderT context (LoggingT m) a -> IO a
run -> (forall a. ExampleT context m a -> IO a) -> IO b
inner (ReaderT context (LoggingT m) a -> IO a
forall a. ReaderT context (LoggingT m) a -> IO a
run (ReaderT context (LoggingT m) a -> IO a)
-> (ExampleT context m a -> ReaderT context (LoggingT m) a)
-> ExampleT context m a
-> IO a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ExampleT context m a -> ReaderT context (LoggingT m) a
forall context (m :: * -> *) a.
ExampleT context m a -> ReaderT context (LoggingT m) a
unExampleT)

instance (MonadBase b m) => MonadBase b (ExampleT context m) where
  liftBase :: b α -> ExampleT context m α
liftBase = b α -> ExampleT context m α
forall (t :: (* -> *) -> * -> *) (b :: * -> *) (m :: * -> *) α.
(MonadTrans t, MonadBase b m) =>
b α -> t m α
liftBaseDefault

instance MonadTrans (ExampleT context) where
  lift :: m a -> ExampleT context m a
lift m a
x = ReaderT context (LoggingT m) a -> ExampleT context m a
forall context (m :: * -> *) a.
ReaderT context (LoggingT m) a -> ExampleT context m a
ExampleT (ReaderT context (LoggingT m) a -> ExampleT context m a)
-> ReaderT context (LoggingT m) a -> ExampleT context m a
forall a b. (a -> b) -> a -> b
$ (context -> LoggingT m a) -> ReaderT context (LoggingT m) a
forall r (m :: * -> *) a. (r -> m a) -> ReaderT r m a
ReaderT (\context
_ -> (((Loc -> LogSource -> LogLevel -> LogStr -> IO ()) -> m a)
-> LoggingT m a
forall (m :: * -> *) a.
((Loc -> LogSource -> LogLevel -> LogStr -> IO ()) -> m a)
-> LoggingT m a
LoggingT (\Loc -> LogSource -> LogLevel -> LogStr -> IO ()
_ -> m a
x)))

instance MonadTransControl (ExampleT context) where
  type StT (ExampleT context) a = StT LoggingT (StT (ReaderT context) a)
  liftWith :: (Run (ExampleT context) -> m a) -> ExampleT context m a
liftWith = (forall b. ReaderT context (LoggingT m) b -> ExampleT context m b)
-> (forall (o :: * -> *) b.
    ExampleT context o b -> ReaderT context (LoggingT o) b)
-> (RunDefault2 (ExampleT context) (ReaderT context) LoggingT
    -> m a)
-> ExampleT context m a
forall (m :: * -> *) (n' :: (* -> *) -> * -> *)
       (n :: (* -> *) -> * -> *) (t :: (* -> *) -> * -> *) a.
(Monad m, Monad (n' m), MonadTransControl n,
 MonadTransControl n') =>
(forall b. n (n' m) b -> t m b)
-> (forall (o :: * -> *) b. t o b -> n (n' o) b)
-> (RunDefault2 t n n' -> m a)
-> t m a
defaultLiftWith2 forall b. ReaderT context (LoggingT m) b -> ExampleT context m b
forall context (m :: * -> *) a.
ReaderT context (LoggingT m) a -> ExampleT context m a
ExampleT forall context (m :: * -> *) a.
ExampleT context m a -> ReaderT context (LoggingT m) a
forall (o :: * -> *) b.
ExampleT context o b -> ReaderT context (LoggingT o) b
unExampleT
  restoreT :: m (StT (ExampleT context) a) -> ExampleT context m a
restoreT = (ReaderT context (LoggingT m) a -> ExampleT context m a)
-> m (StT LoggingT (StT (ReaderT context) a))
-> ExampleT context m a
forall (m :: * -> *) (n' :: (* -> *) -> * -> *)
       (n :: (* -> *) -> * -> *) a (t :: (* -> *) -> * -> *).
(Monad m, Monad (n' m), MonadTransControl n,
 MonadTransControl n') =>
(n (n' m) a -> t m a) -> m (StT n' (StT n a)) -> t m a
defaultRestoreT2 ReaderT context (LoggingT m) a -> ExampleT context m a
forall context (m :: * -> *) a.
ReaderT context (LoggingT m) a -> ExampleT context m a
ExampleT

instance (MonadBaseControl b m) => MonadBaseControl b (ExampleT context m) where
  type StM (ExampleT context m) a = ComposeSt (ExampleT context) m a
  liftBaseWith :: (RunInBase (ExampleT context m) b -> b a) -> ExampleT context m a
liftBaseWith = (RunInBase (ExampleT context m) b -> b a) -> ExampleT context m a
forall (t :: (* -> *) -> * -> *) (b :: * -> *) (m :: * -> *) a.
(MonadTransControl t, MonadBaseControl b m) =>
(RunInBaseDefault t m b -> b a) -> t m a
defaultLiftBaseWith
  restoreM :: StM (ExampleT context m) a -> ExampleT context m a
restoreM = StM (ExampleT context m) a -> ExampleT context m a
forall (t :: (* -> *) -> * -> *) (b :: * -> *) (m :: * -> *) a.
(MonadTransControl t, MonadBaseControl b m) =>
ComposeSt t m a -> t m a
defaultRestoreM

instance (Monad m, MonadThrow m) => MonadFail (ExampleT context m) where
  fail :: (HasCallStack) => String -> ExampleT context m a
  fail :: String -> ExampleT context m a
fail = FailureReason -> ExampleT context m a
forall (m :: * -> *) e a. (MonadThrow m, Exception e) => e -> m a
throwIO (FailureReason -> ExampleT context m a)
-> (String -> FailureReason) -> String -> ExampleT context m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe CallStack -> String -> FailureReason
Reason (CallStack -> Maybe CallStack
forall a. a -> Maybe a
Just CallStack
HasCallStack => CallStack
callStack)

-- * Results

data Result = Success
            | Failure FailureReason
  deriving (Int -> Result -> ShowS
[Result] -> ShowS
Result -> String
(Int -> Result -> ShowS)
-> (Result -> String) -> ([Result] -> ShowS) -> Show Result
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Result] -> ShowS
$cshowList :: [Result] -> ShowS
show :: Result -> String
$cshow :: Result -> String
showsPrec :: Int -> Result -> ShowS
$cshowsPrec :: Int -> Result -> ShowS
Show, Result -> Result -> Bool
(Result -> Result -> Bool)
-> (Result -> Result -> Bool) -> Eq Result
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Result -> Result -> Bool
$c/= :: Result -> Result -> Bool
== :: Result -> Result -> Bool
$c== :: Result -> Result -> Bool
Eq)

data ShowEqBox = forall s. (Show s, Eq s) => SEB s
instance Show ShowEqBox where show :: ShowEqBox -> String
show (SEB s
x) = s -> String
forall a. Show a => a -> String
show s
x
instance Eq ShowEqBox where (SEB s
x1) == :: ShowEqBox -> ShowEqBox -> Bool
== (SEB s
x2) = s -> String
forall a. Show a => a -> String
show s
x1 String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== s -> String
forall a. Show a => a -> String
show s
x2

data FailureReason = Reason { FailureReason -> Maybe CallStack
failureCallStack :: Maybe CallStack
                            , FailureReason -> String
failureReason :: String }
                   | ExpectedButGot { failureCallStack :: Maybe CallStack
                                    , FailureReason -> ShowEqBox
failureValue1 :: ShowEqBox
                                    , FailureReason -> ShowEqBox
failureValue2 :: ShowEqBox }
                   | DidNotExpectButGot { failureCallStack :: Maybe CallStack
                                        , failureValue1 :: ShowEqBox }
                   | GotException { failureCallStack :: Maybe CallStack
                                  , FailureReason -> Maybe String
failureMessage :: Maybe String
                                  , FailureReason -> SomeExceptionWithEq
failureException :: SomeExceptionWithEq }
                   | Pending { failureCallStack :: Maybe CallStack
                             , FailureReason -> Maybe String
failurePendingMessage :: Maybe String }
                   | GetContextException { failureCallStack :: Maybe CallStack
                                         , failureException :: SomeExceptionWithEq }
                   | GotAsyncException { failureCallStack :: Maybe CallStack
                                       , failureMessage :: Maybe String
                                       , FailureReason -> SomeAsyncExceptionWithEq
failureAsyncException :: SomeAsyncExceptionWithEq }
                   | ChildrenFailed { failureCallStack :: Maybe CallStack
                                    , FailureReason -> Int
failureNumChildren :: Int }
  deriving (Int -> FailureReason -> ShowS
[FailureReason] -> ShowS
FailureReason -> String
(Int -> FailureReason -> ShowS)
-> (FailureReason -> String)
-> ([FailureReason] -> ShowS)
-> Show FailureReason
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FailureReason] -> ShowS
$cshowList :: [FailureReason] -> ShowS
show :: FailureReason -> String
$cshow :: FailureReason -> String
showsPrec :: Int -> FailureReason -> ShowS
$cshowsPrec :: Int -> FailureReason -> ShowS
Show, Typeable, FailureReason -> FailureReason -> Bool
(FailureReason -> FailureReason -> Bool)
-> (FailureReason -> FailureReason -> Bool) -> Eq FailureReason
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FailureReason -> FailureReason -> Bool
$c/= :: FailureReason -> FailureReason -> Bool
== :: FailureReason -> FailureReason -> Bool
$c== :: FailureReason -> FailureReason -> Bool
Eq)

instance Exception FailureReason

instance Eq CallStack where
  CallStack
c1 == :: CallStack -> CallStack -> Bool
== CallStack
c2 = CallStack -> String
forall a. Show a => a -> String
show CallStack
c1 String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== CallStack -> String
forall a. Show a => a -> String
show CallStack
c2

newtype SomeExceptionWithEq = SomeExceptionWithEq SomeException
instance Show SomeExceptionWithEq where
  show :: SomeExceptionWithEq -> String
show (SomeExceptionWithEq SomeException
e) = SomeException -> String
forall a. Show a => a -> String
show SomeException
e
instance Eq SomeExceptionWithEq where
  (SomeExceptionWithEq SomeException
e1) == :: SomeExceptionWithEq -> SomeExceptionWithEq -> Bool
== (SomeExceptionWithEq SomeException
e2) = SomeException -> String
forall a. Show a => a -> String
show SomeException
e1 String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== SomeException -> String
forall a. Show a => a -> String
show SomeException
e2

newtype SomeAsyncExceptionWithEq = SomeAsyncExceptionWithEq SomeAsyncException
  deriving Int -> SomeAsyncExceptionWithEq -> ShowS
[SomeAsyncExceptionWithEq] -> ShowS
SomeAsyncExceptionWithEq -> String
(Int -> SomeAsyncExceptionWithEq -> ShowS)
-> (SomeAsyncExceptionWithEq -> String)
-> ([SomeAsyncExceptionWithEq] -> ShowS)
-> Show SomeAsyncExceptionWithEq
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SomeAsyncExceptionWithEq] -> ShowS
$cshowList :: [SomeAsyncExceptionWithEq] -> ShowS
show :: SomeAsyncExceptionWithEq -> String
$cshow :: SomeAsyncExceptionWithEq -> String
showsPrec :: Int -> SomeAsyncExceptionWithEq -> ShowS
$cshowsPrec :: Int -> SomeAsyncExceptionWithEq -> ShowS
Show
instance Eq SomeAsyncExceptionWithEq where
  (SomeAsyncExceptionWithEq SomeAsyncException
e1) == :: SomeAsyncExceptionWithEq -> SomeAsyncExceptionWithEq -> Bool
== (SomeAsyncExceptionWithEq SomeAsyncException
e2) = SomeAsyncException -> String
forall a. Show a => a -> String
show SomeAsyncException
e1 String -> String -> Bool
forall a. Eq a => a -> a -> Bool
== SomeAsyncException -> String
forall a. Show a => a -> String
show SomeAsyncException
e2

-- * Label stuff

data Label (l :: Symbol) a = Label

data LabelValue (l :: Symbol) a = LabelValue a

-- TODO: get rid of overlapping instance
-- Maybe look at https://kseo.github.io/posts/2017-02-05-avoid-overlapping-instances-with-closed-type-families.html
class HasLabel context (l :: Symbol) a where
  getLabelValue :: Label l a -> context -> a
instance HasLabel (LabelValue l a) l a where
  getLabelValue :: Label l a -> LabelValue l a -> a
getLabelValue Label l a
_ (LabelValue a
x) = a
x
instance {-# OVERLAPPING #-} HasLabel (LabelValue l a :> context) l a where
  getLabelValue :: Label l a -> (LabelValue l a :> context) -> a
getLabelValue Label l a
_ (LabelValue a
x :> context
_) = a
x
instance {-# OVERLAPPING #-} HasLabel context l a => HasLabel (intro :> context) l a where
  getLabelValue :: Label l a -> (intro :> context) -> a
getLabelValue Label l a
l (intro
_ :> context
ctx) = Label l a -> context -> a
forall context (l :: Symbol) a.
HasLabel context l a =>
Label l a -> context -> a
getLabelValue Label l a
l context
ctx


-- * Free monad language

data (a :: *) :> (b :: *) = a :> b
  deriving Int -> (a :> b) -> ShowS
[a :> b] -> ShowS
(a :> b) -> String
(Int -> (a :> b) -> ShowS)
-> ((a :> b) -> String) -> ([a :> b] -> ShowS) -> Show (a :> b)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall a b. (Show a, Show b) => Int -> (a :> b) -> ShowS
forall a b. (Show a, Show b) => [a :> b] -> ShowS
forall a b. (Show a, Show b) => (a :> b) -> String
showList :: [a :> b] -> ShowS
$cshowList :: forall a b. (Show a, Show b) => [a :> b] -> ShowS
show :: (a :> b) -> String
$cshow :: forall a b. (Show a, Show b) => (a :> b) -> String
showsPrec :: Int -> (a :> b) -> ShowS
$cshowsPrec :: forall a b. (Show a, Show b) => Int -> (a :> b) -> ShowS
Show
infixr :>

type ActionWith a = a -> IO ()

data NodeModuleInfo = NodeModuleInfo {
  NodeModuleInfo -> String
nodeModuleInfoModuleName :: String
  , NodeModuleInfo -> Maybe (IO ())
nodeModuleInfoFn :: Maybe (IO ())
  }

instance Show NodeModuleInfo where
  show :: NodeModuleInfo -> String
show (NodeModuleInfo {String
Maybe (IO ())
nodeModuleInfoFn :: Maybe (IO ())
nodeModuleInfoModuleName :: String
nodeModuleInfoFn :: NodeModuleInfo -> Maybe (IO ())
nodeModuleInfoModuleName :: NodeModuleInfo -> String
..}) = [i|#{nodeModuleInfoModuleName}<Has main? #{isJust nodeModuleInfoFn}>|]

-- | Options for an individual test node.
data NodeOptions = NodeOptions {
  NodeOptions -> Int
nodeOptionsVisibilityThreshold :: Int
  -- ^ The visibility threshold of the node. See the main docs for an explanation of this.
  , NodeOptions -> Bool
nodeOptionsCreateFolder :: Bool
  -- ^ Whether to create a folder in the on-disk test results for this node.
  -- Defaults to 'True', but can be turned off to reduce extraneous folders from nodes like 'Parallel'.
  , NodeOptions -> Bool
nodeOptionsRecordTime :: Bool
  -- ^ Whether to time this node.
  , NodeOptions -> Maybe NodeModuleInfo
nodeOptionsModuleInfo :: Maybe NodeModuleInfo
  -- ^ A main function run this entire node in isolation.
  } deriving Int -> NodeOptions -> ShowS
[NodeOptions] -> ShowS
NodeOptions -> String
(Int -> NodeOptions -> ShowS)
-> (NodeOptions -> String)
-> ([NodeOptions] -> ShowS)
-> Show NodeOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NodeOptions] -> ShowS
$cshowList :: [NodeOptions] -> ShowS
show :: NodeOptions -> String
$cshow :: NodeOptions -> String
showsPrec :: Int -> NodeOptions -> ShowS
$cshowsPrec :: Int -> NodeOptions -> ShowS
Show

-- | Reasonable default node options.
defaultNodeOptions :: NodeOptions
defaultNodeOptions :: NodeOptions
defaultNodeOptions = Int -> Bool -> Bool -> Maybe NodeModuleInfo -> NodeOptions
NodeOptions Int
100 Bool
True Bool
True Maybe NodeModuleInfo
forall a. Maybe a
Nothing

data SpecCommand context m next where
  Before'' :: {
    SpecCommand context m next -> Maybe SrcLoc
location :: Maybe SrcLoc
    , SpecCommand context m next -> NodeOptions
nodeOptions :: NodeOptions
    , SpecCommand context m next -> String
label :: String
    , SpecCommand context m next -> ExampleT context m ()
action :: ExampleT context m ()
    , SpecCommand context m next -> SpecFree context m ()
subspec :: SpecFree context m ()
    , SpecCommand context m next -> next
next :: next
    } -> SpecCommand context m next

  After'' :: {
    location :: Maybe SrcLoc
    , nodeOptions :: NodeOptions
    , label :: String
    , action :: ExampleT context m ()
    , subspec :: SpecFree context m ()
    , next :: next
    } -> SpecCommand context m next

  Introduce'' :: (Typeable intro) => {
    location :: Maybe SrcLoc
    , nodeOptions :: NodeOptions
    , label :: String
    , ()
contextLabel :: Label l intro
    , ()
allocate :: ExampleT context m intro
    , ()
cleanup :: intro -> ExampleT context m ()
    , ()
subspecAugmented :: SpecFree (LabelValue l intro :> context) m ()
    , next :: next
    } -> SpecCommand context m next

  IntroduceWith'' :: {
    location :: Maybe SrcLoc
    , nodeOptions :: NodeOptions
    , label :: String
    , contextLabel :: Label l intro
    , ()
introduceAction :: (intro -> ExampleT context m [Result]) -> ExampleT context m ()
    , subspecAugmented :: SpecFree (LabelValue l intro :> context) m ()
    , next :: next
    } -> SpecCommand context m next

  Around'' :: {
    location :: Maybe SrcLoc
    , nodeOptions :: NodeOptions
    , label :: String
    , SpecCommand context m next
-> ExampleT context m [Result] -> ExampleT context m ()
actionWith :: ExampleT context m [Result] -> ExampleT context m ()
    , subspec :: SpecFree context m ()
    , next :: next
    } -> SpecCommand context m next

  Describe'' :: {
    location :: Maybe SrcLoc
    , nodeOptions :: NodeOptions
    , label :: String
    , subspec :: SpecFree context m ()
    , next :: next
    } -> SpecCommand context m next

  Parallel'' :: {
    location :: Maybe SrcLoc
    , nodeOptions :: NodeOptions
    , subspec :: SpecFree context m ()
    , next :: next
    } -> SpecCommand context m next

  It'' :: { location :: Maybe SrcLoc
          , nodeOptions :: NodeOptions
          , label :: String
          , SpecCommand context m next -> ExampleT context m ()
example :: ExampleT context m ()
          , next :: next } -> SpecCommand context m next

deriving instance Functor (SpecCommand context m)
deriving instance Foldable (SpecCommand context m)
deriving instance Traversable (SpecCommand context m)


type Spec context m = SpecFree context m ()
type SpecFree context m a = Free (SpecCommand context m) a

makeFree_ ''SpecCommand

instance Show1 (SpecCommand context m) where
  liftShowsPrec :: (Int -> a -> ShowS)
-> ([a] -> ShowS) -> Int -> SpecCommand context m a -> ShowS
liftShowsPrec Int -> a -> ShowS
sp [a] -> ShowS
_ Int
d (Before'' {a
String
Maybe SrcLoc
SpecFree context m ()
NodeOptions
ExampleT context m ()
next :: a
subspec :: SpecFree context m ()
action :: ExampleT context m ()
label :: String
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
subspec :: forall context (m :: * -> *) next.
SpecCommand context m next -> SpecFree context m ()
action :: forall context (m :: * -> *) next.
SpecCommand context m next -> ExampleT context m ()
label :: forall context (m :: * -> *) next.
SpecCommand context m next -> String
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..}) = (Int -> a -> ShowS) -> String -> Int -> a -> ShowS
forall a. (Int -> a -> ShowS) -> String -> Int -> a -> ShowS
showsUnaryWith Int -> a -> ShowS
sp [i|Before[#{label}]<#{show subspec}>|] Int
d a
next
  liftShowsPrec Int -> a -> ShowS
sp [a] -> ShowS
_ Int
d (After'' {a
String
Maybe SrcLoc
SpecFree context m ()
NodeOptions
ExampleT context m ()
next :: a
subspec :: SpecFree context m ()
action :: ExampleT context m ()
label :: String
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
subspec :: forall context (m :: * -> *) next.
SpecCommand context m next -> SpecFree context m ()
action :: forall context (m :: * -> *) next.
SpecCommand context m next -> ExampleT context m ()
label :: forall context (m :: * -> *) next.
SpecCommand context m next -> String
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..}) = (Int -> a -> ShowS) -> String -> Int -> a -> ShowS
forall a. (Int -> a -> ShowS) -> String -> Int -> a -> ShowS
showsUnaryWith Int -> a -> ShowS
sp [i|After[#{label}]<#{show subspec}>|] Int
d a
next
  liftShowsPrec Int -> a -> ShowS
sp [a] -> ShowS
_ Int
d (Introduce'' {a
String
Maybe SrcLoc
SpecFree (LabelValue l intro :> context) m ()
NodeOptions
Label l intro
ExampleT context m intro
intro -> ExampleT context m ()
next :: a
subspecAugmented :: SpecFree (LabelValue l intro :> context) m ()
cleanup :: intro -> ExampleT context m ()
allocate :: ExampleT context m intro
contextLabel :: Label l intro
label :: String
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
subspecAugmented :: ()
cleanup :: ()
allocate :: ()
contextLabel :: ()
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
label :: forall context (m :: * -> *) next.
SpecCommand context m next -> String
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..}) = (Int -> a -> ShowS) -> String -> Int -> a -> ShowS
forall a. (Int -> a -> ShowS) -> String -> Int -> a -> ShowS
showsUnaryWith Int -> a -> ShowS
sp [i|Introduce[#{label}]<#{show subspecAugmented}>|] Int
d a
next
  liftShowsPrec Int -> a -> ShowS
sp [a] -> ShowS
_ Int
d (IntroduceWith'' {a
String
Maybe SrcLoc
SpecFree (LabelValue l intro :> context) m ()
NodeOptions
Label l intro
(intro -> ExampleT context m [Result]) -> ExampleT context m ()
next :: a
subspecAugmented :: SpecFree (LabelValue l intro :> context) m ()
introduceAction :: (intro -> ExampleT context m [Result]) -> ExampleT context m ()
contextLabel :: Label l intro
label :: String
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
introduceAction :: ()
subspecAugmented :: ()
contextLabel :: ()
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
label :: forall context (m :: * -> *) next.
SpecCommand context m next -> String
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..}) = (Int -> a -> ShowS) -> String -> Int -> a -> ShowS
forall a. (Int -> a -> ShowS) -> String -> Int -> a -> ShowS
showsUnaryWith Int -> a -> ShowS
sp [i|IntroduceWith[#{label}]<#{show subspecAugmented}>|] Int
d a
next
  liftShowsPrec Int -> a -> ShowS
sp [a] -> ShowS
_ Int
d (Around'' {a
String
Maybe SrcLoc
SpecFree context m ()
NodeOptions
ExampleT context m [Result] -> ExampleT context m ()
next :: a
subspec :: SpecFree context m ()
actionWith :: ExampleT context m [Result] -> ExampleT context m ()
label :: String
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
actionWith :: forall context (m :: * -> *) next.
SpecCommand context m next
-> ExampleT context m [Result] -> ExampleT context m ()
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
subspec :: forall context (m :: * -> *) next.
SpecCommand context m next -> SpecFree context m ()
label :: forall context (m :: * -> *) next.
SpecCommand context m next -> String
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..}) = (Int -> a -> ShowS) -> String -> Int -> a -> ShowS
forall a. (Int -> a -> ShowS) -> String -> Int -> a -> ShowS
showsUnaryWith Int -> a -> ShowS
sp [i|Around[#{label}]<#{show subspec}>|] Int
d a
next
  liftShowsPrec Int -> a -> ShowS
sp [a] -> ShowS
_ Int
d (Describe'' {a
String
Maybe SrcLoc
SpecFree context m ()
NodeOptions
next :: a
subspec :: SpecFree context m ()
label :: String
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
subspec :: forall context (m :: * -> *) next.
SpecCommand context m next -> SpecFree context m ()
label :: forall context (m :: * -> *) next.
SpecCommand context m next -> String
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..}) = (Int -> a -> ShowS) -> String -> Int -> a -> ShowS
forall a. (Int -> a -> ShowS) -> String -> Int -> a -> ShowS
showsUnaryWith Int -> a -> ShowS
sp [i|Describe[#{label}]<#{show subspec}>|] Int
d a
next
  liftShowsPrec Int -> a -> ShowS
sp [a] -> ShowS
_ Int
d (Parallel'' {a
Maybe SrcLoc
SpecFree context m ()
NodeOptions
next :: a
subspec :: SpecFree context m ()
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
subspec :: forall context (m :: * -> *) next.
SpecCommand context m next -> SpecFree context m ()
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..}) = (Int -> a -> ShowS) -> String -> Int -> a -> ShowS
forall a. (Int -> a -> ShowS) -> String -> Int -> a -> ShowS
showsUnaryWith Int -> a -> ShowS
sp [i|Parallel<#{show subspec}>|] Int
d a
next
  liftShowsPrec Int -> a -> ShowS
sp [a] -> ShowS
_ Int
d (It'' {a
String
Maybe SrcLoc
NodeOptions
ExampleT context m ()
next :: a
example :: ExampleT context m ()
label :: String
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
example :: forall context (m :: * -> *) next.
SpecCommand context m next -> ExampleT context m ()
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
label :: forall context (m :: * -> *) next.
SpecCommand context m next -> String
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..}) = (Int -> a -> ShowS) -> String -> Int -> a -> ShowS
forall a. (Int -> a -> ShowS) -> String -> Int -> a -> ShowS
showsUnaryWith Int -> a -> ShowS
sp [i|It[#{label}]|] Int
d a
next

-- First write beforeEach/afterEach to demonstrate push down approach
-- Then think about how/whether we can to introduceEach / aroundEach

-- * ----------------------------------------------------------

-- | Perform an action before a given spec tree.
before :: (HasCallStack) =>
  String
  -- ^ Label for this context manager
  -> ExampleT context m ()
  -- ^ Action to perform
  -> SpecFree context m ()
  -- ^ Child spec tree
  -> SpecFree context m ()
before :: String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
before = NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
before' (NodeOptions
defaultNodeOptions { nodeOptionsVisibilityThreshold :: Int
nodeOptionsVisibilityThreshold = Int
100 })

-- | Perform an action before a given spec tree.
before' :: (HasCallStack) =>
  NodeOptions
  -- ^ Custom options for this node
  -> String
  -- ^ String label for this context manager
  -> ExampleT context m ()
  -- ^ Action to perform
  -> SpecFree context m ()
  -- ^ Child spec tree
  -> SpecFree context m ()
before' :: NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
before' = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
before'' ((String, SrcLoc) -> SrcLoc
forall a b. (a, b) -> b
snd ((String, SrcLoc) -> SrcLoc)
-> Maybe (String, SrcLoc) -> Maybe SrcLoc
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [(String, SrcLoc)] -> Maybe (String, SrcLoc)
forall a. [a] -> Maybe a
headMay (Int -> [(String, SrcLoc)] -> [(String, SrcLoc)]
forall a. Int -> [a] -> [a]
drop Int
1 ([(String, SrcLoc)] -> [(String, SrcLoc)])
-> [(String, SrcLoc)] -> [(String, SrcLoc)]
forall a b. (a -> b) -> a -> b
$ CallStack -> [(String, SrcLoc)]
getCallStack CallStack
HasCallStack => CallStack
callStack))

-- | Perform an action before a given spec tree.
before'' :: (HasCallStack) =>
  Maybe SrcLoc
  -- ^ Location of this call
  -> NodeOptions
  -- ^ Custom options for this node
  -> String
  -- ^ String label for this context manager
  -> ExampleT context m ()
  -- ^ Action to perform
  -> SpecFree context m ()
  -- ^ Child spec tree
  -> SpecFree context m ()

-- * ----------------------------------------------------------

-- | Perform an action after a given spec tree.
after :: (HasCallStack) =>
  String
  -- ^ Label for this context manager
  -> ExampleT context m ()
  -- ^ Action to perform
  -> SpecFree context m ()
  -- ^ Child spec tree
  -> SpecFree context m ()
after :: String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
after = NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
after' (NodeOptions
defaultNodeOptions { nodeOptionsVisibilityThreshold :: Int
nodeOptionsVisibilityThreshold = Int
100 })

-- | Perform an action after a given spec tree.
after' :: (HasCallStack) =>
  NodeOptions
  -- ^ Custom options for this node
  -> String
  -- ^ String label for this context manager
  -> ExampleT context m ()
  -- ^ Action to perform
  -> SpecFree context m ()
  -- ^ Child spec tree
  -> SpecFree context m ()
after' :: NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
after' = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
after'' ((String, SrcLoc) -> SrcLoc
forall a b. (a, b) -> b
snd ((String, SrcLoc) -> SrcLoc)
-> Maybe (String, SrcLoc) -> Maybe SrcLoc
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [(String, SrcLoc)] -> Maybe (String, SrcLoc)
forall a. [a] -> Maybe a
headMay (Int -> [(String, SrcLoc)] -> [(String, SrcLoc)]
forall a. Int -> [a] -> [a]
drop Int
1 ([(String, SrcLoc)] -> [(String, SrcLoc)])
-> [(String, SrcLoc)] -> [(String, SrcLoc)]
forall a b. (a -> b) -> a -> b
$ CallStack -> [(String, SrcLoc)]
getCallStack CallStack
HasCallStack => CallStack
callStack))

-- | Perform an action after a given spec tree.
after'' :: (HasCallStack) =>
  Maybe SrcLoc
  -- ^ Location of this call
  -> NodeOptions
  -- ^ Custom options for this node
  -> String
  -- ^ String label for this context manager
  -> ExampleT context m ()
  -- ^ Action to perform
  -> SpecFree context m ()
  -- ^ Child spec tree
  -> SpecFree context m ()

-- * ----------------------------------------------------------

-- | Introduce a new value and make it available to the child spec tree.
introduce :: (HasCallStack, Typeable intro) =>
  String
  -- ^ String label for this node
  -> Label l intro
  -- ^ 'Label' under which to introduce the value
  -> ExampleT context m intro
  -- ^ Action to produce the new value (of type 'intro')
  -> (intro -> ExampleT context m ())
  -- ^ Action to clean up the new value
  -> SpecFree (LabelValue l intro :> context) m ()
  -- ^ Child spec tree
  -> SpecFree context m ()
introduce :: String
-> Label l intro
-> ExampleT context m intro
-> (intro -> ExampleT context m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> SpecFree context m ()
introduce = NodeOptions
-> String
-> Label l intro
-> ExampleT context m intro
-> (intro -> ExampleT context m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> SpecFree context m ()
forall intro (l :: Symbol) context (m :: * -> *).
(HasCallStack, Typeable intro) =>
NodeOptions
-> String
-> Label l intro
-> ExampleT context m intro
-> (intro -> ExampleT context m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> SpecFree context m ()
introduce' (NodeOptions
defaultNodeOptions { nodeOptionsVisibilityThreshold :: Int
nodeOptionsVisibilityThreshold = Int
100 })

-- | Introduce a new value and make it available to the child spec tree.
introduce' :: (HasCallStack, Typeable intro) =>
  NodeOptions
  -- ^ Custom options for this node
  -> String
  -- ^ String label for this node
  -> Label l intro
  -- ^ 'Label' under which to introduce the value
  -> ExampleT context m intro
  -- ^ Action to produce the new value (of type 'intro')
  -> (intro -> ExampleT context m ())
  -- ^ Action to clean up the new value
  -> SpecFree (LabelValue l intro :> context) m ()
  -- ^ Child spec tree
  -> SpecFree context m ()
introduce' :: NodeOptions
-> String
-> Label l intro
-> ExampleT context m intro
-> (intro -> ExampleT context m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> SpecFree context m ()
introduce' = Maybe SrcLoc
-> NodeOptions
-> String
-> Label l intro
-> ExampleT context m intro
-> (intro -> ExampleT context m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> SpecFree context m ()
forall intro (l :: Symbol) context (m :: * -> *).
(HasCallStack, Typeable intro) =>
Maybe SrcLoc
-> NodeOptions
-> String
-> Label l intro
-> ExampleT context m intro
-> (intro -> ExampleT context m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> SpecFree context m ()
introduce'' ((String, SrcLoc) -> SrcLoc
forall a b. (a, b) -> b
snd ((String, SrcLoc) -> SrcLoc)
-> Maybe (String, SrcLoc) -> Maybe SrcLoc
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [(String, SrcLoc)] -> Maybe (String, SrcLoc)
forall a. [a] -> Maybe a
headMay (Int -> [(String, SrcLoc)] -> [(String, SrcLoc)]
forall a. Int -> [a] -> [a]
drop Int
1 ([(String, SrcLoc)] -> [(String, SrcLoc)])
-> [(String, SrcLoc)] -> [(String, SrcLoc)]
forall a b. (a -> b) -> a -> b
$ CallStack -> [(String, SrcLoc)]
getCallStack CallStack
HasCallStack => CallStack
callStack))

-- | Introduce a new value and make it available to the child spec tree.
introduce'' :: (HasCallStack, Typeable intro) =>
  Maybe SrcLoc
  -- ^ Location of this call
  -> NodeOptions
  -- ^ Custom options for this node
  -> String
  -- ^ String label for this node
  -> Label l intro
  -- ^ 'Label' under which to introduce the value
  -> ExampleT context m intro
  -- ^ Action to produce the new value (of type 'intro')
  -> (intro -> ExampleT context m ())
  -- ^ Action to clean up the new value
  -> SpecFree (LabelValue l intro :> context) m ()
  -- ^ Child spec tree
  -> SpecFree context m ()

-- * ----------------------------------------------------------

-- | Introduce a new value in an 'around' fashion, so it can be used with context managers like withFile or bracket.
introduceWith :: (HasCallStack) =>
  String
  -- ^ String label for this node
  -> Label l intro
  -- ^ 'Label' under which to introduce the value
  -> ((intro -> ExampleT context m [Result]) -> ExampleT context m ())
  -- ^ Callback to receive the new value and the child tree.
  -> SpecFree (LabelValue l intro :> context) m ()
  -- ^ Child spec tree
  -> SpecFree context m ()
introduceWith :: String
-> Label l intro
-> ((intro -> ExampleT context m [Result])
    -> ExampleT context m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> SpecFree context m ()
introduceWith = NodeOptions
-> String
-> Label l intro
-> ((intro -> ExampleT context m [Result])
    -> ExampleT context m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> SpecFree context m ()
forall (l :: Symbol) intro context (m :: * -> *).
HasCallStack =>
NodeOptions
-> String
-> Label l intro
-> ((intro -> ExampleT context m [Result])
    -> ExampleT context m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> SpecFree context m ()
introduceWith' (NodeOptions
defaultNodeOptions { nodeOptionsVisibilityThreshold :: Int
nodeOptionsVisibilityThreshold = Int
100 })

-- | Introduce a new value in an 'around' fashion, so it can be used with context managers like withFile or bracket.
introduceWith' :: (HasCallStack) =>
  NodeOptions
  -- ^ Custom options for this node
  -> String
  -- ^ String label for this node
  -> Label l intro
  -- ^ 'Label' under which to introduce the value
  -> ((intro -> ExampleT context m [Result]) -> ExampleT context m ())
  -- ^ Callback to receive the new value and the child tree.
  -> SpecFree (LabelValue l intro :> context) m ()
  -- ^ Child spec tree
  -> SpecFree context m ()
introduceWith' :: NodeOptions
-> String
-> Label l intro
-> ((intro -> ExampleT context m [Result])
    -> ExampleT context m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> SpecFree context m ()
introduceWith' = Maybe SrcLoc
-> NodeOptions
-> String
-> Label l intro
-> ((intro -> ExampleT context m [Result])
    -> ExampleT context m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> SpecFree context m ()
forall (l :: Symbol) intro context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> Label l intro
-> ((intro -> ExampleT context m [Result])
    -> ExampleT context m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> SpecFree context m ()
introduceWith'' ((String, SrcLoc) -> SrcLoc
forall a b. (a, b) -> b
snd ((String, SrcLoc) -> SrcLoc)
-> Maybe (String, SrcLoc) -> Maybe SrcLoc
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [(String, SrcLoc)] -> Maybe (String, SrcLoc)
forall a. [a] -> Maybe a
headMay (Int -> [(String, SrcLoc)] -> [(String, SrcLoc)]
forall a. Int -> [a] -> [a]
drop Int
1 ([(String, SrcLoc)] -> [(String, SrcLoc)])
-> [(String, SrcLoc)] -> [(String, SrcLoc)]
forall a b. (a -> b) -> a -> b
$ CallStack -> [(String, SrcLoc)]
getCallStack CallStack
HasCallStack => CallStack
callStack))

-- | Introduce a new value in an 'around' fashion, so it can be used with context managers like withFile or bracket.
introduceWith'' :: (HasCallStack) =>
  Maybe SrcLoc
  -- ^ Location of this call
  -> NodeOptions
  -- ^ Custom options for this node
  -> String
  -- ^ String label for this node
  -> Label l intro
  -- ^ 'Label' under which to introduce the value
  -> ((intro -> ExampleT context m [Result]) -> ExampleT context m ())
  -- ^ Callback to receive the new value and the child tree.
  -> SpecFree (LabelValue l intro :> context) m ()
  -- ^ Child spec tree
  -> SpecFree context m ()

-- * ----------------------------------------------------------

-- | Run an action around the given child subtree. Useful for context managers like withFile or bracket.
around :: (HasCallStack) =>
  String
  -> (ExampleT context m [Result] -> ExampleT context m ())
  -- ^ Callback to run the child tree
  -> SpecFree context m ()
  -- ^ Child spec tree
  -> SpecFree context m ()
around :: String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
around = NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
around' (NodeOptions
defaultNodeOptions { nodeOptionsVisibilityThreshold :: Int
nodeOptionsVisibilityThreshold = Int
100 })

-- | Run an action around the given child subtree. Useful for context managers like withFile or bracket.
around' :: (HasCallStack) =>
  NodeOptions
  -- ^ Custom options for this node
  -> String
  -- ^ String label for this node
  -> (ExampleT context m [Result] -> ExampleT context m ())
  -- ^ Callback to run the child tree
  -> SpecFree context m ()
  -- ^ Child spec tree
  -> SpecFree context m ()
around' :: NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
around' = Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
around'' ((String, SrcLoc) -> SrcLoc
forall a b. (a, b) -> b
snd ((String, SrcLoc) -> SrcLoc)
-> Maybe (String, SrcLoc) -> Maybe SrcLoc
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [(String, SrcLoc)] -> Maybe (String, SrcLoc)
forall a. [a] -> Maybe a
headMay (Int -> [(String, SrcLoc)] -> [(String, SrcLoc)]
forall a. Int -> [a] -> [a]
drop Int
1 ([(String, SrcLoc)] -> [(String, SrcLoc)])
-> [(String, SrcLoc)] -> [(String, SrcLoc)]
forall a b. (a -> b) -> a -> b
$ CallStack -> [(String, SrcLoc)]
getCallStack CallStack
HasCallStack => CallStack
callStack))

-- | Run an action around the given child subtree. Useful for context managers like withFile or bracket.
around'' :: (HasCallStack) =>
  Maybe SrcLoc
  -- ^ Location of this call
  -> NodeOptions
  -- ^ Custom options for this node
  -> String
  -- ^ String label for this node
  -> (ExampleT context m [Result] -> ExampleT context m ())
  -- ^ Callback to run the child tree
  -> SpecFree context m ()
  -- ^ Child spec tree
  -> SpecFree context m ()


-- * ----------------------------------------------------------

-- | Define a group of tests.
describe :: (HasCallStack) =>
  String
  -- ^ Label for this group
  -> SpecFree context m ()
  -- ^ Child spec tree
  -> SpecFree context m ()
describe :: String -> SpecFree context m () -> SpecFree context m ()
describe = NodeOptions
-> String -> SpecFree context m () -> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
NodeOptions
-> String -> SpecFree context m () -> SpecFree context m ()
describe' (NodeOptions
defaultNodeOptions { nodeOptionsVisibilityThreshold :: Int
nodeOptionsVisibilityThreshold = Int
50 })

-- | Define a group of tests.
describe' :: (HasCallStack) =>
  NodeOptions
  -- ^ Custom options for this node
  -> String
  -- ^ Label for this group
  -> SpecFree context m ()
  -- ^ Child spec tree
  -> SpecFree context m ()
describe' :: NodeOptions
-> String -> SpecFree context m () -> SpecFree context m ()
describe' = Maybe SrcLoc
-> NodeOptions
-> String
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> SpecFree context m ()
-> SpecFree context m ()
describe'' ((String, SrcLoc) -> SrcLoc
forall a b. (a, b) -> b
snd ((String, SrcLoc) -> SrcLoc)
-> Maybe (String, SrcLoc) -> Maybe SrcLoc
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [(String, SrcLoc)] -> Maybe (String, SrcLoc)
forall a. [a] -> Maybe a
headMay (Int -> [(String, SrcLoc)] -> [(String, SrcLoc)]
forall a. Int -> [a] -> [a]
drop Int
1 ([(String, SrcLoc)] -> [(String, SrcLoc)])
-> [(String, SrcLoc)] -> [(String, SrcLoc)]
forall a b. (a -> b) -> a -> b
$ CallStack -> [(String, SrcLoc)]
getCallStack CallStack
HasCallStack => CallStack
callStack))

-- | Define a group of tests.
describe'' :: (HasCallStack) =>
  Maybe SrcLoc
  -- ^ Location of this call
  -> NodeOptions
  -- ^ Custom options for this node
  -> String
  -- ^ Label for this group
  -> SpecFree context m ()
  -- ^ Child spec tree
  -> SpecFree context m ()

-- * ----------------------------------------------------------

-- | Run a group of tests in parallel.
parallel :: (HasCallStack) =>
  SpecFree context m ()
  -- ^ Child spec tree
  -> SpecFree context m ()
parallel :: SpecFree context m () -> SpecFree context m ()
parallel = NodeOptions -> SpecFree context m () -> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
NodeOptions -> SpecFree context m () -> SpecFree context m ()
parallel' (NodeOptions
defaultNodeOptions { nodeOptionsVisibilityThreshold :: Int
nodeOptionsVisibilityThreshold = Int
70 })

-- | Run a group of tests in parallel.
parallel' :: (HasCallStack) =>
  NodeOptions
  -- ^ Custom options for this node
  -> SpecFree context m ()
  -- ^ Child spec tree
  -> SpecFree context m ()
parallel' :: NodeOptions -> SpecFree context m () -> SpecFree context m ()
parallel' = Maybe SrcLoc
-> NodeOptions -> SpecFree context m () -> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions -> SpecFree context m () -> SpecFree context m ()
parallel'' ((String, SrcLoc) -> SrcLoc
forall a b. (a, b) -> b
snd ((String, SrcLoc) -> SrcLoc)
-> Maybe (String, SrcLoc) -> Maybe SrcLoc
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [(String, SrcLoc)] -> Maybe (String, SrcLoc)
forall a. [a] -> Maybe a
headMay (Int -> [(String, SrcLoc)] -> [(String, SrcLoc)]
forall a. Int -> [a] -> [a]
drop Int
1 ([(String, SrcLoc)] -> [(String, SrcLoc)])
-> [(String, SrcLoc)] -> [(String, SrcLoc)]
forall a b. (a -> b) -> a -> b
$ CallStack -> [(String, SrcLoc)]
getCallStack CallStack
HasCallStack => CallStack
callStack))

-- | Run a group of tests in parallel.
parallel'' :: (HasCallStack) =>
  Maybe SrcLoc
  -- ^ Location of this call
  -> NodeOptions
  -- ^ Custom options for this node
  -> SpecFree context m ()
  -- ^ Child spec tree
  -> SpecFree context m ()

-- * ----------------------------------------------------------

-- | Define a single test example.
it :: (HasCallStack) =>
  String
  -- ^ Label for the example.
  -> ExampleT context m ()
  -- ^ The test example
  -> Free (SpecCommand context m) ()
it :: String -> ExampleT context m () -> Free (SpecCommand context m) ()
it = NodeOptions
-> String
-> ExampleT context m ()
-> Free (SpecCommand context m) ()
forall context (m :: * -> *).
HasCallStack =>
NodeOptions
-> String
-> ExampleT context m ()
-> Free (SpecCommand context m) ()
it' (NodeOptions
defaultNodeOptions { nodeOptionsVisibilityThreshold :: Int
nodeOptionsVisibilityThreshold = Int
0 })

-- | Define a single test example.
it' :: (HasCallStack) =>
  NodeOptions
  -- ^ Custom options for this node
  -> String
  -- ^ String label for the example.
  -> ExampleT context m ()
  -- ^ The test example
  -> Free (SpecCommand context m) ()
it' :: NodeOptions
-> String
-> ExampleT context m ()
-> Free (SpecCommand context m) ()
it' = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> Free (SpecCommand context m) ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> Free (SpecCommand context m) ()
it'' ((String, SrcLoc) -> SrcLoc
forall a b. (a, b) -> b
snd ((String, SrcLoc) -> SrcLoc)
-> Maybe (String, SrcLoc) -> Maybe SrcLoc
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [(String, SrcLoc)] -> Maybe (String, SrcLoc)
forall a. [a] -> Maybe a
headMay (Int -> [(String, SrcLoc)] -> [(String, SrcLoc)]
forall a. Int -> [a] -> [a]
drop Int
1 ([(String, SrcLoc)] -> [(String, SrcLoc)])
-> [(String, SrcLoc)] -> [(String, SrcLoc)]
forall a b. (a -> b) -> a -> b
$ CallStack -> [(String, SrcLoc)]
getCallStack CallStack
HasCallStack => CallStack
callStack))

-- | Define a single test example.
it'' :: (HasCallStack) =>
  Maybe SrcLoc
  -- ^ Location of this call
  -> NodeOptions
  -- ^ Custom options for this node
  -> String
  -- ^ String label for the example.
  -> ExampleT context m ()
  -- ^ The test example
  -> Free (SpecCommand context m) ()

-- * ----------------------------------------------------------

-- | Same as 'before', but applied individually to every 'it' node.
beforeEach :: (HasCallStack) =>
  String
  -- ^ String label for this context manager
  -> (ExampleT context m ())
  -- ^ Action to perform
  -> SpecFree context m ()
  -- ^ Child spec tree
  -> SpecFree context m ()
beforeEach :: String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
beforeEach = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
beforeEach' ((String, SrcLoc) -> SrcLoc
forall a b. (a, b) -> b
snd ((String, SrcLoc) -> SrcLoc)
-> Maybe (String, SrcLoc) -> Maybe SrcLoc
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [(String, SrcLoc)] -> Maybe (String, SrcLoc)
forall a. [a] -> Maybe a
headMay (CallStack -> [(String, SrcLoc)]
getCallStack CallStack
HasCallStack => CallStack
callStack)) (NodeOptions
defaultNodeOptions { nodeOptionsVisibilityThreshold :: Int
nodeOptionsVisibilityThreshold = Int
100 })

-- | Perform an action before each example in a given spec tree.
beforeEach' :: (HasCallStack) =>
  Maybe SrcLoc
  -- ^ Location of this call
  -> NodeOptions
  -- ^ Custom options for this node
  -> String
  -- ^ String label for this context manager
  -> (ExampleT context m ())
  -- ^ Action to perform
  -> SpecFree context m ()
  -- ^ Child spec tree
  -> SpecFree context m ()
beforeEach' :: Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
beforeEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f (Free x :: SpecCommand context m (SpecFree context m ())
x@(Before'' {String
Maybe SrcLoc
SpecFree context m ()
NodeOptions
ExampleT context m ()
next :: SpecFree context m ()
subspec :: SpecFree context m ()
action :: ExampleT context m ()
label :: String
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
subspec :: forall context (m :: * -> *) next.
SpecCommand context m next -> SpecFree context m ()
action :: forall context (m :: * -> *) next.
SpecCommand context m next -> ExampleT context m ()
label :: forall context (m :: * -> *) next.
SpecCommand context m next -> String
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..})) = SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (SpecCommand context m (SpecFree context m ())
x { subspec :: SpecFree context m ()
subspec = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
beforeEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
subspec, next :: SpecFree context m ()
next = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
beforeEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
next })
beforeEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f (Free x :: SpecCommand context m (SpecFree context m ())
x@(After'' {String
Maybe SrcLoc
SpecFree context m ()
NodeOptions
ExampleT context m ()
next :: SpecFree context m ()
subspec :: SpecFree context m ()
action :: ExampleT context m ()
label :: String
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
subspec :: forall context (m :: * -> *) next.
SpecCommand context m next -> SpecFree context m ()
action :: forall context (m :: * -> *) next.
SpecCommand context m next -> ExampleT context m ()
label :: forall context (m :: * -> *) next.
SpecCommand context m next -> String
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..})) = SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (SpecCommand context m (SpecFree context m ())
x { subspec :: SpecFree context m ()
subspec = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
beforeEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
subspec, next :: SpecFree context m ()
next = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
beforeEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
next })
beforeEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f (Free x :: SpecCommand context m (SpecFree context m ())
x@(Around'' {String
Maybe SrcLoc
SpecFree context m ()
NodeOptions
ExampleT context m [Result] -> ExampleT context m ()
next :: SpecFree context m ()
subspec :: SpecFree context m ()
actionWith :: ExampleT context m [Result] -> ExampleT context m ()
label :: String
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
actionWith :: forall context (m :: * -> *) next.
SpecCommand context m next
-> ExampleT context m [Result] -> ExampleT context m ()
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
subspec :: forall context (m :: * -> *) next.
SpecCommand context m next -> SpecFree context m ()
label :: forall context (m :: * -> *) next.
SpecCommand context m next -> String
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..})) = SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (SpecCommand context m (SpecFree context m ())
x { subspec :: SpecFree context m ()
subspec = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
beforeEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
subspec, next :: SpecFree context m ()
next = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
beforeEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
next })
beforeEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f (Free x :: SpecCommand context m (SpecFree context m ())
x@(Describe'' {String
Maybe SrcLoc
SpecFree context m ()
NodeOptions
next :: SpecFree context m ()
subspec :: SpecFree context m ()
label :: String
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
subspec :: forall context (m :: * -> *) next.
SpecCommand context m next -> SpecFree context m ()
label :: forall context (m :: * -> *) next.
SpecCommand context m next -> String
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..})) = SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (SpecCommand context m (SpecFree context m ())
x { subspec :: SpecFree context m ()
subspec = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
beforeEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
subspec, next :: SpecFree context m ()
next = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
beforeEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
next })
beforeEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f (Free x :: SpecCommand context m (SpecFree context m ())
x@(Parallel'' {Maybe SrcLoc
SpecFree context m ()
NodeOptions
next :: SpecFree context m ()
subspec :: SpecFree context m ()
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
subspec :: forall context (m :: * -> *) next.
SpecCommand context m next -> SpecFree context m ()
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..})) = SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (SpecCommand context m (SpecFree context m ())
x { subspec :: SpecFree context m ()
subspec = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
beforeEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
subspec, next :: SpecFree context m ()
next = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
beforeEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
next })
beforeEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f (Free x :: SpecCommand context m (SpecFree context m ())
x@(It'' {String
Maybe SrcLoc
SpecFree context m ()
NodeOptions
ExampleT context m ()
next :: SpecFree context m ()
example :: ExampleT context m ()
label :: String
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
example :: forall context (m :: * -> *) next.
SpecCommand context m next -> ExampleT context m ()
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
label :: forall context (m :: * -> *) next.
SpecCommand context m next -> String
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..})) = SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
-> SpecCommand context m (SpecFree context m ())
forall context (m :: * -> *) next.
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> next
-> SpecCommand context m next
Before'' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f (SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (SpecCommand context m (SpecFree context m ())
x { next :: SpecFree context m ()
next = () -> SpecFree context m ()
forall (f :: * -> *) a. a -> Free f a
Pure () })) (Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
beforeEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
next))
beforeEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f (Free (Introduce'' Maybe SrcLoc
loci NodeOptions
noi String
li Label l intro
cl ExampleT context m intro
alloc intro -> ExampleT context m ()
clean SpecFree (LabelValue l intro :> context) m ()
subspec SpecFree context m ()
next)) = SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (Maybe SrcLoc
-> NodeOptions
-> String
-> Label l intro
-> ExampleT context m intro
-> (intro -> ExampleT context m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> SpecFree context m ()
-> SpecCommand context m (SpecFree context m ())
forall intro (l :: Symbol) context (m :: * -> *) next.
Typeable intro =>
Maybe SrcLoc
-> NodeOptions
-> String
-> Label l intro
-> ExampleT context m intro
-> (intro -> ExampleT context m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> next
-> SpecCommand context m next
Introduce'' Maybe SrcLoc
loci NodeOptions
noi String
li Label l intro
cl ExampleT context m intro
alloc intro -> ExampleT context m ()
clean (Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT (LabelValue l intro :> context) m ()
-> SpecFree (LabelValue l intro :> context) m ()
-> SpecFree (LabelValue l intro :> context) m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
beforeEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT (LabelValue l intro :> context) m ()
f' SpecFree (LabelValue l intro :> context) m ()
subspec) (Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
beforeEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
next))
  where f' :: ExampleT (LabelValue l intro :> context) m ()
f' = ReaderT (LabelValue l intro :> context) (LoggingT m) ()
-> ExampleT (LabelValue l intro :> context) m ()
forall context (m :: * -> *) a.
ReaderT context (LoggingT m) a -> ExampleT context m a
ExampleT (ReaderT (LabelValue l intro :> context) (LoggingT m) ()
 -> ExampleT (LabelValue l intro :> context) m ())
-> ReaderT (LabelValue l intro :> context) (LoggingT m) ()
-> ExampleT (LabelValue l intro :> context) m ()
forall a b. (a -> b) -> a -> b
$ ((LabelValue l intro :> context) -> context)
-> ReaderT context (LoggingT m) ()
-> ReaderT (LabelValue l intro :> context) (LoggingT m) ()
forall r' r (m :: * -> *) a.
(r' -> r) -> ReaderT r m a -> ReaderT r' m a
withReaderT (\(LabelValue l intro
_ :> context
context) -> context
context) (ReaderT context (LoggingT m) ()
 -> ReaderT (LabelValue l intro :> context) (LoggingT m) ())
-> ReaderT context (LoggingT m) ()
-> ReaderT (LabelValue l intro :> context) (LoggingT m) ()
forall a b. (a -> b) -> a -> b
$ ExampleT context m () -> ReaderT context (LoggingT m) ()
forall context (m :: * -> *) a.
ExampleT context m a -> ReaderT context (LoggingT m) a
unExampleT ExampleT context m ()
f
beforeEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f (Free (IntroduceWith'' Maybe SrcLoc
loci NodeOptions
noi String
li Label l intro
cl (intro -> ExampleT context m [Result]) -> ExampleT context m ()
action SpecFree (LabelValue l intro :> context) m ()
subspec SpecFree context m ()
next)) = SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (Maybe SrcLoc
-> NodeOptions
-> String
-> Label l intro
-> ((intro -> ExampleT context m [Result])
    -> ExampleT context m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> SpecFree context m ()
-> SpecCommand context m (SpecFree context m ())
forall (l :: Symbol) intro context (m :: * -> *) next.
Maybe SrcLoc
-> NodeOptions
-> String
-> Label l intro
-> ((intro -> ExampleT context m [Result])
    -> ExampleT context m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> next
-> SpecCommand context m next
IntroduceWith'' Maybe SrcLoc
loci NodeOptions
noi String
li Label l intro
cl (intro -> ExampleT context m [Result]) -> ExampleT context m ()
action (Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT (LabelValue l intro :> context) m ()
-> SpecFree (LabelValue l intro :> context) m ()
-> SpecFree (LabelValue l intro :> context) m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
beforeEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT (LabelValue l intro :> context) m ()
f' SpecFree (LabelValue l intro :> context) m ()
subspec) (Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
beforeEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
next))
  where f' :: ExampleT (LabelValue l intro :> context) m ()
f' = ReaderT (LabelValue l intro :> context) (LoggingT m) ()
-> ExampleT (LabelValue l intro :> context) m ()
forall context (m :: * -> *) a.
ReaderT context (LoggingT m) a -> ExampleT context m a
ExampleT (ReaderT (LabelValue l intro :> context) (LoggingT m) ()
 -> ExampleT (LabelValue l intro :> context) m ())
-> ReaderT (LabelValue l intro :> context) (LoggingT m) ()
-> ExampleT (LabelValue l intro :> context) m ()
forall a b. (a -> b) -> a -> b
$ ((LabelValue l intro :> context) -> context)
-> ReaderT context (LoggingT m) ()
-> ReaderT (LabelValue l intro :> context) (LoggingT m) ()
forall r' r (m :: * -> *) a.
(r' -> r) -> ReaderT r m a -> ReaderT r' m a
withReaderT (\(LabelValue l intro
_ :> context
context) -> context
context) (ReaderT context (LoggingT m) ()
 -> ReaderT (LabelValue l intro :> context) (LoggingT m) ())
-> ReaderT context (LoggingT m) ()
-> ReaderT (LabelValue l intro :> context) (LoggingT m) ()
forall a b. (a -> b) -> a -> b
$ ExampleT context m () -> ReaderT context (LoggingT m) ()
forall context (m :: * -> *) a.
ExampleT context m a -> ReaderT context (LoggingT m) a
unExampleT ExampleT context m ()
f
beforeEach' Maybe SrcLoc
_ NodeOptions
_ String
_ ExampleT context m ()
_ (Pure ()
x) = () -> SpecFree context m ()
forall (f :: * -> *) a. a -> Free f a
Pure ()
x

-- * ----------------------------------------------------------

-- | Same as 'after', but applied individually to every 'it' node.
afterEach :: (HasCallStack) =>
  String
  -- ^ String label for this context manager
  -> (ExampleT context m ())
  -- ^ Action to perform
  -> SpecFree context m ()
  -- ^ Child spec tree
  -> SpecFree context m ()
afterEach :: String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
afterEach = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
afterEach' ((String, SrcLoc) -> SrcLoc
forall a b. (a, b) -> b
snd ((String, SrcLoc) -> SrcLoc)
-> Maybe (String, SrcLoc) -> Maybe SrcLoc
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [(String, SrcLoc)] -> Maybe (String, SrcLoc)
forall a. [a] -> Maybe a
headMay (CallStack -> [(String, SrcLoc)]
getCallStack CallStack
HasCallStack => CallStack
callStack)) (NodeOptions
defaultNodeOptions { nodeOptionsVisibilityThreshold :: Int
nodeOptionsVisibilityThreshold = Int
100 })

-- | Perform an action after each example in a given spec tree.
afterEach' :: (HasCallStack) =>
  Maybe SrcLoc
  -- ^ Location of this call
  -> NodeOptions
  -- ^ Custom options for this node
  -> String
  -- ^ Label for this context manager
  -> (ExampleT context m ())
  -- ^ Action to perform
  -> SpecFree context m ()
  -- ^ Child spec tree
  -> SpecFree context m ()
afterEach' :: Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
afterEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f (Free x :: SpecCommand context m (SpecFree context m ())
x@(Before'' {String
Maybe SrcLoc
SpecFree context m ()
NodeOptions
ExampleT context m ()
next :: SpecFree context m ()
subspec :: SpecFree context m ()
action :: ExampleT context m ()
label :: String
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
subspec :: forall context (m :: * -> *) next.
SpecCommand context m next -> SpecFree context m ()
action :: forall context (m :: * -> *) next.
SpecCommand context m next -> ExampleT context m ()
label :: forall context (m :: * -> *) next.
SpecCommand context m next -> String
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..})) = SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (SpecCommand context m (SpecFree context m ())
x { subspec :: SpecFree context m ()
subspec = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
afterEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
subspec, next :: SpecFree context m ()
next = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
afterEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
next })
afterEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f (Free x :: SpecCommand context m (SpecFree context m ())
x@(After'' {String
Maybe SrcLoc
SpecFree context m ()
NodeOptions
ExampleT context m ()
next :: SpecFree context m ()
subspec :: SpecFree context m ()
action :: ExampleT context m ()
label :: String
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
subspec :: forall context (m :: * -> *) next.
SpecCommand context m next -> SpecFree context m ()
action :: forall context (m :: * -> *) next.
SpecCommand context m next -> ExampleT context m ()
label :: forall context (m :: * -> *) next.
SpecCommand context m next -> String
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..})) = SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (SpecCommand context m (SpecFree context m ())
x { subspec :: SpecFree context m ()
subspec = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
afterEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
subspec, next :: SpecFree context m ()
next = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
afterEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
next })
afterEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f (Free x :: SpecCommand context m (SpecFree context m ())
x@(Around'' {String
Maybe SrcLoc
SpecFree context m ()
NodeOptions
ExampleT context m [Result] -> ExampleT context m ()
next :: SpecFree context m ()
subspec :: SpecFree context m ()
actionWith :: ExampleT context m [Result] -> ExampleT context m ()
label :: String
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
actionWith :: forall context (m :: * -> *) next.
SpecCommand context m next
-> ExampleT context m [Result] -> ExampleT context m ()
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
subspec :: forall context (m :: * -> *) next.
SpecCommand context m next -> SpecFree context m ()
label :: forall context (m :: * -> *) next.
SpecCommand context m next -> String
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..})) = SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (SpecCommand context m (SpecFree context m ())
x { subspec :: SpecFree context m ()
subspec = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
afterEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
subspec, next :: SpecFree context m ()
next = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
afterEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
next })
afterEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f (Free x :: SpecCommand context m (SpecFree context m ())
x@(Describe'' {String
Maybe SrcLoc
SpecFree context m ()
NodeOptions
next :: SpecFree context m ()
subspec :: SpecFree context m ()
label :: String
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
subspec :: forall context (m :: * -> *) next.
SpecCommand context m next -> SpecFree context m ()
label :: forall context (m :: * -> *) next.
SpecCommand context m next -> String
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..})) = SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (SpecCommand context m (SpecFree context m ())
x { subspec :: SpecFree context m ()
subspec = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
afterEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
subspec, next :: SpecFree context m ()
next = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
afterEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
next })
afterEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f (Free x :: SpecCommand context m (SpecFree context m ())
x@(Parallel'' {Maybe SrcLoc
SpecFree context m ()
NodeOptions
next :: SpecFree context m ()
subspec :: SpecFree context m ()
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
subspec :: forall context (m :: * -> *) next.
SpecCommand context m next -> SpecFree context m ()
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..})) = SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (SpecCommand context m (SpecFree context m ())
x { subspec :: SpecFree context m ()
subspec = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
afterEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
subspec, next :: SpecFree context m ()
next = Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
afterEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
next })
afterEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f (Free x :: SpecCommand context m (SpecFree context m ())
x@(It'' {String
Maybe SrcLoc
SpecFree context m ()
NodeOptions
ExampleT context m ()
next :: SpecFree context m ()
example :: ExampleT context m ()
label :: String
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
example :: forall context (m :: * -> *) next.
SpecCommand context m next -> ExampleT context m ()
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
label :: forall context (m :: * -> *) next.
SpecCommand context m next -> String
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..})) = SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
-> SpecCommand context m (SpecFree context m ())
forall context (m :: * -> *) next.
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> next
-> SpecCommand context m next
After'' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f (SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (SpecCommand context m (SpecFree context m ())
x { next :: SpecFree context m ()
next = () -> SpecFree context m ()
forall (f :: * -> *) a. a -> Free f a
Pure () })) (Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
afterEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
next))
afterEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f (Free (Introduce'' Maybe SrcLoc
loci NodeOptions
noi String
li Label l intro
cl ExampleT context m intro
alloc intro -> ExampleT context m ()
clean SpecFree (LabelValue l intro :> context) m ()
subspec SpecFree context m ()
next)) = SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (Maybe SrcLoc
-> NodeOptions
-> String
-> Label l intro
-> ExampleT context m intro
-> (intro -> ExampleT context m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> SpecFree context m ()
-> SpecCommand context m (SpecFree context m ())
forall intro (l :: Symbol) context (m :: * -> *) next.
Typeable intro =>
Maybe SrcLoc
-> NodeOptions
-> String
-> Label l intro
-> ExampleT context m intro
-> (intro -> ExampleT context m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> next
-> SpecCommand context m next
Introduce'' Maybe SrcLoc
loci NodeOptions
noi String
li Label l intro
cl ExampleT context m intro
alloc intro -> ExampleT context m ()
clean (Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT (LabelValue l intro :> context) m ()
-> SpecFree (LabelValue l intro :> context) m ()
-> SpecFree (LabelValue l intro :> context) m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
afterEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT (LabelValue l intro :> context) m ()
f' SpecFree (LabelValue l intro :> context) m ()
subspec) (Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
afterEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
next))
  where f' :: ExampleT (LabelValue l intro :> context) m ()
f' = ReaderT (LabelValue l intro :> context) (LoggingT m) ()
-> ExampleT (LabelValue l intro :> context) m ()
forall context (m :: * -> *) a.
ReaderT context (LoggingT m) a -> ExampleT context m a
ExampleT (ReaderT (LabelValue l intro :> context) (LoggingT m) ()
 -> ExampleT (LabelValue l intro :> context) m ())
-> ReaderT (LabelValue l intro :> context) (LoggingT m) ()
-> ExampleT (LabelValue l intro :> context) m ()
forall a b. (a -> b) -> a -> b
$ ((LabelValue l intro :> context) -> context)
-> ReaderT context (LoggingT m) ()
-> ReaderT (LabelValue l intro :> context) (LoggingT m) ()
forall r' r (m :: * -> *) a.
(r' -> r) -> ReaderT r m a -> ReaderT r' m a
withReaderT (\(LabelValue l intro
_ :> context
context) -> context
context) (ReaderT context (LoggingT m) ()
 -> ReaderT (LabelValue l intro :> context) (LoggingT m) ())
-> ReaderT context (LoggingT m) ()
-> ReaderT (LabelValue l intro :> context) (LoggingT m) ()
forall a b. (a -> b) -> a -> b
$ ExampleT context m () -> ReaderT context (LoggingT m) ()
forall context (m :: * -> *) a.
ExampleT context m a -> ReaderT context (LoggingT m) a
unExampleT ExampleT context m ()
f
afterEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f (Free (IntroduceWith'' Maybe SrcLoc
loci NodeOptions
noi String
li Label l intro
cl (intro -> ExampleT context m [Result]) -> ExampleT context m ()
action SpecFree (LabelValue l intro :> context) m ()
subspec SpecFree context m ()
next)) = SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (Maybe SrcLoc
-> NodeOptions
-> String
-> Label l intro
-> ((intro -> ExampleT context m [Result])
    -> ExampleT context m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> SpecFree context m ()
-> SpecCommand context m (SpecFree context m ())
forall (l :: Symbol) intro context (m :: * -> *) next.
Maybe SrcLoc
-> NodeOptions
-> String
-> Label l intro
-> ((intro -> ExampleT context m [Result])
    -> ExampleT context m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> next
-> SpecCommand context m next
IntroduceWith'' Maybe SrcLoc
loci NodeOptions
noi String
li Label l intro
cl (intro -> ExampleT context m [Result]) -> ExampleT context m ()
action (Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT (LabelValue l intro :> context) m ()
-> SpecFree (LabelValue l intro :> context) m ()
-> SpecFree (LabelValue l intro :> context) m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
afterEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT (LabelValue l intro :> context) m ()
f' SpecFree (LabelValue l intro :> context) m ()
subspec) (Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
forall context (m :: * -> *).
HasCallStack =>
Maybe SrcLoc
-> NodeOptions
-> String
-> ExampleT context m ()
-> SpecFree context m ()
-> SpecFree context m ()
afterEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m ()
f SpecFree context m ()
next))
  where f' :: ExampleT (LabelValue l intro :> context) m ()
f' = ReaderT (LabelValue l intro :> context) (LoggingT m) ()
-> ExampleT (LabelValue l intro :> context) m ()
forall context (m :: * -> *) a.
ReaderT context (LoggingT m) a -> ExampleT context m a
ExampleT (ReaderT (LabelValue l intro :> context) (LoggingT m) ()
 -> ExampleT (LabelValue l intro :> context) m ())
-> ReaderT (LabelValue l intro :> context) (LoggingT m) ()
-> ExampleT (LabelValue l intro :> context) m ()
forall a b. (a -> b) -> a -> b
$ ((LabelValue l intro :> context) -> context)
-> ReaderT context (LoggingT m) ()
-> ReaderT (LabelValue l intro :> context) (LoggingT m) ()
forall r' r (m :: * -> *) a.
(r' -> r) -> ReaderT r m a -> ReaderT r' m a
withReaderT (\(LabelValue l intro
_ :> context
context) -> context
context) (ReaderT context (LoggingT m) ()
 -> ReaderT (LabelValue l intro :> context) (LoggingT m) ())
-> ReaderT context (LoggingT m) ()
-> ReaderT (LabelValue l intro :> context) (LoggingT m) ()
forall a b. (a -> b) -> a -> b
$ ExampleT context m () -> ReaderT context (LoggingT m) ()
forall context (m :: * -> *) a.
ExampleT context m a -> ReaderT context (LoggingT m) a
unExampleT ExampleT context m ()
f
afterEach' Maybe SrcLoc
_ NodeOptions
_ String
_ ExampleT context m ()
_ (Pure ()
x) = () -> SpecFree context m ()
forall (f :: * -> *) a. a -> Free f a
Pure ()
x

-- * ----------------------------------------------------------

-- | Same as 'around', but applied individually to every 'it' node.
aroundEach :: (Monad m, HasCallStack) =>
  String
  -- ^ String label for this context manager
  -> (ExampleT context m [Result] -> ExampleT context m ())
  -- ^ Callback to run the child tree
  -> SpecFree context m ()
  -- ^ Child spec tree
  -> SpecFree context m ()
aroundEach :: String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
aroundEach = Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
forall (m :: * -> *) context.
(Monad m, HasCallStack) =>
Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
aroundEach' ((String, SrcLoc) -> SrcLoc
forall a b. (a, b) -> b
snd ((String, SrcLoc) -> SrcLoc)
-> Maybe (String, SrcLoc) -> Maybe SrcLoc
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [(String, SrcLoc)] -> Maybe (String, SrcLoc)
forall a. [a] -> Maybe a
headMay (CallStack -> [(String, SrcLoc)]
getCallStack CallStack
HasCallStack => CallStack
callStack)) (NodeOptions
defaultNodeOptions { nodeOptionsVisibilityThreshold :: Int
nodeOptionsVisibilityThreshold = Int
100 })

aroundEach' :: (Monad m, HasCallStack) =>
  Maybe SrcLoc
  -- ^ Location of this call
  -> NodeOptions
  -- ^ Custom options for this node
  -> String
  -- ^ String label for this context manager
  -> (ExampleT context m [Result] -> ExampleT context m ())
  -- ^ Callback to run the child tree
  -> SpecFree context m ()
  -- ^ Child spec tree
  -> SpecFree context m ()
aroundEach' :: Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
aroundEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m [Result] -> ExampleT context m ()
f (Free x :: SpecCommand context m (SpecFree context m ())
x@(Before'' {String
Maybe SrcLoc
SpecFree context m ()
NodeOptions
ExampleT context m ()
next :: SpecFree context m ()
subspec :: SpecFree context m ()
action :: ExampleT context m ()
label :: String
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
subspec :: forall context (m :: * -> *) next.
SpecCommand context m next -> SpecFree context m ()
action :: forall context (m :: * -> *) next.
SpecCommand context m next -> ExampleT context m ()
label :: forall context (m :: * -> *) next.
SpecCommand context m next -> String
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..})) = SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (SpecCommand context m (SpecFree context m ())
x { subspec :: SpecFree context m ()
subspec = Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
forall (m :: * -> *) context.
(Monad m, HasCallStack) =>
Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
aroundEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m [Result] -> ExampleT context m ()
f SpecFree context m ()
subspec, next :: SpecFree context m ()
next = Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
forall (m :: * -> *) context.
(Monad m, HasCallStack) =>
Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
aroundEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m [Result] -> ExampleT context m ()
f SpecFree context m ()
next })
aroundEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m [Result] -> ExampleT context m ()
f (Free x :: SpecCommand context m (SpecFree context m ())
x@(After'' {String
Maybe SrcLoc
SpecFree context m ()
NodeOptions
ExampleT context m ()
next :: SpecFree context m ()
subspec :: SpecFree context m ()
action :: ExampleT context m ()
label :: String
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
subspec :: forall context (m :: * -> *) next.
SpecCommand context m next -> SpecFree context m ()
action :: forall context (m :: * -> *) next.
SpecCommand context m next -> ExampleT context m ()
label :: forall context (m :: * -> *) next.
SpecCommand context m next -> String
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..})) = SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (SpecCommand context m (SpecFree context m ())
x { subspec :: SpecFree context m ()
subspec = Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
forall (m :: * -> *) context.
(Monad m, HasCallStack) =>
Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
aroundEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m [Result] -> ExampleT context m ()
f SpecFree context m ()
subspec, next :: SpecFree context m ()
next = Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
forall (m :: * -> *) context.
(Monad m, HasCallStack) =>
Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
aroundEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m [Result] -> ExampleT context m ()
f SpecFree context m ()
next })
aroundEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m [Result] -> ExampleT context m ()
f (Free x :: SpecCommand context m (SpecFree context m ())
x@(Around'' {String
Maybe SrcLoc
SpecFree context m ()
NodeOptions
ExampleT context m [Result] -> ExampleT context m ()
next :: SpecFree context m ()
subspec :: SpecFree context m ()
actionWith :: ExampleT context m [Result] -> ExampleT context m ()
label :: String
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
actionWith :: forall context (m :: * -> *) next.
SpecCommand context m next
-> ExampleT context m [Result] -> ExampleT context m ()
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
subspec :: forall context (m :: * -> *) next.
SpecCommand context m next -> SpecFree context m ()
label :: forall context (m :: * -> *) next.
SpecCommand context m next -> String
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..})) = SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (SpecCommand context m (SpecFree context m ())
x { subspec :: SpecFree context m ()
subspec = Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
forall (m :: * -> *) context.
(Monad m, HasCallStack) =>
Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
aroundEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m [Result] -> ExampleT context m ()
f SpecFree context m ()
subspec, next :: SpecFree context m ()
next = Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
forall (m :: * -> *) context.
(Monad m, HasCallStack) =>
Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
aroundEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m [Result] -> ExampleT context m ()
f SpecFree context m ()
next })
aroundEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m [Result] -> ExampleT context m ()
f (Free x :: SpecCommand context m (SpecFree context m ())
x@(Describe'' {String
Maybe SrcLoc
SpecFree context m ()
NodeOptions
next :: SpecFree context m ()
subspec :: SpecFree context m ()
label :: String
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
subspec :: forall context (m :: * -> *) next.
SpecCommand context m next -> SpecFree context m ()
label :: forall context (m :: * -> *) next.
SpecCommand context m next -> String
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..})) = SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (SpecCommand context m (SpecFree context m ())
x { subspec :: SpecFree context m ()
subspec = Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
forall (m :: * -> *) context.
(Monad m, HasCallStack) =>
Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
aroundEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m [Result] -> ExampleT context m ()
f SpecFree context m ()
subspec, next :: SpecFree context m ()
next = Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
forall (m :: * -> *) context.
(Monad m, HasCallStack) =>
Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
aroundEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m [Result] -> ExampleT context m ()
f SpecFree context m ()
next })
aroundEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m [Result] -> ExampleT context m ()
f (Free x :: SpecCommand context m (SpecFree context m ())
x@(Parallel'' {Maybe SrcLoc
SpecFree context m ()
NodeOptions
next :: SpecFree context m ()
subspec :: SpecFree context m ()
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
subspec :: forall context (m :: * -> *) next.
SpecCommand context m next -> SpecFree context m ()
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..})) = SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (SpecCommand context m (SpecFree context m ())
x { subspec :: SpecFree context m ()
subspec = Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
forall (m :: * -> *) context.
(Monad m, HasCallStack) =>
Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
aroundEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m [Result] -> ExampleT context m ()
f SpecFree context m ()
subspec, next :: SpecFree context m ()
next = Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
forall (m :: * -> *) context.
(Monad m, HasCallStack) =>
Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
aroundEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m [Result] -> ExampleT context m ()
f SpecFree context m ()
next })
aroundEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m [Result] -> ExampleT context m ()
f (Free x :: SpecCommand context m (SpecFree context m ())
x@(It'' {String
Maybe SrcLoc
SpecFree context m ()
NodeOptions
ExampleT context m ()
next :: SpecFree context m ()
example :: ExampleT context m ()
label :: String
nodeOptions :: NodeOptions
location :: Maybe SrcLoc
example :: forall context (m :: * -> *) next.
SpecCommand context m next -> ExampleT context m ()
next :: forall context (m :: * -> *) next.
SpecCommand context m next -> next
label :: forall context (m :: * -> *) next.
SpecCommand context m next -> String
nodeOptions :: forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
location :: forall context (m :: * -> *) next.
SpecCommand context m next -> Maybe SrcLoc
..})) = SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
-> SpecCommand context m (SpecFree context m ())
forall context (m :: * -> *) next.
Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> next
-> SpecCommand context m next
Around'' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m [Result] -> ExampleT context m ()
f (SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (SpecCommand context m (SpecFree context m ())
x { next :: SpecFree context m ()
next = () -> SpecFree context m ()
forall (f :: * -> *) a. a -> Free f a
Pure () })) (Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
forall (m :: * -> *) context.
(Monad m, HasCallStack) =>
Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
aroundEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m [Result] -> ExampleT context m ()
f SpecFree context m ()
next))
aroundEach' Maybe SrcLoc
_no NodeOptions
_ String
_ ExampleT context m [Result] -> ExampleT context m ()
_ (Pure ()
x) = () -> SpecFree context m ()
forall (f :: * -> *) a. a -> Free f a
Pure ()
x
aroundEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m [Result] -> ExampleT context m ()
f (Free (IntroduceWith'' Maybe SrcLoc
loci NodeOptions
noi String
li Label l intro
cl (intro -> ExampleT context m [Result]) -> ExampleT context m ()
action SpecFree (LabelValue l intro :> context) m ()
subspec SpecFree context m ()
next)) = SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (Maybe SrcLoc
-> NodeOptions
-> String
-> Label l intro
-> ((intro -> ExampleT context m [Result])
    -> ExampleT context m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> SpecFree context m ()
-> SpecCommand context m (SpecFree context m ())
forall (l :: Symbol) intro context (m :: * -> *) next.
Maybe SrcLoc
-> NodeOptions
-> String
-> Label l intro
-> ((intro -> ExampleT context m [Result])
    -> ExampleT context m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> next
-> SpecCommand context m next
IntroduceWith'' Maybe SrcLoc
loci NodeOptions
noi String
li Label l intro
cl (intro -> ExampleT context m [Result]) -> ExampleT context m ()
action (Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT (LabelValue l intro :> context) m [Result]
    -> ExampleT (LabelValue l intro :> context) m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> SpecFree (LabelValue l intro :> context) m ()
forall (m :: * -> *) context.
(Monad m, HasCallStack) =>
Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
aroundEach' Maybe SrcLoc
loc NodeOptions
no String
l ((ExampleT context m [Result] -> ExampleT context m ())
-> ExampleT (LabelValue l intro :> context) m [Result]
-> ExampleT (LabelValue l intro :> context) m ()
forall (m :: * -> *) introduce context.
Monad m =>
(ExampleT context m [Result] -> ExampleT context m ())
-> ExampleT (introduce :> context) m [Result]
-> ExampleT (introduce :> context) m ()
unwrapContext ExampleT context m [Result] -> ExampleT context m ()
f) SpecFree (LabelValue l intro :> context) m ()
subspec) (Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
forall (m :: * -> *) context.
(Monad m, HasCallStack) =>
Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
aroundEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m [Result] -> ExampleT context m ()
f SpecFree context m ()
next))
aroundEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m [Result] -> ExampleT context m ()
f (Free (Introduce'' Maybe SrcLoc
loci NodeOptions
noi String
li Label l intro
cl ExampleT context m intro
alloc intro -> ExampleT context m ()
clean SpecFree (LabelValue l intro :> context) m ()
subspec SpecFree context m ()
next)) = SpecCommand context m (SpecFree context m ())
-> SpecFree context m ()
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (Maybe SrcLoc
-> NodeOptions
-> String
-> Label l intro
-> ExampleT context m intro
-> (intro -> ExampleT context m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> SpecFree context m ()
-> SpecCommand context m (SpecFree context m ())
forall intro (l :: Symbol) context (m :: * -> *) next.
Typeable intro =>
Maybe SrcLoc
-> NodeOptions
-> String
-> Label l intro
-> ExampleT context m intro
-> (intro -> ExampleT context m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> next
-> SpecCommand context m next
Introduce'' Maybe SrcLoc
loci NodeOptions
noi String
li Label l intro
cl ExampleT context m intro
alloc intro -> ExampleT context m ()
clean (Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT (LabelValue l intro :> context) m [Result]
    -> ExampleT (LabelValue l intro :> context) m ())
-> SpecFree (LabelValue l intro :> context) m ()
-> SpecFree (LabelValue l intro :> context) m ()
forall (m :: * -> *) context.
(Monad m, HasCallStack) =>
Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
aroundEach' Maybe SrcLoc
loc NodeOptions
no String
l ((ExampleT context m [Result] -> ExampleT context m ())
-> ExampleT (LabelValue l intro :> context) m [Result]
-> ExampleT (LabelValue l intro :> context) m ()
forall (m :: * -> *) introduce context.
Monad m =>
(ExampleT context m [Result] -> ExampleT context m ())
-> ExampleT (introduce :> context) m [Result]
-> ExampleT (introduce :> context) m ()
unwrapContext ExampleT context m [Result] -> ExampleT context m ()
f) SpecFree (LabelValue l intro :> context) m ()
subspec) (Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
forall (m :: * -> *) context.
(Monad m, HasCallStack) =>
Maybe SrcLoc
-> NodeOptions
-> String
-> (ExampleT context m [Result] -> ExampleT context m ())
-> SpecFree context m ()
-> SpecFree context m ()
aroundEach' Maybe SrcLoc
loc NodeOptions
no String
l ExampleT context m [Result] -> ExampleT context m ()
f SpecFree context m ()
next))

-- * ----------------------------------------------------------

unwrapContext :: forall m introduce context. (Monad m) => (ExampleT context m [Result] -> ExampleT context m ()) -> ExampleT (introduce :> context) m [Result] -> ExampleT (introduce :> context) m ()
unwrapContext :: (ExampleT context m [Result] -> ExampleT context m ())
-> ExampleT (introduce :> context) m [Result]
-> ExampleT (introduce :> context) m ()
unwrapContext ExampleT context m [Result] -> ExampleT context m ()
f (ExampleT ReaderT (introduce :> context) (LoggingT m) [Result]
action) = do
  introduce
i :> context
_ <- ExampleT (introduce :> context) m (introduce :> context)
forall r (m :: * -> *). MonadReader r m => m r
ask
  ReaderT (introduce :> context) (LoggingT m) ()
-> ExampleT (introduce :> context) m ()
forall context (m :: * -> *) a.
ReaderT context (LoggingT m) a -> ExampleT context m a
ExampleT (ReaderT (introduce :> context) (LoggingT m) ()
 -> ExampleT (introduce :> context) m ())
-> ReaderT (introduce :> context) (LoggingT m) ()
-> ExampleT (introduce :> context) m ()
forall a b. (a -> b) -> a -> b
$ ((introduce :> context) -> context)
-> ReaderT context (LoggingT m) ()
-> ReaderT (introduce :> context) (LoggingT m) ()
forall r' r (m :: * -> *) a.
(r' -> r) -> ReaderT r m a -> ReaderT r' m a
withReaderT (\(introduce
_ :> context
context) -> context
context) (ReaderT context (LoggingT m) ()
 -> ReaderT (introduce :> context) (LoggingT m) ())
-> ReaderT context (LoggingT m) ()
-> ReaderT (introduce :> context) (LoggingT m) ()
forall a b. (a -> b) -> a -> b
$ ExampleT context m () -> ReaderT context (LoggingT m) ()
forall context (m :: * -> *) a.
ExampleT context m a -> ReaderT context (LoggingT m) a
unExampleT (ExampleT context m () -> ReaderT context (LoggingT m) ())
-> ExampleT context m () -> ReaderT context (LoggingT m) ()
forall a b. (a -> b) -> a -> b
$ ExampleT context m [Result] -> ExampleT context m ()
f (ExampleT context m [Result] -> ExampleT context m ())
-> ExampleT context m [Result] -> ExampleT context m ()
forall a b. (a -> b) -> a -> b
$ ReaderT context (LoggingT m) [Result]
-> ExampleT context m [Result]
forall context (m :: * -> *) a.
ReaderT context (LoggingT m) a -> ExampleT context m a
ExampleT ((context -> introduce :> context)
-> ReaderT (introduce :> context) (LoggingT m) [Result]
-> ReaderT context (LoggingT m) [Result]
forall r' r (m :: * -> *) a.
(r' -> r) -> ReaderT r m a -> ReaderT r' m a
withReaderT (introduce
i introduce -> context -> introduce :> context
forall a b. a -> b -> a :> b
:>) ReaderT (introduce :> context) (LoggingT m) [Result]
action)


-- | Convert a spec to a run tree
alterTopLevelNodeOptions :: (NodeOptions -> NodeOptions) -> Free (SpecCommand context IO) r -> Free (SpecCommand context IO) r
alterTopLevelNodeOptions :: (NodeOptions -> NodeOptions)
-> Free (SpecCommand context IO) r
-> Free (SpecCommand context IO) r
alterTopLevelNodeOptions NodeOptions -> NodeOptions
g (Free SpecCommand context IO (Free (SpecCommand context IO) r)
x) = SpecCommand context IO (Free (SpecCommand context IO) r)
-> Free (SpecCommand context IO) r
forall (f :: * -> *) a. f (Free f a) -> Free f a
Free (SpecCommand context IO (Free (SpecCommand context IO) r)
x { nodeOptions :: NodeOptions
nodeOptions = NodeOptions -> NodeOptions
g (SpecCommand context IO (Free (SpecCommand context IO) r)
-> NodeOptions
forall context (m :: * -> *) next.
SpecCommand context m next -> NodeOptions
nodeOptions SpecCommand context IO (Free (SpecCommand context IO) r)
x)
                                              , next :: Free (SpecCommand context IO) r
next = (NodeOptions -> NodeOptions)
-> Free (SpecCommand context IO) r
-> Free (SpecCommand context IO) r
forall context r.
(NodeOptions -> NodeOptions)
-> Free (SpecCommand context IO) r
-> Free (SpecCommand context IO) r
alterTopLevelNodeOptions NodeOptions -> NodeOptions
g (SpecCommand context IO (Free (SpecCommand context IO) r)
-> Free (SpecCommand context IO) r
forall context (m :: * -> *) next.
SpecCommand context m next -> next
next SpecCommand context IO (Free (SpecCommand context IO) r)
x)})
alterTopLevelNodeOptions NodeOptions -> NodeOptions
_ x :: Free (SpecCommand context IO) r
x@(Pure r
_) = Free (SpecCommand context IO) r
x

systemVisibilityThreshold :: Int
systemVisibilityThreshold :: Int
systemVisibilityThreshold = Int
150