{-# options_haddock prune #-}

-- |Hedgehog Effect, Internal
module Polysemy.Test.Data.Hedgehog where

import Hedgehog (TestT)

-- |Convenience effect for embedding Hedgehog assertions.
data Hedgehog m :: Effect where
  LiftH :: TestT m a -> Hedgehog m n a

-- |Lift a @'TestT' m@ into Sem.
--
-- >>> liftH (Hedgehog.evalEither (Left 0))
-- liftH (Hedgehog.evalEither (Left 0))
-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-- │ 0
liftH ::
   m a r .
  Member (Hedgehog m) r =>
  TestT m a ->
  Sem r a
liftH :: forall (m :: * -> *) a (r :: EffectRow).
Member (Hedgehog m) r =>
TestT m a -> Sem r a
liftH =
  Hedgehog m (Sem r) a -> Sem r a
forall (e :: Effect) (r :: EffectRow) a.
Member e r =>
e (Sem r) a -> Sem r a
send (Hedgehog m (Sem r) a -> Sem r a)
-> (TestT m a -> Hedgehog m (Sem r) a) -> TestT m a -> Sem r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TestT m a -> Hedgehog m (Sem r) a
forall (m :: * -> *) a (n :: * -> *). TestT m a -> Hedgehog m n a
LiftH