polysemy-test-0.1.0.0: Polysemy effects for testing
Safe HaskellNone
LanguageHaskell2010

Polysemy.Test.Data.Hedgehog

Synopsis

Documentation

data Hedgehog :: Effect where Source #

Convenience effect for embedding Hedgehog assertions.

Constructors

LiftH :: TestT IO a -> Hedgehog m a 
Assert :: Bool -> Hedgehog m () 
AssertEqual :: (Eq a, Show a) => a -> a -> Hedgehog m () 
EvalEither :: Show e => Either e a -> Hedgehog m a 
AssertRight :: (Show e, Eq a, Show a) => a -> Either e a -> Hedgehog m () 

Instances

Instances details
type DefiningModule Hedgehog Source # 
Instance details

Defined in Polysemy.Test.Data.Hedgehog

type DefiningModule Hedgehog = "Polysemy.Test.Data.Hedgehog"

liftH :: forall a r. Member Hedgehog r => TestT IO a -> Sem r a Source #

Lift a TestT IO into Sem. >>> liftH (Hedgehog.evalEither (Right 0))

assert :: forall r. Member Hedgehog r => Bool -> Sem r () Source #

Embeds assert.

assertEqual :: forall a r. Eq a => Show a => Member Hedgehog r => a -> a -> Sem r () Source #

Embeds 'Hedgehog.(===)'.

(===) :: Eq a => Show a => Member Hedgehog r => a -> a -> Sem r () Source #

Alias for assertEqual. >>> 5 === 6

evalEither :: forall a e r. Show e => Member Hedgehog r => Either e a -> Sem r a Source #

Embeds evalEither.

assertRight :: forall a e r. Show e => Eq a => Show a => Member Hedgehog r => a -> Either e a -> Sem r () Source #

Given a reference value, unpacks an Either with evalEither and applies assertEqual to the result in the Right case, and produces a test failure in the Left case.