hedgehog-1.5: Release with confidence.

Safe Haskell | None
Language | Haskell2010

Hedgehog

Contents

- Properties
- Generating Test Data
- Tests
- Coverage
- State Machine Tests
- Transformers
- Functors
- Deprecated

Description

This module includes almost everything you need to get started writing property tests with Hedgehog.

It is designed to be used alongside Hedgehog.Gen and Hedgehog.Range, which should be imported qualified. You also need to enable Template Haskell so the Hedgehog test runner can find your properties.

    {-# LANGUAGE TemplateHaskell #-}

    import           Hedgehog
    import qualified Hedgehog.Gen as Gen
    import qualified Hedgehog.Range as Range

Once you have your imports set up, you can write a simple property:

    prop_reverse :: Property
    prop_reverse =
      property $ do
        xs <- forAll $ Gen.list (Range.linear 0 100) Gen.alpha
        reverse (reverse xs) === xs

And add the Template Haskell splice which will discover your properties:

    tests :: IO Bool
    tests =
      checkParallel $$(discover)

If you prefer to avoid macros, you can specify the group of properties to run manually instead:

    {-# LANGUAGE OverloadedStrings #-}

    tests :: IO Bool
    tests =
      checkParallel $ Group "Test.Example" [
          ("prop_reverse", prop_reverse)
        ]

You can then load the module in GHCi, and run it:

    λ tests
    ━━━ Test.Example ━━━
      ✓ prop_reverse passed 100 tests.

Synopsis

- data Property
- data PropertyT (m :: Type -> Type) a
- data Group = Group {
  - groupName :: !GroupName
  - groupProperties :: ![(PropertyName, Property)]
  }
- data PropertyName
- data GroupName
- property :: HasCallStack => PropertyT IO () -> Property
- test :: forall (m :: Type -> Type) a. Monad m => TestT m a -> PropertyT m a
- forAll :: forall (m :: Type -> Type) a. (Monad m, Show a, HasCallStack) => Gen a -> PropertyT m a
- forAllWith :: forall (m :: Type -> Type) a. (Monad m, HasCallStack) => (a -> String) -> Gen a -> PropertyT m a
- discard :: forall (m :: Type -> Type) a. Monad m => PropertyT m a
- check :: MonadIO m => Property -> m Bool
- recheck :: MonadIO m => Size -> Seed -> Property -> m ()
- recheckAt :: MonadIO m => Seed -> Skip -> Property -> m ()
- discover :: TExpQ Group
- discoverPrefix :: String -> TExpQ Group
- checkParallel :: MonadIO m => Group -> m Bool
- checkSequential :: MonadIO m => Group -> m Bool
- data Confidence
- verifiedTermination :: Property -> Property
- withConfidence :: Confidence -> Property -> Property
- withTests :: TestLimit -> Property -> Property
- data TestLimit
- withDiscards :: DiscardLimit -> Property -> Property
- data DiscardLimit
- withShrinks :: ShrinkLimit -> Property -> Property
- data ShrinkLimit
- withRetries :: ShrinkRetries -> Property -> Property
- data ShrinkRetries
- withSkip :: Skip -> Property -> Property
- data Skip
- type Gen = GenT Identity
- data GenT (m :: Type -> Type) a
- class (Monad m, Monad (GenBase m)) => MonadGen (m :: Type -> Type) where
  - type GenBase (m :: Type -> Type) :: Type -> Type
  - toGenT :: m a -> GenT (GenBase m) a
  - fromGenT :: GenT (GenBase m) a -> m a
- data Range a
- newtype Size = Size {
  - unSize :: Int
  }
- data Seed = Seed {
  - seedValue :: !Word64
  - seedGamma :: !Word64
  }
- type Test = TestT Identity
- data TestT (m :: Type -> Type) a
- class Monad m => MonadTest (m :: Type -> Type) where
  - liftTest :: Test a -> m a
- annotate :: (MonadTest m, HasCallStack) => String -> m ()
- annotateShow :: (MonadTest m, Show a, HasCallStack) => a -> m ()
- footnote :: MonadTest m => String -> m ()
- footnoteShow :: (MonadTest m, Show a) => a -> m ()
- success :: MonadTest m => m ()
- failure :: (MonadTest m, HasCallStack) => m a
- assert :: (MonadTest m, HasCallStack) => Bool -> m ()
- diff :: (MonadTest m, Show a, Show b, HasCallStack) => a -> (a -> b -> Bool) -> b -> m ()
- (===) :: (MonadTest m, Eq a, Show a, HasCallStack) => a -> a -> m ()
- (/==) :: (MonadTest m, Eq a, Show a, HasCallStack) => a -> a -> m ()
- tripping :: (MonadTest m, Applicative f, Show b, Show (f a), Eq (f a), HasCallStack) => a -> (a -> b) -> (b -> f a) -> m ()
- eval :: (MonadTest m, HasCallStack) => a -> m a
- evalNF :: (MonadTest m, NFData a, HasCallStack) => a -> m a
- evalM :: (MonadTest m, MonadCatch m, HasCallStack) => m a -> m a
- evalIO :: (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a
- evalEither :: (MonadTest m, Show x, HasCallStack) => Either x a -> m a
- evalEitherM :: (MonadTest m, Show x, MonadCatch m, HasCallStack) => m (Either x a) -> m a
- evalExceptT :: (MonadTest m, Show x, HasCallStack) => ExceptT x m a -> m a
- evalMaybe :: (MonadTest m, HasCallStack) => Maybe a -> m a
- evalMaybeM :: (MonadTest m, MonadCatch m, HasCallStack) => m (Maybe a) -> m a
- data LabelName
- classify :: (MonadTest m, HasCallStack) => LabelName -> Bool -> m ()
- cover :: (MonadTest m, HasCallStack) => CoverPercentage -> LabelName -> Bool -> m ()
- label :: (MonadTest m, HasCallStack) => LabelName -> m ()
- collect :: (MonadTest m, Show a, HasCallStack) => a -> m ()
- data Command (gen :: Type -> Type) (m :: Type -> Type) (state :: (Type -> Type) -> Type) = (TraversableB input, Show (input Symbolic), Show output, Typeable output) => Command {
  - commandGen :: state Symbolic -> Maybe (gen (input Symbolic))
  - commandExecute :: input Concrete -> m output
  - commandCallbacks :: [Callback input output state]
  }
- data Callback (input :: (Type -> Type) -> Type) output (state :: (Type -> Type) -> Type)
  - = Require (state Symbolic -> input Symbolic -> Bool)
  - | Update (forall (v :: Type -> Type). Ord1 v => state v -> input v -> Var output v -> state v)
  - | Ensure (state Concrete -> state Concrete -> input Concrete -> output -> Test ())
- data Action (m :: Type -> Type) (state :: (Type -> Type) -> Type)
- newtype Sequential (m :: Type -> Type) (state :: (Type -> Type) -> Type) = Sequential {
  - sequentialActions :: [Action m state]
  }
- data Parallel (m :: Type -> Type) (state :: (Type -> Type) -> Type) = Parallel {
  - parallelPrefix :: [Action m state]
  - parallelBranch1 :: [Action m state]
  - parallelBranch2 :: [Action m state]
  }
- executeSequential :: (MonadTest m, MonadCatch m, HasCallStack) => (forall (v :: Type -> Type). state v) -> Sequential m state -> m ()
- executeParallel :: (MonadTest m, MonadCatch m, MonadBaseControl IO m, HasCallStack) => (forall (v :: Type -> Type). state v) -> Parallel m state -> m ()
- newtype Var a (v :: Type -> Type) = Var (v a)
- concrete :: Var a Concrete -> a
- opaque :: Var (Opaque a) Concrete -> a
- data Symbolic a
- newtype Concrete a where
  - Concrete :: forall a. a -> Concrete a
- newtype Opaque a = Opaque {
  - unOpaque :: a
  }
- distributeT :: forall f (m :: Type -> Type) a. (MonadTransDistributive g, Transformer f g m) => g (f m) a -> f (g m) a
- class FunctorB (b :: (k -> Type) -> Type) where
  - bmap :: (forall (a :: k). f a -> g a) -> b f -> b g
- class FunctorB b => TraversableB (b :: (k -> Type) -> Type) where
  - btraverse :: Applicative e => (forall (a :: k). f a -> e (g a)) -> b f -> e (b g)
- newtype Rec p a (x :: k) = Rec {
  - unRec :: K1 R a x
  }
- class (forall a. Eq a => Eq (f a)) => Eq1 (f :: Type -> Type)
- eq1 :: (Eq1 f, Eq a) => f a -> f a -> Bool
- class (Eq1 f, forall a. Ord a => Ord (f a)) => Ord1 (f :: Type -> Type)
- compare1 :: (Ord1 f, Ord a) => f a -> f a -> Ordering
- class (forall a. Show a => Show (f a)) => Show1 (f :: Type -> Type)
- showsPrec1 :: (Show1 f, Show a) => Int -> f a -> ShowS
- class HTraversable (t :: (Type -> Type) -> Type) where
  - htraverse :: Applicative f => (forall a. g a -> f (h a)) -> t g -> f (t h)

# Properties

data Property Source #

A property test, along with some configurable limits like how many times to run the test.

data PropertyT (m :: Type -> Type) a Source #

The property monad transformer allows both the generation of test inputs and the assertion of expectations.

#### Instances

Instances details

MonadTransDistributive PropertyT Source # |

Instance details

Defined in Hedgehog.Internal.Property

Associated Types

type Transformer t PropertyT m |
Instance details Defined in Hedgehog.Internal.Property type Transformer t PropertyT m = (Transformer t GenT m, Transformer t TestT (GenT m))

Methods

distributeT :: forall f (m :: Type -> Type) a. Transformer f PropertyT m => PropertyT (f m) a -> f (PropertyT m) a Source #

MonadTrans PropertyT Source # |
Instance details Defined in Hedgehog.Internal.Property Methods lift :: Monad m => m a -> PropertyT m a Source #
MFunctor PropertyT Source # |
Instance details Defined in Hedgehog.Internal.Property Methods hoist :: Monad m => (forall a. m a -> n a) -> PropertyT m b -> PropertyT n b Source #
MonadBaseControl b m => MonadBaseControl b (PropertyT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods liftBaseWith :: (RunInBase (PropertyT m) b -> b a) -> PropertyT m a Source # restoreM :: StM (PropertyT m) a -> PropertyT m a Source #
MonadError e m => MonadError e (PropertyT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods throwError :: e -> PropertyT m a Source # catchError :: PropertyT m a -> (e -> PropertyT m a) -> PropertyT m a Source #
MonadReader r m => MonadReader r (PropertyT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods ask :: PropertyT m r Source # local :: (r -> r) -> PropertyT m a -> PropertyT m a Source # reader :: (r -> a) -> PropertyT m a Source #
MonadState s m => MonadState s (PropertyT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods get :: PropertyT m s Source # put :: s -> PropertyT m () Source # state :: (s -> (a, s)) -> PropertyT m a Source #
MonadBase b m => MonadBase b (PropertyT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods liftBase :: b α -> PropertyT m α Source #
MonadIO m => MonadIO (PropertyT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods liftIO :: IO a -> PropertyT m a Source #
MonadCatch m => MonadCatch (PropertyT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods catch :: (HasCallStack, Exception e) => PropertyT m a -> (e -> PropertyT m a) -> PropertyT m a Source #
MonadThrow m => MonadThrow (PropertyT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods throwM :: (HasCallStack, Exception e) => e -> PropertyT m a Source #
MonadPlus m => Alternative (PropertyT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods empty :: PropertyT m a Source # (<|>) :: PropertyT m a -> PropertyT m a -> PropertyT m a Source # some :: PropertyT m a -> PropertyT m [a] Source # many :: PropertyT m a -> PropertyT m [a] Source #
Monad m => Applicative (PropertyT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods pure :: a -> PropertyT m a Source # (<*>) :: PropertyT m (a -> b) -> PropertyT m a -> PropertyT m b Source # liftA2 :: (a -> b -> c) -> PropertyT m a -> PropertyT m b -> PropertyT m c Source # (*>) :: PropertyT m a -> PropertyT m b -> PropertyT m b Source # (<*) :: PropertyT m a -> PropertyT m b -> PropertyT m a Source #
Functor m => Functor (PropertyT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods fmap :: (a -> b) -> PropertyT m a -> PropertyT m b Source # (<$) :: a -> PropertyT m b -> PropertyT m a Source #
Monad m => Monad (PropertyT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods (>>=) :: PropertyT m a -> (a -> PropertyT m b) -> PropertyT m b Source # (>>) :: PropertyT m a -> PropertyT m b -> PropertyT m b Source # return :: a -> PropertyT m a Source #
MonadPlus m => MonadPlus (PropertyT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods mzero :: PropertyT m a Source # mplus :: PropertyT m a -> PropertyT m a -> PropertyT m a Source #
Monad m => MonadFail (PropertyT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods fail :: String -> PropertyT m a Source #
Monad m => MonadTest (PropertyT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods liftTest :: Test a -> PropertyT m a Source #
PrimMonad m => PrimMonad (PropertyT m) Source # |

Instance details

Defined in Hedgehog.Internal.Property

Associated Types

type PrimState (PropertyT m) |
Instance details Defined in Hedgehog.Internal.Property type PrimState (PropertyT m) = PrimState m

Methods

primitive :: (State# (PrimState (PropertyT m)) -> (# State# (PrimState (PropertyT m)), a #)) -> PropertyT m a Source #

MonadResource m => MonadResource (PropertyT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods liftResourceT :: ResourceT IO a -> PropertyT m a Source #
type Transformer t PropertyT m Source # |
Instance details Defined in Hedgehog.Internal.Property type Transformer t PropertyT m = (Transformer t GenT m, Transformer t TestT (GenT m))
type PrimState (PropertyT m) Source # |
Instance details Defined in Hedgehog.Internal.Property type PrimState (PropertyT m) = PrimState m
type StM (PropertyT m) a Source # |
Instance details Defined in Hedgehog.Internal.Property type StM (PropertyT m) a = StM (TestT (GenT m)) a

data Group Source #

A named collection of property tests.

Constructors

Group |

Fields

- groupName :: !GroupName
- groupProperties :: ![(PropertyName, Property)]

data PropertyName Source #

The name of a property.

Should be constructed using `OverloadedStrings`:

      "apples" :: PropertyName

#### Instances

Instances details

Semigroup PropertyName Source # |
Instance details Defined in Hedgehog.Internal.Property Methods (<>) :: PropertyName -> PropertyName -> PropertyName Source # sconcat :: NonEmpty PropertyName -> PropertyName Source # stimes :: Integral b => b -> PropertyName -> PropertyName Source #
IsString PropertyName Source # |
Instance details Defined in Hedgehog.Internal.Property Methods fromString :: String -> PropertyName Source #
Show PropertyName Source # |
Instance details Defined in Hedgehog.Internal.Property Methods showsPrec :: Int -> PropertyName -> ShowS Source # show :: PropertyName -> String Source # showList :: [PropertyName] -> ShowS Source #
Eq PropertyName Source # |
Instance details Defined in Hedgehog.Internal.Property Methods (==) :: PropertyName -> PropertyName -> Bool Source # (/=) :: PropertyName -> PropertyName -> Bool Source #
Ord PropertyName Source # |

Instance details

Defined in Hedgehog.Internal.Property

Methods

compare :: PropertyName -> PropertyName -> Ordering Source #

(<) :: PropertyName -> PropertyName -> Bool Source #

(<=) :: PropertyName -> PropertyName -> Bool Source #

(>) :: PropertyName -> PropertyName -> Bool Source #

(>=) :: PropertyName -> PropertyName -> Bool Source #

max :: PropertyName -> PropertyName -> PropertyName Source #

min :: PropertyName -> PropertyName -> PropertyName Source #

Lift PropertyName Source # |
Instance details Defined in Hedgehog.Internal.Property Methods lift :: Quote m => PropertyName -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => PropertyName -> Code m PropertyName Source #

data GroupName Source #

The name of a group of properties.

Should be constructed using `OverloadedStrings`:

      "fruit" :: GroupName

#### Instances

Instances details

Semigroup GroupName Source # |
Instance details Defined in Hedgehog.Internal.Property Methods (<>) :: GroupName -> GroupName -> GroupName Source # sconcat :: NonEmpty GroupName -> GroupName Source # stimes :: Integral b => b -> GroupName -> GroupName Source #
IsString GroupName Source # |
Instance details Defined in Hedgehog.Internal.Property Methods fromString :: String -> GroupName Source #
Show GroupName Source # |
Instance details Defined in Hedgehog.Internal.Property Methods showsPrec :: Int -> GroupName -> ShowS Source # show :: GroupName -> String Source # showList :: [GroupName] -> ShowS Source #
Eq GroupName Source # |
Instance details Defined in Hedgehog.Internal.Property Methods (==) :: GroupName -> GroupName -> Bool Source # (/=) :: GroupName -> GroupName -> Bool Source #
Ord GroupName Source # |

Instance details

Defined in Hedgehog.Internal.Property

Methods

compare :: GroupName -> GroupName -> Ordering Source #

(<) :: GroupName -> GroupName -> Bool Source #

(<=) :: GroupName -> GroupName -> Bool Source #

(>) :: GroupName -> GroupName -> Bool Source #

(>=) :: GroupName -> GroupName -> Bool Source #

max :: GroupName -> GroupName -> GroupName Source #

min :: GroupName -> GroupName -> GroupName Source #

Lift GroupName Source # |
Instance details Defined in Hedgehog.Internal.Property Methods lift :: Quote m => GroupName -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => GroupName -> Code m GroupName Source #

property :: HasCallStack => PropertyT IO () -> Property Source #

Creates a property with the default configuration.

test :: forall (m :: Type -> Type) a. Monad m => TestT m a -> PropertyT m a Source #

Lift a test in to a property.

Because both `TestT` and `PropertyT` have `MonadTest` instances, this function is not often required. It can however be useful for writing functions directly in `TestT` and thus gaining a `MonadTransControl` instance at the expense of not being able to generate additional inputs using `forAll`.

An example where this is useful is parallel state machine testing, as `executeParallel` requires `MonadBaseControl` `IO` in order to be able to spawn threads in `MonadTest`.

forAll :: forall (m :: Type -> Type) a. (Monad m, Show a, HasCallStack) => Gen a -> PropertyT m a Source #

Generates a random input for the test by running the provided generator.

forAllWith :: forall (m :: Type -> Type) a. (Monad m, HasCallStack) => (a -> String) -> Gen a -> PropertyT m a Source #

Generates a random input for the test by running the provided generator.

This is a the same as `forAll` but allows the user to provide a custom rendering function. This is useful for values which don't have a `Show` instance.

discard :: forall (m :: Type -> Type) a. Monad m => PropertyT m a Source #

Discards the current test entirely.

check :: MonadIO m => Property -> m Bool Source #

Check a property.

recheck :: MonadIO m => Size -> Seed -> Property -> m () Source #

Check a property using a specific size and seed.

recheckAt :: MonadIO m => Seed -> Skip -> Property -> m () Source #

discover :: TExpQ Group Source #

Discover all the properties in a module.

Functions starting with `prop_` are assumed to be properties.

discoverPrefix :: String -> TExpQ Group Source #

checkParallel :: MonadIO m => Group -> m Bool Source #

Check a group of properties in parallel.

Warning: although this check function runs tests faster than `checkSequential`, it should be noted that it may cause problems with properties that are not self-contained. For example, if you have a group of tests which all use the same database table, you may find that they interfere with each other when being run in parallel.

Using Template Haskell for property discovery:

    tests :: IO Bool
    tests =
      checkParallel $$(discover)

With manually specified properties:

    tests :: IO Bool
    tests =
      checkParallel $ Group "Test.Example" [
          ("prop_reverse", prop_reverse)
        ]

checkSequential :: MonadIO m => Group -> m Bool Source #

Check a group of properties sequentially.

Using Template Haskell for property discovery:

    tests :: IO Bool
    tests =
      checkSequential $$(discover)

With manually specified properties:

    tests :: IO Bool
    tests =
      checkSequential $ Group "Test.Example" [
          ("prop_reverse", prop_reverse)
        ]

data Confidence Source #

The acceptable occurrence of false positives

Example, `Confidence 10^9` would mean that you'd accept a false positive for 1 in 10^9 tests.

#### Instances

Instances details

Num Confidence Source # |

Instance details

Defined in Hedgehog.Internal.Property

Methods

(+) :: Confidence -> Confidence -> Confidence Source #

(-) :: Confidence -> Confidence -> Confidence Source #

(*) :: Confidence -> Confidence -> Confidence Source #

negate :: Confidence -> Confidence Source #

abs :: Confidence -> Confidence Source #

signum :: Confidence -> Confidence Source #

fromInteger :: Integer -> Confidence Source #

Show Confidence Source # |
Instance details Defined in Hedgehog.Internal.Property Methods showsPrec :: Int -> Confidence -> ShowS Source # show :: Confidence -> String Source # showList :: [Confidence] -> ShowS Source #
Eq Confidence Source # |
Instance details Defined in Hedgehog.Internal.Property Methods (==) :: Confidence -> Confidence -> Bool Source # (/=) :: Confidence -> Confidence -> Bool Source #
Ord Confidence Source # |

Instance details

Defined in Hedgehog.Internal.Property

Methods

compare :: Confidence -> Confidence -> Ordering Source #

(<) :: Confidence -> Confidence -> Bool Source #

(<=) :: Confidence -> Confidence -> Bool Source #

(>) :: Confidence -> Confidence -> Bool Source #

(>=) :: Confidence -> Confidence -> Bool Source #

max :: Confidence -> Confidence -> Confidence Source #

min :: Confidence -> Confidence -> Confidence Source #

Lift Confidence Source # |
Instance details Defined in Hedgehog.Internal.Property Methods lift :: Quote m => Confidence -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => Confidence -> Code m Confidence Source #

verifiedTermination :: Property -> Property Source #

withConfidence :: Confidence -> Property -> Property Source #

Make sure that the result is statistically significant in accordance to the passed `Confidence`

withTests :: TestLimit -> Property -> Property Source #

Set the number of times a property should be executed before it is considered successful.

If you have a test that does not involve any generators and thus does not need to run repeatedly, you can use `withTests 1` to define a property that will only be checked once.

data TestLimit Source #

The number of successful tests that need to be run before a property test is considered successful.

Can be constructed using numeric literals:

      200 :: TestLimit

#### Instances

Instances details

Enum TestLimit Source # |

Instance details

Defined in Hedgehog.Internal.Property

Methods

succ :: TestLimit -> TestLimit Source #

pred :: TestLimit -> TestLimit Source #

toEnum :: Int -> TestLimit Source #

fromEnum :: TestLimit -> Int Source #

enumFrom :: TestLimit -> [TestLimit] Source #

enumFromThen :: TestLimit -> TestLimit -> [TestLimit] Source #

enumFromTo :: TestLimit -> TestLimit -> [TestLimit] Source #

enumFromThenTo :: TestLimit -> TestLimit -> TestLimit -> [TestLimit] Source #

Num TestLimit Source # |
Instance details Defined in Hedgehog.Internal.Property Methods (+) :: TestLimit -> TestLimit -> TestLimit Source # (-) :: TestLimit -> TestLimit -> TestLimit Source # (*) :: TestLimit -> TestLimit -> TestLimit Source # negate :: TestLimit -> TestLimit Source # abs :: TestLimit -> TestLimit Source # signum :: TestLimit -> TestLimit Source # fromInteger :: Integer -> TestLimit Source #
Integral TestLimit Source # |

Instance details

Defined in Hedgehog.Internal.Property

Methods

quot :: TestLimit -> TestLimit -> TestLimit Source #

rem :: TestLimit -> TestLimit -> TestLimit Source #

div :: TestLimit -> TestLimit -> TestLimit Source #

mod :: TestLimit -> TestLimit -> TestLimit Source #

quotRem :: TestLimit -> TestLimit -> (TestLimit, TestLimit) Source #

divMod :: TestLimit -> TestLimit -> (TestLimit, TestLimit) Source #

toInteger :: TestLimit -> Integer Source #

Real TestLimit Source # |
Instance details Defined in Hedgehog.Internal.Property Methods toRational :: TestLimit -> Rational Source #
Show TestLimit Source # |
Instance details Defined in Hedgehog.Internal.Property Methods showsPrec :: Int -> TestLimit -> ShowS Source # show :: TestLimit -> String Source # showList :: [TestLimit] -> ShowS Source #
Eq TestLimit Source # |
Instance details Defined in Hedgehog.Internal.Property Methods (==) :: TestLimit -> TestLimit -> Bool Source # (/=) :: TestLimit -> TestLimit -> Bool Source #
Ord TestLimit Source # |

Instance details

Defined in Hedgehog.Internal.Property

Methods

compare :: TestLimit -> TestLimit -> Ordering Source #

(<) :: TestLimit -> TestLimit -> Bool Source #

(<=) :: TestLimit -> TestLimit -> Bool Source #

(>) :: TestLimit -> TestLimit -> Bool Source #

(>=) :: TestLimit -> TestLimit -> Bool Source #

max :: TestLimit -> TestLimit -> TestLimit Source #

min :: TestLimit -> TestLimit -> TestLimit Source #

Lift TestLimit Source # |
Instance details Defined in Hedgehog.Internal.Property Methods lift :: Quote m => TestLimit -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => TestLimit -> Code m TestLimit Source #

withDiscards :: DiscardLimit -> Property -> Property Source #

Set the number of times a property is allowed to discard before the test runner gives up.

data DiscardLimit Source #

The number of discards to allow before giving up.

Can be constructed using numeric literals:

      10000 :: DiscardLimit

#### Instances

Instances details

Enum DiscardLimit Source # |

Instance details

Defined in Hedgehog.Internal.Property

Methods

succ :: DiscardLimit -> DiscardLimit Source #

pred :: DiscardLimit -> DiscardLimit Source #

toEnum :: Int -> DiscardLimit Source #

fromEnum :: DiscardLimit -> Int Source #

enumFrom :: DiscardLimit -> [DiscardLimit] Source #

enumFromThen :: DiscardLimit -> DiscardLimit -> [DiscardLimit] Source #

enumFromTo :: DiscardLimit -> DiscardLimit -> [DiscardLimit] Source #

enumFromThenTo :: DiscardLimit -> DiscardLimit -> DiscardLimit -> [DiscardLimit] Source #

Num DiscardLimit Source # |

Instance details

Defined in Hedgehog.Internal.Property

Methods

(+) :: DiscardLimit -> DiscardLimit -> DiscardLimit Source #

(-) :: DiscardLimit -> DiscardLimit -> DiscardLimit Source #

(*) :: DiscardLimit -> DiscardLimit -> DiscardLimit Source #

negate :: DiscardLimit -> DiscardLimit Source #

abs :: DiscardLimit -> DiscardLimit Source #

signum :: DiscardLimit -> DiscardLimit Source #

fromInteger :: Integer -> DiscardLimit Source #

Integral DiscardLimit Source # |

Instance details

Defined in Hedgehog.Internal.Property

Methods

quot :: DiscardLimit -> DiscardLimit -> DiscardLimit Source #

rem :: DiscardLimit -> DiscardLimit -> DiscardLimit Source #

div :: DiscardLimit -> DiscardLimit -> DiscardLimit Source #

mod :: DiscardLimit -> DiscardLimit -> DiscardLimit Source #

quotRem :: DiscardLimit -> DiscardLimit -> (DiscardLimit, DiscardLimit) Source #

divMod :: DiscardLimit -> DiscardLimit -> (DiscardLimit, DiscardLimit) Source #

toInteger :: DiscardLimit -> Integer Source #

Real DiscardLimit Source # |
Instance details Defined in Hedgehog.Internal.Property Methods toRational :: DiscardLimit -> Rational Source #
Show DiscardLimit Source # |
Instance details Defined in Hedgehog.Internal.Property Methods showsPrec :: Int -> DiscardLimit -> ShowS Source # show :: DiscardLimit -> String Source # showList :: [DiscardLimit] -> ShowS Source #
Eq DiscardLimit Source # |
Instance details Defined in Hedgehog.Internal.Property Methods (==) :: DiscardLimit -> DiscardLimit -> Bool Source # (/=) :: DiscardLimit -> DiscardLimit -> Bool Source #
Ord DiscardLimit Source # |

Instance details

Defined in Hedgehog.Internal.Property

Methods

compare :: DiscardLimit -> DiscardLimit -> Ordering Source #

(<) :: DiscardLimit -> DiscardLimit -> Bool Source #

(<=) :: DiscardLimit -> DiscardLimit -> Bool Source #

(>) :: DiscardLimit -> DiscardLimit -> Bool Source #

(>=) :: DiscardLimit -> DiscardLimit -> Bool Source #

max :: DiscardLimit -> DiscardLimit -> DiscardLimit Source #

min :: DiscardLimit -> DiscardLimit -> DiscardLimit Source #

Lift DiscardLimit Source # |
Instance details Defined in Hedgehog.Internal.Property Methods lift :: Quote m => DiscardLimit -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => DiscardLimit -> Code m DiscardLimit Source #

withShrinks :: ShrinkLimit -> Property -> Property Source #

Set the number of times a property is allowed to shrink before the test runner gives up and prints the counterexample.

data ShrinkLimit Source #

The number of shrinks to try before giving up on shrinking.

Can be constructed using numeric literals:

      1000 :: ShrinkLimit

#### Instances

Instances details

Enum ShrinkLimit Source # |

Instance details

Defined in Hedgehog.Internal.Property

Methods

succ :: ShrinkLimit -> ShrinkLimit Source #

pred :: ShrinkLimit -> ShrinkLimit Source #

toEnum :: Int -> ShrinkLimit Source #

fromEnum :: ShrinkLimit -> Int Source #

enumFrom :: ShrinkLimit -> [ShrinkLimit] Source #

enumFromThen :: ShrinkLimit -> ShrinkLimit -> [ShrinkLimit] Source #

enumFromTo :: ShrinkLimit -> ShrinkLimit -> [ShrinkLimit] Source #

enumFromThenTo :: ShrinkLimit -> ShrinkLimit -> ShrinkLimit -> [ShrinkLimit] Source #

Num ShrinkLimit Source # |

Instance details

Defined in Hedgehog.Internal.Property

Methods

(+) :: ShrinkLimit -> ShrinkLimit -> ShrinkLimit Source #

(-) :: ShrinkLimit -> ShrinkLimit -> ShrinkLimit Source #

(*) :: ShrinkLimit -> ShrinkLimit -> ShrinkLimit Source #

negate :: ShrinkLimit -> ShrinkLimit Source #

abs :: ShrinkLimit -> ShrinkLimit Source #

signum :: ShrinkLimit -> ShrinkLimit Source #

fromInteger :: Integer -> ShrinkLimit Source #

Integral ShrinkLimit Source # |

Instance details

Defined in Hedgehog.Internal.Property

Methods

quot :: ShrinkLimit -> ShrinkLimit -> ShrinkLimit Source #

rem :: ShrinkLimit -> ShrinkLimit -> ShrinkLimit Source #

div :: ShrinkLimit -> ShrinkLimit -> ShrinkLimit Source #

mod :: ShrinkLimit -> ShrinkLimit -> ShrinkLimit Source #

quotRem :: ShrinkLimit -> ShrinkLimit -> (ShrinkLimit, ShrinkLimit) Source #

divMod :: ShrinkLimit -> ShrinkLimit -> (ShrinkLimit, ShrinkLimit) Source #

toInteger :: ShrinkLimit -> Integer Source #

Real ShrinkLimit Source # |
Instance details Defined in Hedgehog.Internal.Property Methods toRational :: ShrinkLimit -> Rational Source #
Show ShrinkLimit Source # |
Instance details Defined in Hedgehog.Internal.Property Methods showsPrec :: Int -> ShrinkLimit -> ShowS Source # show :: ShrinkLimit -> String Source # showList :: [ShrinkLimit] -> ShowS Source #
Eq ShrinkLimit Source # |
Instance details Defined in Hedgehog.Internal.Property Methods (==) :: ShrinkLimit -> ShrinkLimit -> Bool Source # (/=) :: ShrinkLimit -> ShrinkLimit -> Bool Source #
Ord ShrinkLimit Source # |

Instance details

Defined in Hedgehog.Internal.Property

Methods

compare :: ShrinkLimit -> ShrinkLimit -> Ordering Source #

(<) :: ShrinkLimit -> ShrinkLimit -> Bool Source #

(<=) :: ShrinkLimit -> ShrinkLimit -> Bool Source #

(>) :: ShrinkLimit -> ShrinkLimit -> Bool Source #

(>=) :: ShrinkLimit -> ShrinkLimit -> Bool Source #

max :: ShrinkLimit -> ShrinkLimit -> ShrinkLimit Source #

min :: ShrinkLimit -> ShrinkLimit -> ShrinkLimit Source #

Lift ShrinkLimit Source # |
Instance details Defined in Hedgehog.Internal.Property Methods lift :: Quote m => ShrinkLimit -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => ShrinkLimit -> Code m ShrinkLimit Source #

withRetries :: ShrinkRetries -> Property -> Property Source #

Set the number of times a property will be executed for each shrink before the test runner gives up and tries a different shrink. See `ShrinkRetries` for more information.

data ShrinkRetries Source #

The number of times to re-run a test during shrinking. This is useful if you are testing something which fails non-deterministically and you want to increase the change of getting a good shrink.

If you are doing parallel state machine testing, you should probably set shrink retries to something like `10`. This will mean that during shrinking, a parallel test case requires 10 successful runs before it is passes and we try a different shrink.

Can be constructed using numeric literals:

      0 :: ShrinkRetries

#### Instances

Instances details

Enum ShrinkRetries Source # |

Instance details

Defined in Hedgehog.Internal.Property

Methods

succ :: ShrinkRetries -> ShrinkRetries Source #

pred :: ShrinkRetries -> ShrinkRetries Source #

toEnum :: Int -> ShrinkRetries Source #

fromEnum :: ShrinkRetries -> Int Source #

enumFrom :: ShrinkRetries -> [ShrinkRetries] Source #

enumFromThen :: ShrinkRetries -> ShrinkRetries -> [ShrinkRetries] Source #

enumFromTo :: ShrinkRetries -> ShrinkRetries -> [ShrinkRetries] Source #

enumFromThenTo :: ShrinkRetries -> ShrinkRetries -> ShrinkRetries -> [ShrinkRetries] Source #

Num ShrinkRetries Source # |

Instance details

Defined in Hedgehog.Internal.Property

Methods

(+) :: ShrinkRetries -> ShrinkRetries -> ShrinkRetries Source #

(-) :: ShrinkRetries -> ShrinkRetries -> ShrinkRetries Source #

(*) :: ShrinkRetries -> ShrinkRetries -> ShrinkRetries Source #

negate :: ShrinkRetries -> ShrinkRetries Source #

abs :: ShrinkRetries -> ShrinkRetries Source #

signum :: ShrinkRetries -> ShrinkRetries Source #

fromInteger :: Integer -> ShrinkRetries Source #

Integral ShrinkRetries Source # |

Instance details

Defined in Hedgehog.Internal.Property

Methods

quot :: ShrinkRetries -> ShrinkRetries -> ShrinkRetries Source #

rem :: ShrinkRetries -> ShrinkRetries -> ShrinkRetries Source #

div :: ShrinkRetries -> ShrinkRetries -> ShrinkRetries Source #

mod :: ShrinkRetries -> ShrinkRetries -> ShrinkRetries Source #

quotRem :: ShrinkRetries -> ShrinkRetries -> (ShrinkRetries, ShrinkRetries) Source #

divMod :: ShrinkRetries -> ShrinkRetries -> (ShrinkRetries, ShrinkRetries) Source #

toInteger :: ShrinkRetries -> Integer Source #

Real ShrinkRetries Source # |
Instance details Defined in Hedgehog.Internal.Property Methods toRational :: ShrinkRetries -> Rational Source #
Show ShrinkRetries Source # |
Instance details Defined in Hedgehog.Internal.Property Methods showsPrec :: Int -> ShrinkRetries -> ShowS Source # show :: ShrinkRetries -> String Source # showList :: [ShrinkRetries] -> ShowS Source #
Eq ShrinkRetries Source # |
Instance details Defined in Hedgehog.Internal.Property Methods (==) :: ShrinkRetries -> ShrinkRetries -> Bool Source # (/=) :: ShrinkRetries -> ShrinkRetries -> Bool Source #
Ord ShrinkRetries Source # |

Instance details

Defined in Hedgehog.Internal.Property

Methods

compare :: ShrinkRetries -> ShrinkRetries -> Ordering Source #

(<) :: ShrinkRetries -> ShrinkRetries -> Bool Source #

(<=) :: ShrinkRetries -> ShrinkRetries -> Bool Source #

(>) :: ShrinkRetries -> ShrinkRetries -> Bool Source #

(>=) :: ShrinkRetries -> ShrinkRetries -> Bool Source #

max :: ShrinkRetries -> ShrinkRetries -> ShrinkRetries Source #

min :: ShrinkRetries -> ShrinkRetries -> ShrinkRetries Source #

Lift ShrinkRetries Source # |
Instance details Defined in Hedgehog.Internal.Property Methods lift :: Quote m => ShrinkRetries -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => ShrinkRetries -> Code m ShrinkRetries Source #

withSkip :: Skip -> Property -> Property Source #

Set the target that a property will skip to before it starts to run.

data Skip Source #

Where to start running a property's tests.

#### Instances

Instances details

IsString Skip Source #

We use this instance to support usage like

      withSkip "3:aB"

It throws an error if the input is not a valid compressed `Skip`.

Instance details Defined in Hedgehog.Internal.Property Methods fromString :: String -> Skip Source #
Show Skip Source # |
Instance details Defined in Hedgehog.Internal.Property Methods showsPrec :: Int -> Skip -> ShowS Source # show :: Skip -> String Source # showList :: [Skip] -> ShowS Source #
Eq Skip Source # |
Instance details Defined in Hedgehog.Internal.Property Methods (==) :: Skip -> Skip -> Bool Source # (/=) :: Skip -> Skip -> Bool Source #
Ord Skip Source # |
Instance details Defined in Hedgehog.Internal.Property Methods compare :: Skip -> Skip -> Ordering Source # (<) :: Skip -> Skip -> Bool Source # (<=) :: Skip -> Skip -> Bool Source # (>) :: Skip -> Skip -> Bool Source # (>=) :: Skip -> Skip -> Bool Source # max :: Skip -> Skip -> Skip Source # min :: Skip -> Skip -> Skip Source #
Lift Skip Source # |
Instance details Defined in Hedgehog.Internal.Property Methods lift :: Quote m => Skip -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => Skip -> Code m Skip Source #

# Generating Test Data

type Gen = GenT Identity Source #

Generator for random values of `a`.

data GenT (m :: Type -> Type) a Source #

Monad transformer which can generate random values of `a`.

#### Instances

Instances details

MonadTransDistributive GenT Source # |

Instance details

Defined in Hedgehog.Internal.Gen

Associated Types

type Transformer t GenT m |
Instance details Defined in Hedgehog.Internal.Gen type Transformer t GenT m = (Monad (t (GenT m)), Transformer t MaybeT m, Transformer t TreeT (MaybeT m))

Methods

distributeT :: forall f (m :: Type -> Type) a. Transformer f GenT m => GenT (f m) a -> f (GenT m) a Source #

MMonad GenT Source # |
Instance details Defined in Hedgehog.Internal.Gen Methods embed :: forall (n :: Type -> Type) m b. Monad n => (forall a. m a -> GenT n a) -> GenT m b -> GenT n b Source #
MonadTrans GenT Source # |
Instance details Defined in Hedgehog.Internal.Gen Methods lift :: Monad m => m a -> GenT m a Source #
MFunctor GenT Source # |
Instance details Defined in Hedgehog.Internal.Gen Methods hoist :: Monad m => (forall a. m a -> n a) -> GenT m b -> GenT n b Source #
MonadBaseControl b m => MonadBaseControl b (GenT m) Source # |
Instance details Defined in Hedgehog.Internal.Gen Methods liftBaseWith :: (RunInBase (GenT m) b -> b a) -> GenT m a Source # restoreM :: StM (GenT m) a -> GenT m a Source #
MonadError e m => MonadError e (GenT m) Source # |
Instance details Defined in Hedgehog.Internal.Gen Methods throwError :: e -> GenT m a Source # catchError :: GenT m a -> (e -> GenT m a) -> GenT m a Source #
MonadReader r m => MonadReader r (GenT m) Source # |
Instance details Defined in Hedgehog.Internal.Gen Methods ask :: GenT m r Source # local :: (r -> r) -> GenT m a -> GenT m a Source # reader :: (r -> a) -> GenT m a Source #
MonadState s m => MonadState s (GenT m) Source # |
Instance details Defined in Hedgehog.Internal.Gen Methods get :: GenT m s Source # put :: s -> GenT m () Source # state :: (s -> (a, s)) -> GenT m a Source #
MonadWriter w m => MonadWriter w (GenT m) Source # |
Instance details Defined in Hedgehog.Internal.Gen Methods writer :: (a, w) -> GenT m a Source # tell :: w -> GenT m () Source # listen :: GenT m a -> GenT m (a, w) Source # pass :: GenT m (a, w -> w) -> GenT m a Source #
MonadBase b m => MonadBase b (GenT m) Source # |
Instance details Defined in Hedgehog.Internal.Gen Methods liftBase :: b α -> GenT m α Source #
MonadIO m => MonadIO (GenT m) Source # |
Instance details Defined in Hedgehog.Internal.Gen Methods liftIO :: IO a -> GenT m a Source #
MonadCatch m => MonadCatch (GenT m) Source # |
Instance details Defined in Hedgehog.Internal.Gen Methods catch :: (HasCallStack, Exception e) => GenT m a -> (e -> GenT m a) -> GenT m a Source #
MonadThrow m => MonadThrow (GenT m) Source # |
Instance details Defined in Hedgehog.Internal.Gen Methods throwM :: (HasCallStack, Exception e) => e -> GenT m a Source #
Monad m => Alternative (GenT m) Source # |
Instance details Defined in Hedgehog.Internal.Gen Methods empty :: GenT m a Source # (<|>) :: GenT m a -> GenT m a -> GenT m a Source # some :: GenT m a -> GenT m [a] Source # many :: GenT m a -> GenT m [a] Source #
Monad m => Applicative (GenT m) Source # |
Instance details Defined in Hedgehog.Internal.Gen Methods pure :: a -> GenT m a Source # (<*>) :: GenT m (a -> b) -> GenT m a -> GenT m b Source # liftA2 :: (a -> b -> c) -> GenT m a -> GenT m b -> GenT m c Source # (*>) :: GenT m a -> GenT m b -> GenT m b Source # (<*) :: GenT m a -> GenT m b -> GenT m a Source #
Functor m => Functor (GenT m) Source # |
Instance details Defined in Hedgehog.Internal.Gen Methods fmap :: (a -> b) -> GenT m a -> GenT m b Source # (<$) :: a -> GenT m b -> GenT m a Source #
Monad m => Monad (GenT m) Source # |
Instance details Defined in Hedgehog.Internal.Gen Methods (>>=) :: GenT m a -> (a -> GenT m b) -> GenT m b Source # (>>) :: GenT m a -> GenT m b -> GenT m b Source # return :: a -> GenT m a Source #
Monad m => MonadPlus (GenT m) Source # |
Instance details Defined in Hedgehog.Internal.Gen Methods mzero :: GenT m a Source # mplus :: GenT m a -> GenT m a -> GenT m a Source #
Monad m => MonadFail (GenT m) Source # |
Instance details Defined in Hedgehog.Internal.Gen Methods fail :: String -> GenT m a Source #
Monad m => MonadGen (GenT m) Source # |

Instance details

Defined in Hedgehog.Internal.Gen

Associated Types

type GenBase (GenT m) |
Instance details Defined in Hedgehog.Internal.Gen type GenBase (GenT m) = m

Methods

toGenT :: GenT m a -> GenT (GenBase (GenT m)) a Source #

fromGenT :: GenT (GenBase (GenT m)) a -> GenT m a Source #

PrimMonad m => PrimMonad (GenT m) Source # |

Instance details

Defined in Hedgehog.Internal.Gen

Associated Types

type PrimState (GenT m) |
Instance details Defined in Hedgehog.Internal.Gen type PrimState (GenT m) = PrimState m

Methods

primitive :: (State# (PrimState (GenT m)) -> (# State# (PrimState (GenT m)), a #)) -> GenT m a Source #

MonadResource m => MonadResource (GenT m) Source # |
Instance details Defined in Hedgehog.Internal.Gen Methods liftResourceT :: ResourceT IO a -> GenT m a Source #
(Monad m, Monoid a) => Monoid (GenT m a) Source # |
Instance details Defined in Hedgehog.Internal.Gen Methods mempty :: GenT m a Source # mappend :: GenT m a -> GenT m a -> GenT m a Source # mconcat :: [GenT m a] -> GenT m a Source #
(Monad m, Semigroup a) => Semigroup (GenT m a) Source # |
Instance details Defined in Hedgehog.Internal.Gen Methods (<>) :: GenT m a -> GenT m a -> GenT m a Source # sconcat :: NonEmpty (GenT m a) -> GenT m a Source # stimes :: Integral b => b -> GenT m a -> GenT m a Source #
type Transformer t GenT m Source # |
Instance details Defined in Hedgehog.Internal.Gen type Transformer t GenT m = (Monad (t (GenT m)), Transformer t MaybeT m, Transformer t TreeT (MaybeT m))
type GenBase (GenT m) Source # |
Instance details Defined in Hedgehog.Internal.Gen type GenBase (GenT m) = m
type PrimState (GenT m) Source # |
Instance details Defined in Hedgehog.Internal.Gen type PrimState (GenT m) = PrimState m
type StM (GenT m) a Source # |
Instance details Defined in Hedgehog.Internal.Gen type StM (GenT m) a = StM (ReaderT Size (ReaderT Seed (TreeT (MaybeT m)))) a

class (Monad m, Monad (GenBase m)) => MonadGen (m :: Type -> Type) where Source #

Class of monads which can generate input data for tests.

Associated Types

type GenBase (m :: Type -> Type) :: Type -> Type Source #

Methods

toGenT :: m a -> GenT (GenBase m) a Source #

Extract a `GenT` from a `MonadGen`.

fromGenT :: GenT (GenBase m) a -> m a Source #

Lift a `GenT` in to a `MonadGen`.

#### Instances

Instances details

Monad m => MonadGen (GenT m) Source # |

Instance details

Defined in Hedgehog.Internal.Gen

Associated Types

type GenBase (GenT m) |
Instance details Defined in Hedgehog.Internal.Gen type GenBase (GenT m) = m

Methods

toGenT :: GenT m a -> GenT (GenBase (GenT m)) a Source #

fromGenT :: GenT (GenBase (GenT m)) a -> GenT m a Source #

MonadGen m => MonadGen (MaybeT m) Source # |

Instance details

Defined in Hedgehog.Internal.Gen

Associated Types

type GenBase (MaybeT m) |
Instance details Defined in Hedgehog.Internal.Gen type GenBase (MaybeT m) = MaybeT (GenBase m)

Methods

toGenT :: MaybeT m a -> GenT (GenBase (MaybeT m)) a Source #

fromGenT :: GenT (GenBase (MaybeT m)) a -> MaybeT m a Source #

MonadGen m => MonadGen (ExceptT x m) Source # |

Instance details

Defined in Hedgehog.Internal.Gen

Associated Types

type GenBase (ExceptT x m) |
Instance details Defined in Hedgehog.Internal.Gen type GenBase (ExceptT x m) = ExceptT x (GenBase m)

Methods

toGenT :: ExceptT x m a -> GenT (GenBase (ExceptT x m)) a Source #

fromGenT :: GenT (GenBase (ExceptT x m)) a -> ExceptT x m a Source #

MonadGen m => MonadGen (IdentityT m) Source # |

Instance details

Defined in Hedgehog.Internal.Gen

Associated Types

type GenBase (IdentityT m) |
Instance details Defined in Hedgehog.Internal.Gen type GenBase (IdentityT m) = IdentityT (GenBase m)

Methods

toGenT :: IdentityT m a -> GenT (GenBase (IdentityT m)) a Source #

fromGenT :: GenT (GenBase (IdentityT m)) a -> IdentityT m a Source #

MonadGen m => MonadGen (ReaderT r m) Source # |

Instance details

Defined in Hedgehog.Internal.Gen

Associated Types

type GenBase (ReaderT r m) |
Instance details Defined in Hedgehog.Internal.Gen type GenBase (ReaderT r m) = ReaderT r (GenBase m)

Methods

toGenT :: ReaderT r m a -> GenT (GenBase (ReaderT r m)) a Source #

fromGenT :: GenT (GenBase (ReaderT r m)) a -> ReaderT r m a Source #

MonadGen m => MonadGen (StateT r m) Source # |

Instance details

Defined in Hedgehog.Internal.Gen

Associated Types

type GenBase (StateT r m) |
Instance details Defined in Hedgehog.Internal.Gen type GenBase (StateT r m) = StateT r (GenBase m)

Methods

toGenT :: StateT r m a -> GenT (GenBase (StateT r m)) a Source #

fromGenT :: GenT (GenBase (StateT r m)) a -> StateT r m a Source #

MonadGen m => MonadGen (StateT r m) Source # |

Instance details

Defined in Hedgehog.Internal.Gen

Associated Types

type GenBase (StateT r m) |
Instance details Defined in Hedgehog.Internal.Gen type GenBase (StateT r m) = StateT r (GenBase m)

Methods

toGenT :: StateT r m a -> GenT (GenBase (StateT r m)) a Source #

fromGenT :: GenT (GenBase (StateT r m)) a -> StateT r m a Source #

(MonadGen m, Monoid w) => MonadGen (WriterT w m) Source # |

Instance details

Defined in Hedgehog.Internal.Gen

Associated Types

type GenBase (WriterT w m) |
Instance details Defined in Hedgehog.Internal.Gen type GenBase (WriterT w m) = WriterT w (GenBase m)

Methods

toGenT :: WriterT w m a -> GenT (GenBase (WriterT w m)) a Source #

fromGenT :: GenT (GenBase (WriterT w m)) a -> WriterT w m a Source #

(MonadGen m, Monoid w) => MonadGen (WriterT w m) Source # |

Instance details

Defined in Hedgehog.Internal.Gen

Associated Types

type GenBase (WriterT w m) |
Instance details Defined in Hedgehog.Internal.Gen type GenBase (WriterT w m) = WriterT w (GenBase m)

Methods

toGenT :: WriterT w m a -> GenT (GenBase (WriterT w m)) a Source #

fromGenT :: GenT (GenBase (WriterT w m)) a -> WriterT w m a Source #

data Range a Source #

A range describes the bounds of a number to generate, which may or may not be dependent on a `Size`.

The constructor takes an origin between the lower and upper bound, and a function from `Size` to bounds. As the size goes towards `0`, the values go towards the origin.

#### Instances

Instances details

Functor Range Source # |
Instance details Defined in Hedgehog.Internal.Range Methods fmap :: (a -> b) -> Range a -> Range b Source # (<$) :: a -> Range b -> Range a Source #

newtype Size Source #

Tests are parameterized by the size of the randomly-generated data. The meaning of a `Size` value depends on the particular generator used, but it must always be a number between 0 and 99 inclusive.

Constructors

Size |

Fields

- unSize :: Int

#### Instances

Instances details

Enum Size Source # |
Instance details Defined in Hedgehog.Internal.Range Methods succ :: Size -> Size Source # pred :: Size -> Size Source # toEnum :: Int -> Size Source # fromEnum :: Size -> Int Source # enumFrom :: Size -> [Size] Source # enumFromThen :: Size -> Size -> [Size] Source # enumFromTo :: Size -> Size -> [Size] Source # enumFromThenTo :: Size -> Size -> Size -> [Size] Source #
Num Size Source # |
Instance details Defined in Hedgehog.Internal.Range Methods (+) :: Size -> Size -> Size Source # (-) :: Size -> Size -> Size Source # (*) :: Size -> Size -> Size Source # negate :: Size -> Size Source # abs :: Size -> Size Source # signum :: Size -> Size Source # fromInteger :: Integer -> Size Source #
Read Size Source # |
Instance details Defined in Hedgehog.Internal.Range Methods readsPrec :: Int -> ReadS Size Source # readList :: ReadS [Size] Source # readPrec :: ReadPrec Size Source # readListPrec :: ReadPrec [Size] Source #
Integral Size Source # |
Instance details Defined in Hedgehog.Internal.Range Methods quot :: Size -> Size -> Size Source # rem :: Size -> Size -> Size Source # div :: Size -> Size -> Size Source # mod :: Size -> Size -> Size Source # quotRem :: Size -> Size -> (Size, Size) Source # divMod :: Size -> Size -> (Size, Size) Source # toInteger :: Size -> Integer Source #
Real Size Source # |
Instance details Defined in Hedgehog.Internal.Range Methods toRational :: Size -> Rational Source #
Show Size Source # |
Instance details Defined in Hedgehog.Internal.Range Methods showsPrec :: Int -> Size -> ShowS Source # show :: Size -> String Source # showList :: [Size] -> ShowS Source #
Eq Size Source # |
Instance details Defined in Hedgehog.Internal.Range Methods (==) :: Size -> Size -> Bool Source # (/=) :: Size -> Size -> Bool Source #
Ord Size Source # |
Instance details Defined in Hedgehog.Internal.Range Methods compare :: Size -> Size -> Ordering Source # (<) :: Size -> Size -> Bool Source # (<=) :: Size -> Size -> Bool Source # (>) :: Size -> Size -> Bool Source # (>=) :: Size -> Size -> Bool Source # max :: Size -> Size -> Size Source # min :: Size -> Size -> Size Source #

data Seed Source #

A splittable random number generator.

Constructors

Seed |

Fields

- seedValue :: !Word64
- seedGamma :: !Word64

  must be an odd number

#### Instances

Instances details

Read Seed Source # |
Instance details Defined in Hedgehog.Internal.Seed Methods readsPrec :: Int -> ReadS Seed Source # readList :: ReadS [Seed] Source # readPrec :: ReadPrec Seed Source # readListPrec :: ReadPrec [Seed] Source #
Show Seed Source # |
Instance details Defined in Hedgehog.Internal.Seed Methods showsPrec :: Int -> Seed -> ShowS Source # show :: Seed -> String Source # showList :: [Seed] -> ShowS Source #
Eq Seed Source # |
Instance details Defined in Hedgehog.Internal.Seed Methods (==) :: Seed -> Seed -> Bool Source # (/=) :: Seed -> Seed -> Bool Source #
Ord Seed Source # |
Instance details Defined in Hedgehog.Internal.Seed Methods compare :: Seed -> Seed -> Ordering Source # (<) :: Seed -> Seed -> Bool Source # (<=) :: Seed -> Seed -> Bool Source # (>) :: Seed -> Seed -> Bool Source # (>=) :: Seed -> Seed -> Bool Source # max :: Seed -> Seed -> Seed Source # min :: Seed -> Seed -> Seed Source #
RandomGen Seed Source # |

Instance details

Defined in Hedgehog.Internal.Seed

Methods

next :: Seed -> (Int, Seed) Source #

genWord8 :: Seed -> (Word8, Seed) Source #

genWord16 :: Seed -> (Word16, Seed) Source #

genWord32 :: Seed -> (Word32, Seed) Source #

genWord64 :: Seed -> (Word64, Seed) Source #

genWord32R :: Word32 -> Seed -> (Word32, Seed) Source #

genWord64R :: Word64 -> Seed -> (Word64, Seed) Source #

genShortByteString :: Int -> Seed -> (ShortByteString, Seed) Source #

genRange :: Seed -> (Int, Int) Source #

split :: Seed -> (Seed, Seed) Source #

Lift Seed Source # |
Instance details Defined in Hedgehog.Internal.Seed Methods lift :: Quote m => Seed -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => Seed -> Code m Seed Source #

# Tests

type Test = TestT Identity Source #

A test monad allows the assertion of expectations.

data TestT (m :: Type -> Type) a Source #

A test monad transformer allows the assertion of expectations.

#### Instances

Instances details

MonadTransDistributive TestT Source # |

Instance details

Defined in Hedgehog.Internal.Property

Associated Types

type Transformer t TestT m |
Instance details Defined in Hedgehog.Internal.Property type Transformer t TestT m = (Transformer t (WriterT Journal) m, Transformer t (ExceptT Failure) (WriterT Journal m))

Methods

distributeT :: forall f (m :: Type -> Type) a. Transformer f TestT m => TestT (f m) a -> f (TestT m) a Source #

MonadTransControl TestT Source # |

Instance details

Defined in Hedgehog.Internal.Property

Associated Types

type StT TestT a |
Instance details Defined in Hedgehog.Internal.Property type StT TestT a = (Either Failure a, Journal)

Methods

liftWith :: Monad m => (Run TestT -> m a) -> TestT m a Source #

restoreT :: Monad m => m (StT TestT a) -> TestT m a Source #

MonadTrans TestT Source # |
Instance details Defined in Hedgehog.Internal.Property Methods lift :: Monad m => m a -> TestT m a Source #
MFunctor TestT Source # |
Instance details Defined in Hedgehog.Internal.Property Methods hoist :: Monad m => (forall a. m a -> n a) -> TestT m b -> TestT n b Source #
MonadBaseControl b m => MonadBaseControl b (TestT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods liftBaseWith :: (RunInBase (TestT m) b -> b a) -> TestT m a Source # restoreM :: StM (TestT m) a -> TestT m a Source #
MonadError e m => MonadError e (TestT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods throwError :: e -> TestT m a Source # catchError :: TestT m a -> (e -> TestT m a) -> TestT m a Source #
MonadReader r m => MonadReader r (TestT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods ask :: TestT m r Source # local :: (r -> r) -> TestT m a -> TestT m a Source # reader :: (r -> a) -> TestT m a Source #
MonadState s m => MonadState s (TestT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods get :: TestT m s Source # put :: s -> TestT m () Source # state :: (s -> (a, s)) -> TestT m a Source #
MonadBase b m => MonadBase b (TestT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods liftBase :: b α -> TestT m α Source #
MonadIO m => MonadIO (TestT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods liftIO :: IO a -> TestT m a Source #
MonadCatch m => MonadCatch (TestT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods catch :: (HasCallStack, Exception e) => TestT m a -> (e -> TestT m a) -> TestT m a Source #
MonadThrow m => MonadThrow (TestT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods throwM :: (HasCallStack, Exception e) => e -> TestT m a Source #
Monad m => Applicative (TestT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods pure :: a -> TestT m a Source # (<*>) :: TestT m (a -> b) -> TestT m a -> TestT m b Source # liftA2 :: (a -> b -> c) -> TestT m a -> TestT m b -> TestT m c Source # (*>) :: TestT m a -> TestT m b -> TestT m b Source # (<*) :: TestT m a -> TestT m b -> TestT m a Source #
Functor m => Functor (TestT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods fmap :: (a -> b) -> TestT m a -> TestT m b Source # (<$) :: a -> TestT m b -> TestT m a Source #
Monad m => Monad (TestT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods (>>=) :: TestT m a -> (a -> TestT m b) -> TestT m b Source # (>>) :: TestT m a -> TestT m b -> TestT m b Source # return :: a -> TestT m a Source #
Monad m => MonadFail (TestT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods fail :: String -> TestT m a Source #
Monad m => MonadTest (TestT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods liftTest :: Test a -> TestT m a Source #
PrimMonad m => PrimMonad (TestT m) Source # |

Instance details

Defined in Hedgehog.Internal.Property

Associated Types

type PrimState (TestT m) |
Instance details Defined in Hedgehog.Internal.Property type PrimState (TestT m) = PrimState m

Methods

primitive :: (State# (PrimState (TestT m)) -> (# State# (PrimState (TestT m)), a #)) -> TestT m a Source #

MonadResource m => MonadResource (TestT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods liftResourceT :: ResourceT IO a -> TestT m a Source #
type StT TestT a Source # |
Instance details Defined in Hedgehog.Internal.Property type StT TestT a = (Either Failure a, Journal)
type Transformer t TestT m Source # |
Instance details Defined in Hedgehog.Internal.Property type Transformer t TestT m = (Transformer t (WriterT Journal) m, Transformer t (ExceptT Failure) (WriterT Journal m))
type PrimState (TestT m) Source # |
Instance details Defined in Hedgehog.Internal.Property type PrimState (TestT m) = PrimState m
type StM (TestT m) a Source # |
Instance details Defined in Hedgehog.Internal.Property type StM (TestT m) a = ComposeSt TestT m a

class Monad m => MonadTest (m :: Type -> Type) where Source #

Methods

liftTest :: Test a -> m a Source #

#### Instances

Instances details

Monad m => MonadTest (PropertyT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods liftTest :: Test a -> PropertyT m a Source #
Monad m => MonadTest (TestT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods liftTest :: Test a -> TestT m a Source #
MonadTest m => MonadTest (ResourceT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods liftTest :: Test a -> ResourceT m a Source #
MonadTest m => MonadTest (MaybeT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods liftTest :: Test a -> MaybeT m a Source #
MonadTest m => MonadTest (ExceptT x m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods liftTest :: Test a -> ExceptT x m a Source #
MonadTest m => MonadTest (IdentityT m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods liftTest :: Test a -> IdentityT m a Source #
MonadTest m => MonadTest (ReaderT r m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods liftTest :: Test a -> ReaderT r m a Source #
MonadTest m => MonadTest (StateT s m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods liftTest :: Test a -> StateT s m a Source #
MonadTest m => MonadTest (StateT s m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods liftTest :: Test a -> StateT s m a Source #
(MonadTest m, Monoid w) => MonadTest (WriterT w m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods liftTest :: Test a -> WriterT w m a Source #
(MonadTest m, Monoid w) => MonadTest (WriterT w m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods liftTest :: Test a -> WriterT w m a Source #
MonadTest m => MonadTest (ContT r m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods liftTest :: Test a -> ContT r m a Source #
(MonadTest m, Monoid w) => MonadTest (RWST r w s m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods liftTest :: Test a -> RWST r w s m a Source #
(MonadTest m, Monoid w) => MonadTest (RWST r w s m) Source # |
Instance details Defined in Hedgehog.Internal.Property Methods liftTest :: Test a -> RWST r w s m a Source #

annotate :: (MonadTest m, HasCallStack) => String -> m () Source #

Annotates the source code with a message that might be useful for debugging a test failure.

annotateShow :: (MonadTest m, Show a, HasCallStack) => a -> m () Source #

Annotates the source code with a value that might be useful for debugging a test failure.

footnote :: MonadTest m => String -> m () Source #

Logs a message to be displayed as additional information in the footer of the failure report.

footnoteShow :: (MonadTest m, Show a) => a -> m () Source #

Logs a value to be displayed as additional information in the footer of the failure report.

success :: MonadTest m => m () Source #

Another name for `pure ()`.

failure :: (MonadTest m, HasCallStack) => m a Source #

Causes a test to fail.

assert :: (MonadTest m, HasCallStack) => Bool -> m () Source #

Fails the test if the condition provided is `False`.

diff :: (MonadTest m, Show a, Show b, HasCallStack) => a -> (a -> b -> Bool) -> b -> m () Source #

Fails the test and shows a git-like diff if the comparison operation evaluates to `False` when applied to its arguments.

The comparison function is the second argument, which may be counter-intuitive to Haskell programmers. However, it allows operators to be written infix for easy reading:

      diff y (<) 87
      diff x (<=) r

This function behaves like the unix `diff` tool, which gives a 0 exit code if the compared files are identical, or a 1 exit code code otherwise. Like unix `diff`, if the arguments fail the comparison, a /diff is shown.

(===) :: (MonadTest m, Eq a, Show a, HasCallStack) => a -> a -> m () infix 4 Source #

Fails the test if the two arguments provided are not equal.

(/==) :: (MonadTest m, Eq a, Show a, HasCallStack) => a -> a -> m () infix 4 Source #

Fails the test if the two arguments provided are equal.

tripping :: (MonadTest m, Applicative f, Show b, Show (f a), Eq (f a), HasCallStack) => a -> (a -> b) -> (b -> f a) -> m () Source #

Test that a pair of encode / decode functions are compatible.

Given a printer from some type `a -> b`, and a parser with a potential failure case `b -> f a`. Ensure that a valid `a` round trips through the "print" and "parse" to yield the same `a`.

For example, types should have tripping `Read` and `Show` instances:

    trippingShowRead :: (Show a, Read a, Eq a, MonadTest m) => a -> m ()
    trippingShowRead a = tripping a show readEither

eval :: (MonadTest m, HasCallStack) => a -> m a Source #

Fails the test if the value throws an exception when evaluated to weak head normal form (WHNF).

evalNF :: (MonadTest m, NFData a, HasCallStack) => a -> m a Source #

Fails the test if the value throws an exception when evaluated to normal form (NF).

evalM :: (MonadTest m, MonadCatch m, HasCallStack) => m a -> m a Source #

Fails the test if the action throws an exception.

The benefit of using this over simply letting the exception bubble up is that the location of the closest `evalM` will be shown in the output.

evalIO :: (MonadTest m, MonadIO m, HasCallStack) => IO a -> m a Source #

Fails the test if the `IO` action throws an exception.

The benefit of using this over `liftIO` is that the location of the exception will be shown in the output.

evalEither :: (MonadTest m, Show x, HasCallStack) => Either x a -> m a Source #

Fails the test if the `Either` is `Left`, otherwise returns the value in the `Right`.

evalEitherM :: (MonadTest m, Show x, MonadCatch m, HasCallStack) => m (Either x a) -> m a Source #

Fails the test if the action throws an exception, or if the `Either` is `Left`, otherwise returns the value in the `Right`.

evalExceptT :: (MonadTest m, Show x, HasCallStack) => ExceptT x m a -> m a Source #

Fails the test if the `ExceptT` is `Left`, otherwise returns the value in the `Right`.

evalMaybe :: (MonadTest m, HasCallStack) => Maybe a -> m a Source #

Fails the test if the `Maybe` is `Nothing`, otherwise returns the value in the `Just`.

evalMaybeM :: (MonadTest m, MonadCatch m, HasCallStack) => m (Maybe a) -> m a Source #

Fails the test if the action throws an exception, or if the `Maybe` is `Nothing`, otherwise returns the value in the `Just`.

# Coverage

data LabelName Source #

The name of a classifier.

Should be constructed using `OverloadedStrings`:

      "apples" :: LabelName

#### Instances

Instances details

Monoid LabelName Source # |
Instance details Defined in Hedgehog.Internal.Property Methods mempty :: LabelName Source # mappend :: LabelName -> LabelName -> LabelName Source # mconcat :: [LabelName] -> LabelName Source #
Semigroup LabelName Source # |
Instance details Defined in Hedgehog.Internal.Property Methods (<>) :: LabelName -> LabelName -> LabelName Source # sconcat :: NonEmpty LabelName -> LabelName Source # stimes :: Integral b => b -> LabelName -> LabelName Source #
IsString LabelName Source # |
Instance details Defined in Hedgehog.Internal.Property Methods fromString :: String -> LabelName Source #
Show LabelName Source # |
Instance details Defined in Hedgehog.Internal.Property Methods showsPrec :: Int -> LabelName -> ShowS Source # show :: LabelName -> String Source # showList :: [LabelName] -> ShowS Source #
Eq LabelName Source # |
Instance details Defined in Hedgehog.Internal.Property Methods (==) :: LabelName -> LabelName -> Bool Source # (/=) :: LabelName -> LabelName -> Bool Source #
Ord LabelName Source # |

Instance details

Defined in Hedgehog.Internal.Property

Methods

compare :: LabelName -> LabelName -> Ordering Source #

(<) :: LabelName -> LabelName -> Bool Source #

(<=) :: LabelName -> LabelName -> Bool Source #

(>) :: LabelName -> LabelName -> Bool Source #

(>=) :: LabelName -> LabelName -> Bool Source #

max :: LabelName -> LabelName -> LabelName Source #

min :: LabelName -> LabelName -> LabelName Source #

classify :: (MonadTest m, HasCallStack) => LabelName -> Bool -> m () Source #

Records the proportion of tests which satisfy a given condition.

       prop_with_classifier :: Property
       prop_with_classifier =
         property $ do
           xs <- forAll $ Gen.list (Range.linear 0 100) Gen.alpha
           for_ xs $ \x -> do
             classify "newborns" $ x == 0
             classify "children" $ x > 0 && x < 13
             classify "teens" $ x > 12 && x < 20

cover :: (MonadTest m, HasCallStack) => CoverPercentage -> LabelName -> Bool -> m () Source #

Require a certain percentage of the tests to be covered by the classifier.

       prop_with_coverage :: Property
       prop_with_coverage =
         property $ do
           match <- forAll Gen.bool
           cover 30 "True" $ match
           cover 30 "False" $ not match

The example above requires a minimum of 30% coverage for both classifiers. If these requirements are not met, it will fail the test.

label :: (MonadTest m, HasCallStack) => LabelName -> m () Source #

Add a label for each test run. It produces a table showing the percentage of test runs that produced each label.

collect :: (MonadTest m, Show a, HasCallStack) => a -> m () Source #

Like `label`, but uses `Show` to render its argument for display.

# State Machine Tests

data Command (gen :: Type -> Type) (m :: Type -> Type) (state :: (Type -> Type) -> Type) Source #

The specification for the expected behaviour of an `Action`. These are used to generate sequences of actions to test.

This is the main type you will use when writing state machine tests. `gen` is usually an instance of `MonadGen`, and `m` is usually an instance of `MonadTest`. These constraints appear when you pass your `Command` list to `sequential` or `parallel`.

Constructors

(TraversableB input, Show (input Symbolic), Show output, Typeable output) => Command |

Fields

- commandGen :: state Symbolic -> Maybe (gen (input Symbolic))

  A generator which provides random arguments for a command. If the command cannot be executed in the current state, it should return `Nothing`.

- commandExecute :: input Concrete -> m output

  Executes a command using the arguments generated by `commandGen`.

- commandCallbacks :: [Callback input output state]

  A set of callbacks which provide optional command configuration such as pre-condtions, post-conditions and state updates.

data Callback (input :: (Type -> Type) -> Type) output (state :: (Type -> Type) -> Type) Source #

Optional command configuration.

Constructors

Require (state Symbolic -> input Symbolic -> Bool) | A pre-condition for a command that must be verified before the command can be executed. This is mainly used during shrinking to ensure that it is still OK to run a command despite the fact that some previously executed commands may have been removed from the sequence.
Update (forall (v :: Type -> Type). Ord1 v => state v -> input v -> Var output v -> state v) | Updates the model state, given the input and output of the command. Note that this function is polymorphic in the type of values. This is because it must work over `Symbolic` values when we are generating actions, and `Concrete` values when we are executing them.
Ensure (state Concrete -> state Concrete -> input Concrete -> output -> Test ()) | A post-condition for a command that must be verified for the command to be considered a success. This callback receives the state prior to execution as the first argument, and the state after execution as the second argument.

data Action (m :: Type -> Type) (state :: (Type -> Type) -> Type) Source #

An instantiation of a `Command` which can be executed, and its effect evaluated.

#### Instances

Instances details

Show (Action m state) Source # |
Instance details Defined in Hedgehog.Internal.State Methods showsPrec :: Int -> Action m state -> ShowS Source # show :: Action m state -> String Source # showList :: [Action m state] -> ShowS Source #

newtype Sequential (m :: Type -> Type) (state :: (Type -> Type) -> Type) Source #

A sequence of actions to execute.

Constructors

Sequential |

Fields

- sequentialActions :: [Action m state]

  The sequence of actions.

#### Instances

Instances details

Show (Sequential m state) Source # |
Instance details Defined in Hedgehog.Internal.State Methods showsPrec :: Int -> Sequential m state -> ShowS Source # show :: Sequential m state -> String Source # showList :: [Sequential m state] -> ShowS Source #

data Parallel (m :: Type -> Type) (state :: (Type -> Type) -> Type) Source #

A sequential prefix of actions to execute, with two branches to execute in parallel.

Constructors

Parallel |

Fields

- parallelPrefix :: [Action m state]

  The sequential prefix.

- parallelBranch1 :: [Action m state]

  The first branch.

- parallelBranch2 :: [Action m state]

  The second branch.

#### Instances

Instances details

Show (Parallel m state) Source # |
Instance details Defined in Hedgehog.Internal.State Methods showsPrec :: Int -> Parallel m state -> ShowS Source # show :: Parallel m state -> String Source # showList :: [Parallel m state] -> ShowS Source #

executeSequential :: (MonadTest m, MonadCatch m, HasCallStack) => (forall (v :: Type -> Type). state v) -> Sequential m state -> m () Source #

Executes a list of actions sequentially, verifying that all post-conditions are met and no exceptions are thrown.

To generate a sequence of actions to execute, see the `sequential` combinator in the Hedgehog.Gen module.

executeParallel :: (MonadTest m, MonadCatch m, MonadBaseControl IO m, HasCallStack) => (forall (v :: Type -> Type). state v) -> Parallel m state -> m () Source #

Executes the prefix actions sequentially, then executes the two branches in parallel, verifying that no exceptions are thrown and that there is at least one sequential interleaving where all the post-conditions are met.

To generate parallel actions to execute, see the `parallel` combinator in the Hedgehog.Gen module.

newtype Var a (v :: Type -> Type) Source #

Variables are the potential or actual result of executing an action. They are parameterised by either `Symbolic` or `Concrete` depending on the phase of the test.

`Symbolic` variables are the potential results of actions. These are used when generating the sequence of actions to execute. They allow actions which occur later in the sequence to make use of the result of an action which came earlier in the sequence.

`Concrete` variables are the actual results of actions. These are used during test execution. They provide access to the actual runtime value of a variable.

The state update `Callback` for a command needs to be polymorphic in the type of variable because it is used in both the generation and the execution phase.

The order of arguments makes `Var` `FunctorB` and `TraversableB`, which is how `Symbolic` values are turned into `Concrete` ones.

Constructors

Var (v a) |

#### Instances

Instances details

FunctorB (Var a :: (Type -> Type) -> Type) Source # |
Instance details Defined in Hedgehog.Internal.State Methods bmap :: (forall a0. f a0 -> g a0) -> Var a f -> Var a g Source #
TraversableB (Var a :: (Type -> Type) -> Type) Source # |
Instance details Defined in Hedgehog.Internal.State Methods btraverse :: Applicative e => (forall a0. f a0 -> e (g a0)) -> Var a f -> e (Var a g) Source #
(Show a, Show1 v) => Show (Var a v) Source # |
Instance details Defined in Hedgehog.Internal.State Methods showsPrec :: Int -> Var a v -> ShowS Source # show :: Var a v -> String Source # showList :: [Var a v] -> ShowS Source #
(Eq a, Eq1 v) => Eq (Var a v) Source # |
Instance details Defined in Hedgehog.Internal.State Methods (==) :: Var a v -> Var a v -> Bool Source # (/=) :: Var a v -> Var a v -> Bool Source #
(Ord a, Ord1 v) => Ord (Var a v) Source # |
Instance details Defined in Hedgehog.Internal.State Methods compare :: Var a v -> Var a v -> Ordering Source # (<) :: Var a v -> Var a v -> Bool Source # (<=) :: Var a v -> Var a v -> Bool Source # (>) :: Var a v -> Var a v -> Bool Source # (>=) :: Var a v -> Var a v -> Bool Source # max :: Var a v -> Var a v -> Var a v Source # min :: Var a v -> Var a v -> Var a v Source #

concrete :: Var a Concrete -> a Source #

Take the value from a concrete variable.

opaque :: Var (Opaque a) Concrete -> a Source #

Take the value from an opaque concrete variable.

data Symbolic a Source #

Symbolic values: Because hedgehog generates actions in a separate phase before execution, you will sometimes need to refer to the result of a previous action in a generator without knowing the value of the result (e.g., to get the ID of a previously-created user).

Symbolic variables provide a token to stand in for the actual variables at generation time (and in `Require`/`Update` callbacks). At execution time, real values are available, so your execute actions work on `Concrete` variables.

See also: `Command`, `Var`

#### Instances

Instances details

Eq1 Symbolic Source # |
Instance details Defined in Hedgehog.Internal.State Methods liftEq :: (a -> b -> Bool) -> Symbolic a -> Symbolic b -> Bool Source #
Ord1 Symbolic Source # |
Instance details Defined in Hedgehog.Internal.State Methods liftCompare :: (a -> b -> Ordering) -> Symbolic a -> Symbolic b -> Ordering Source #
Show1 Symbolic Source # |
Instance details Defined in Hedgehog.Internal.State Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Symbolic a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Symbolic a] -> ShowS Source #
Show (Symbolic a) Source # |
Instance details Defined in Hedgehog.Internal.State Methods showsPrec :: Int -> Symbolic a -> ShowS Source # show :: Symbolic a -> String Source # showList :: [Symbolic a] -> ShowS Source #
Eq (Symbolic a) Source # |
Instance details Defined in Hedgehog.Internal.State Methods (==) :: Symbolic a -> Symbolic a -> Bool Source # (/=) :: Symbolic a -> Symbolic a -> Bool Source #
Ord (Symbolic a) Source # |

Instance details

Defined in Hedgehog.Internal.State

Methods

compare :: Symbolic a -> Symbolic a -> Ordering Source #

(<) :: Symbolic a -> Symbolic a -> Bool Source #

(<=) :: Symbolic a -> Symbolic a -> Bool Source #

(>) :: Symbolic a -> Symbolic a -> Bool Source #

(>=) :: Symbolic a -> Symbolic a -> Bool Source #

max :: Symbolic a -> Symbolic a -> Symbolic a Source #

min :: Symbolic a -> Symbolic a -> Symbolic a Source #

newtype Concrete a where Source #

Concrete values: At test-execution time, `Symbolic` values from generation are replaced with `Concrete` values from performing actions. This type gives us something of the same kind as `Symbolic` to pass as a type argument to `Var`.

Constructors

Concrete :: forall a. a -> Concrete a |

#### Instances

Instances details

Eq1 Concrete Source # |
Instance details Defined in Hedgehog.Internal.State Methods liftEq :: (a -> b -> Bool) -> Concrete a -> Concrete b -> Bool Source #
Ord1 Concrete Source # |
Instance details Defined in Hedgehog.Internal.State Methods liftCompare :: (a -> b -> Ordering) -> Concrete a -> Concrete b -> Ordering Source #
Show1 Concrete Source # |
Instance details Defined in Hedgehog.Internal.State Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Concrete a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Concrete a] -> ShowS Source #
Functor Concrete Source # |
Instance details Defined in Hedgehog.Internal.State Methods fmap :: (a -> b) -> Concrete a -> Concrete b Source # (<$) :: a -> Concrete b -> Concrete a Source #
Foldable Concrete Source # |

Instance details

Defined in Hedgehog.Internal.State

Methods

fold :: Monoid m => Concrete m -> m Source #

foldMap :: Monoid m => (a -> m) -> Concrete a -> m Source #

foldMap' :: Monoid m => (a -> m) -> Concrete a -> m Source #

foldr :: (a -> b -> b) -> b -> Concrete a -> b Source #

foldr' :: (a -> b -> b) -> b -> Concrete a -> b Source #

foldl :: (b -> a -> b) -> b -> Concrete a -> b Source #

foldl' :: (b -> a -> b) -> b -> Concrete a -> b Source #

foldr1 :: (a -> a -> a) -> Concrete a -> a Source #

foldl1 :: (a -> a -> a) -> Concrete a -> a Source #

toList :: Concrete a -> [a] Source #

null :: Concrete a -> Bool Source #

length :: Concrete a -> Int Source #

elem :: Eq a => a -> Concrete a -> Bool Source #

maximum :: Ord a => Concrete a -> a Source #

minimum :: Ord a => Concrete a -> a Source #

sum :: Num a => Concrete a -> a Source #

product :: Num a => Concrete a -> a Source #

Traversable Concrete Source # |
Instance details Defined in Hedgehog.Internal.State Methods traverse :: Applicative f => (a -> f b) -> Concrete a -> f (Concrete b) Source # sequenceA :: Applicative f => Concrete (f a) -> f (Concrete a) Source # mapM :: Monad m => (a -> m b) -> Concrete a -> m (Concrete b) Source # sequence :: Monad m => Concrete (m a) -> m (Concrete a) Source #
Show a => Show (Concrete a) Source # |
Instance details Defined in Hedgehog.Internal.State Methods showsPrec :: Int -> Concrete a -> ShowS Source # show :: Concrete a -> String Source # showList :: [Concrete a] -> ShowS Source #
Eq a => Eq (Concrete a) Source # |
Instance details Defined in Hedgehog.Internal.State Methods (==) :: Concrete a -> Concrete a -> Bool Source # (/=) :: Concrete a -> Concrete a -> Bool Source #
Ord a => Ord (Concrete a) Source # |

Instance details

Defined in Hedgehog.Internal.State

Methods

compare :: Concrete a -> Concrete a -> Ordering Source #

(<) :: Concrete a -> Concrete a -> Bool Source #

(<=) :: Concrete a -> Concrete a -> Bool Source #

(>) :: Concrete a -> Concrete a -> Bool Source #

(>=) :: Concrete a -> Concrete a -> Bool Source #

max :: Concrete a -> Concrete a -> Concrete a Source #

min :: Concrete a -> Concrete a -> Concrete a Source #

newtype Opaque a Source #

Opaque values.

Useful if you want to put something without a `Show` instance inside something which you'd like to be able to display.

For example:

      data State v =
        State {
            stateRefs :: [Var (Opaque (IORef Int)) v]
          } deriving (Eq, Show)

Constructors

Opaque |

Fields

- unOpaque :: a

#### Instances

Instances details

Show (Opaque a) Source # |
Instance details Defined in Hedgehog.Internal.Opaque Methods showsPrec :: Int -> Opaque a -> ShowS Source # show :: Opaque a -> String Source # showList :: [Opaque a] -> ShowS Source #
Eq a => Eq (Opaque a) Source # |
Instance details Defined in Hedgehog.Internal.Opaque Methods (==) :: Opaque a -> Opaque a -> Bool Source # (/=) :: Opaque a -> Opaque a -> Bool Source #
Ord a => Ord (Opaque a) Source # |
Instance details Defined in Hedgehog.Internal.Opaque Methods compare :: Opaque a -> Opaque a -> Ordering Source # (<) :: Opaque a -> Opaque a -> Bool Source # (<=) :: Opaque a -> Opaque a -> Bool Source # (>) :: Opaque a -> Opaque a -> Bool Source # (>=) :: Opaque a -> Opaque a -> Bool Source # max :: Opaque a -> Opaque a -> Opaque a Source # min :: Opaque a -> Opaque a -> Opaque a Source #

# Transformers

distributeT :: forall f (m :: Type -> Type) a. (MonadTransDistributive g, Transformer f g m) => g (f m) a -> f (g m) a Source #

Distribute one monad transformer over another.

# Functors

`FunctorB` and `TraversableB` must be implemented for all `Command` `input` types.

This is most easily achieved using `DeriveGeneric`:

    data Register v =
      Register Name (Var Pid v)
      deriving (Eq, Show, Generic)

    instance FunctorB Register
    instance TraversableB Register

    newtype Unregister (v :: * -> *) =
      Unregister Name
      deriving (Eq, Show, Generic)

    instance FunctorB Unregister
    instance TraversableB Unregister

`DeriveAnyClass` and `DerivingStrategies` allow a more compact syntax:

    data Register v =
      Register Name (Var Pid v)
      deriving (Eq, Show, Generic, FunctorB, TraversableB)

    newtype Unregister (v :: * -> *) =
      Unregister Name
      deriving (Eq, Show, Generic)
      deriving anyclass (FunctorB, TraversableB)

class FunctorB (b :: (k -> Type) -> Type) where Source #

Barbie-types that can be mapped over. Instances of `FunctorB` should satisfy the following laws:

    bmap id = id
    bmap f . bmap g = bmap (f . g)

There is a default `bmap` implementation for `Generic` types, so instances can derived automatically.

Minimal complete definition

Nothing

Methods

bmap :: (forall (a :: k). f a -> g a) -> b f -> b g Source #

default bmap :: forall f g. CanDeriveFunctorB b f g => (forall (a :: k). f a -> g a) -> b f -> b g Source #

#### Instances

Instances details

FunctorB (Var a :: (Type -> Type) -> Type) Source # |
Instance details Defined in Hedgehog.Internal.State Methods bmap :: (forall a0. f a0 -> g a0) -> Var a f -> Var a g Source #
FunctorB (Proxy :: (k -> Type) -> Type) |
Instance details Defined in Barbies.Internal.FunctorB Methods bmap :: (forall (a :: k). f a -> g a) -> Proxy f -> Proxy g Source #
FunctorB (Const x :: (k -> Type) -> Type) |
Instance details Defined in Barbies.Internal.FunctorB Methods bmap :: (forall (a :: k). f a -> g a) -> Const x f -> Const x g Source #
FunctorB (Constant x :: (k -> Type) -> Type) |
Instance details Defined in Barbies.Internal.FunctorB Methods bmap :: (forall (a :: k). f a -> g a) -> Constant x f -> Constant x g Source #
(FunctorB a, FunctorB b) => FunctorB (Product a b :: (k -> Type) -> Type) |
Instance details Defined in Barbies.Internal.FunctorB Methods bmap :: (forall (a0 :: k). f a0 -> g a0) -> Product a b f -> Product a b g Source #
(FunctorB a, FunctorB b) => FunctorB (Sum a b :: (k -> Type) -> Type) |
Instance details Defined in Barbies.Internal.FunctorB Methods bmap :: (forall (a0 :: k). f a0 -> g a0) -> Sum a b f -> Sum a b g Source #
(Functor f, FunctorB b) => FunctorB (Compose f b :: (k -> Type) -> Type) |
Instance details Defined in Barbies.Internal.FunctorB Methods bmap :: (forall (a :: k). f0 a -> g a) -> Compose f b f0 -> Compose f b g Source #
FunctorT b => FunctorB (Flip b f :: (k1 -> Type) -> Type) |
Instance details Defined in Barbies.Bi Methods bmap :: (forall (a :: k1). f0 a -> g a) -> Flip b f f0 -> Flip b f g Source #

class FunctorB b => TraversableB (b :: (k -> Type) -> Type) where Source #

Barbie-types that can be traversed from left to right. Instances should satisfy the following laws:

     t . btraverse f   = btraverse (t . f)  -- naturality
    btraverse Identity = Identity           -- identity
    btraverse (Compose . fmap g . f) = Compose . fmap (btraverse g) . btraverse f -- composition

There is a default `btraverse` implementation for `Generic` types, so instances can derived automatically.

Minimal complete definition

Nothing

Methods

btraverse :: Applicative e => (forall (a :: k). f a -> e (g a)) -> b f -> e (b g) Source #

default btraverse :: forall e f g. (Applicative e, CanDeriveTraversableB b f g) => (forall (a :: k). f a -> e (g a)) -> b f -> e (b g) Source #

#### Instances

Instances details

TraversableB (Var a :: (Type -> Type) -> Type) Source # |
Instance details Defined in Hedgehog.Internal.State Methods btraverse :: Applicative e => (forall a0. f a0 -> e (g a0)) -> Var a f -> e (Var a g) Source #
TraversableB (Proxy :: (k -> Type) -> Type) |
Instance details Defined in Barbies.Internal.TraversableB Methods btraverse :: Applicative e => (forall (a :: k). f a -> e (g a)) -> Proxy f -> e (Proxy g) Source #
TraversableB (Const a :: (k -> Type) -> Type) |
Instance details Defined in Barbies.Internal.TraversableB Methods btraverse :: Applicative e => (forall (a0 :: k). f a0 -> e (g a0)) -> Const a f -> e (Const a g) Source #
TraversableB (Constant a :: (k -> Type) -> Type) |
Instance details Defined in Barbies.Internal.TraversableB Methods btraverse :: Applicative e => (forall (a0 :: k). f a0 -> e (g a0)) -> Constant a f -> e (Constant a g) Source #
(TraversableB a, TraversableB b) => TraversableB (Product a b :: (k -> Type) -> Type) |
Instance details Defined in Barbies.Internal.TraversableB Methods btraverse :: Applicative e => (forall (a0 :: k). f a0 -> e (g a0)) -> Product a b f -> e (Product a b g) Source #
(TraversableB a, TraversableB b) => TraversableB (Sum a b :: (k -> Type) -> Type) |
Instance details Defined in Barbies.Internal.TraversableB Methods btraverse :: Applicative e => (forall (a0 :: k). f a0 -> e (g a0)) -> Sum a b f -> e (Sum a b g) Source #
(Traversable f, TraversableB b) => TraversableB (Compose f b :: (k -> Type) -> Type) |
Instance details Defined in Barbies.Internal.TraversableB Methods btraverse :: Applicative e => (forall (a :: k). f0 a -> e (g a)) -> Compose f b f0 -> e (Compose f b g) Source #
TraversableT b => TraversableB (Flip b f :: (k1 -> Type) -> Type) |
Instance details Defined in Barbies.Bi Methods btraverse :: Applicative e => (forall (a :: k1). f0 a -> e (g a)) -> Flip b f f0 -> e (Flip b f g) Source #

newtype Rec p a (x :: k) Source #

Constructors

Rec |

Fields

- unRec :: K1 R a x

#### Instances

Instances details

TraversableB b => GTraversable 0 (f :: k -> Type) (g :: k -> Type) (Rec (b (P 0 f)) (b f) :: k2 -> Type) (Rec (b (P 0 g)) (b g) :: k2 -> Type) |
Instance details Defined in Barbies.Internal.TraversableB Methods gtraverse :: forall t (x :: k2). Applicative t => Proxy 0 -> (forall (a :: k). f a -> t (g a)) -> Rec (b (P 0 f)) (b f) x -> t (Rec (b (P 0 g)) (b g) x) Source #
(Traversable h, TraversableB b) => GTraversable 0 (f :: k -> Type) (g :: k -> Type) (Rec (h (b (P 0 f))) (h (b f)) :: k2 -> Type) (Rec (h (b (P 0 g))) (h (b g)) :: k2 -> Type) |
Instance details Defined in Barbies.Internal.TraversableB Methods gtraverse :: forall t (x :: k2). Applicative t => Proxy 0 -> (forall (a :: k). f a -> t (g a)) -> Rec (h (b (P 0 f))) (h (b f)) x -> t (Rec (h (b (P 0 g))) (h (b g)) x) Source #
(Traversable h, Traversable m, TraversableB b) => GTraversable 0 (f :: k -> Type) (g :: k -> Type) (Rec (m (h (b (P 0 f)))) (m (h (b f))) :: k2 -> Type) (Rec (m (h (b (P 0 g)))) (m (h (b g))) :: k2 -> Type) |
Instance details Defined in Barbies.Internal.TraversableB Methods gtraverse :: forall t (x :: k2). Applicative t => Proxy 0 -> (forall (a :: k). f a -> t (g a)) -> Rec (m (h (b (P 0 f)))) (m (h (b f))) x -> t (Rec (m (h (b (P 0 g)))) (m (h (b g))) x) Source #
ApplicativeB b => GApplicative 0 (f :: k -> Type) (g :: k -> Type) (Rec (b (P 0 f)) (b f) :: k1 -> Type) (Rec (b (P 0 g)) (b g) :: k1 -> Type) (Rec (b (P 0 (Product f g))) (b (Product f g)) :: k1 -> Type) |

Instance details

Defined in Barbies.Internal.ApplicativeB

Methods

gprod :: forall (x :: k1). Proxy 0 -> Proxy f -> Proxy g -> Rec (b (P 0 f)) (b f) x -> Rec (b (P 0 g)) (b g) x -> Rec (b (P 0 (Product f g))) (b (Product f g)) x Source #

gpure :: forall (x :: k1). (f ~ g, (Rec (b (P 0 f)) (b f) :: k1 -> Type) ~ (Rec (b (P 0 g)) (b g) :: k1 -> Type)) => Proxy 0 -> Proxy f -> Proxy (Rec (b (P 0 f)) (b f) :: k1 -> Type) -> Proxy (Rec (b (P 0 (Product f g))) (b (Product f g)) :: k1 -> Type) -> (forall (a :: k). f a) -> Rec (b (P 0 f)) (b f) x Source #

(Applicative h, ApplicativeB b) => GApplicative 0 (f :: k -> Type) (g :: k -> Type) (Rec (h (b (P 0 f))) (h (b f)) :: k1 -> Type) (Rec (h (b (P 0 g))) (h (b g)) :: k1 -> Type) (Rec (h (b (P 0 (Product f g)))) (h (b (Product f g))) :: k1 -> Type) |

Instance details

Defined in Barbies.Internal.ApplicativeB

Methods

gprod :: forall (x :: k1). Proxy 0 -> Proxy f -> Proxy g -> Rec (h (b (P 0 f))) (h (b f)) x -> Rec (h (b (P 0 g))) (h (b g)) x -> Rec (h (b (P 0 (Product f g)))) (h (b (Product f g))) x Source #

gpure :: forall (x :: k1). (f ~ g, (Rec (h (b (P 0 f))) (h (b f)) :: k1 -> Type) ~ (Rec (h (b (P 0 g))) (h (b g)) :: k1 -> Type)) => Proxy 0 -> Proxy f -> Proxy (Rec (h (b (P 0 f))) (h (b f)) :: k1 -> Type) -> Proxy (Rec (h (b (P 0 (Product f g)))) (h (b (Product f g))) :: k1 -> Type) -> (forall (a :: k). f a) -> Rec (h (b (P 0 f))) (h (b f)) x Source #

(Applicative h, Applicative m, ApplicativeB b) => GApplicative 0 (f :: k -> Type) (g :: k -> Type) (Rec (m (h (b (P 0 f)))) (m (h (b f))) :: k1 -> Type) (Rec (m (h (b (P 0 g)))) (m (h (b g))) :: k1 -> Type) (Rec (m (h (b (P 0 (Product f g))))) (m (h (b (Product f g)))) :: k1 -> Type) |

Instance details

Defined in Barbies.Internal.ApplicativeB

Methods

gprod :: forall (x :: k1). Proxy 0 -> Proxy f -> Proxy g -> Rec (m (h (b (P 0 f)))) (m (h (b f))) x -> Rec (m (h (b (P 0 g)))) (m (h (b g))) x -> Rec (m (h (b (P 0 (Product f g))))) (m (h (b (Product f g)))) x Source #

gpure :: forall (x :: k1). (f ~ g, (Rec (m (h (b (P 0 f)))) (m (h (b f))) :: k1 -> Type) ~ (Rec (m (h (b (P 0 g)))) (m (h (b g))) :: k1 -> Type)) => Proxy 0 -> Proxy f -> Proxy (Rec (m (h (b (P 0 f)))) (m (h (b f))) :: k1 -> Type) -> Proxy (Rec (m (h (b (P 0 (Product f g))))) (m (h (b (Product f g)))) :: k1 -> Type) -> (forall (a :: k). f a) -> Rec (m (h (b (P 0 f)))) (m (h (b f))) x Source #

GConstraints n (c :: k1 -> Constraint) (f :: k2) (Rec a' a :: Type -> Type) (Rec b' b :: k3 -> Type) (Rec b' b :: k3 -> Type) |
Instance details Defined in Barbies.Generics.Constraints Methods gaddDicts :: forall (x :: k3). GAll n c (Rec a' a :: Type -> Type) => Rec b' b x -> Rec b' b x Source #
FunctorB b => GFunctor 0 (f :: k -> Type) (g :: k -> Type) (Rec (b' (P 0 f)) (b f) :: k1 -> Type) (Rec (b' (P 0 g)) (b g) :: k1 -> Type) |
Instance details Defined in Barbies.Internal.FunctorB Methods gmap :: forall (x :: k1). Proxy 0 -> (forall (a :: k). f a -> g a) -> Rec (b' (P 0 f)) (b f) x -> Rec (b' (P 0 g)) (b g) x Source #
(Functor h, FunctorB b) => GFunctor 0 (f :: k1 -> Type) (g :: k1 -> Type) (Rec (h' (b' (P 0 f))) (h (b f)) :: k3 -> Type) (Rec (h' (b' (P 0 g))) (h (b g)) :: k3 -> Type) |
Instance details Defined in Barbies.Internal.FunctorB Methods gmap :: forall (x :: k3). Proxy 0 -> (forall (a :: k1). f a -> g a) -> Rec (h' (b' (P 0 f))) (h (b f)) x -> Rec (h' (b' (P 0 g))) (h (b g)) x Source #
(Functor h, Functor m, FunctorB b) => GFunctor 0 (f :: k1 -> Type) (g :: k1 -> Type) (Rec (m' (h' (b' (P 0 f)))) (m (h (b f))) :: k4 -> Type) (Rec (m' (h' (b' (P 0 g)))) (m (h (b g))) :: k4 -> Type) |
Instance details Defined in Barbies.Internal.FunctorB Methods gmap :: forall (x :: k4). Proxy 0 -> (forall (a :: k1). f a -> g a) -> Rec (m' (h' (b' (P 0 f)))) (m (h (b f))) x -> Rec (m' (h' (b' (P 0 g)))) (m (h (b g))) x Source #
(Functor f, Distributive h, DistributiveB b) => GDistributive n f (Rec (h (b (P n g))) (h (b g)) :: k -> Type) (Rec (h (b (P n (Compose f g)))) (h (b (Compose f g))) :: k -> Type) |
Instance details Defined in Barbies.Internal.DistributiveB Methods gdistribute :: forall (x :: k). Proxy n -> f (Rec (h (b (P n g))) (h (b g)) x) -> Rec (h (b (P n (Compose f g)))) (h (b (Compose f g))) x Source #
(Functor f, DistributiveB b) => GDistributive 0 f (Rec (b' (P 0 g)) (b g) :: k -> Type) (Rec (b' (P 0 (Compose f g))) (b (Compose f g)) :: k -> Type) |
Instance details Defined in Barbies.Internal.DistributiveB Methods gdistribute :: forall (x :: k). Proxy 0 -> f (Rec (b' (P 0 g)) (b g) x) -> Rec (b' (P 0 (Compose f g))) (b (Compose f g)) x Source #
(ConstraintsB b, AllB c b) => GConstraints 0 (c :: k -> Constraint) (f :: k -> Type) (Other (b' (P 0 (X :: k -> Type))) (b (X :: k -> Type))) (Rec (b' (P 0 f)) (b f) :: k2 -> Type) (Rec (b' (P 0 (Product (Dict c) f))) (b (Product (Dict c) f)) :: k2 -> Type) |
Instance details Defined in Barbies.Internal.ConstraintsB Methods gaddDicts :: forall (x :: k2). GAll 0 c (Other (b' (P 0 (X :: k -> Type))) (b (X :: k -> Type))) => Rec (b' (P 0 f)) (b f) x -> Rec (b' (P 0 (Product (Dict c) f))) (b (Product (Dict c) f)) x Source #
(ConstraintsB b, AllB c b) => GConstraints 0 (c :: k -> Constraint) (f :: k -> Type) (Self (b' (P 0 (X :: k -> Type))) (b (X :: k -> Type))) (Rec (b' (P 0 f)) (b f) :: k2 -> Type) (Rec (b' (P 0 (Product (Dict c) f))) (b (Product (Dict c) f)) :: k2 -> Type) |
Instance details Defined in Barbies.Internal.ConstraintsB Methods gaddDicts :: forall (x :: k2). GAll 0 c (Self (b' (P 0 (X :: k -> Type))) (b (X :: k -> Type))) => Rec (b' (P 0 f)) (b f) x -> Rec (b' (P 0 (Product (Dict c) f))) (b (Product (Dict c) f)) x Source #
GConstraints n (c :: k1 -> Constraint) (f :: k1 -> Type) (Rec (P n (X :: k1 -> Type) a') (X a) :: Type -> Type) (Rec (P n f a') (f a) :: k2 -> Type) (Rec (P n (Product (Dict c) f) a') (Product (Dict c) f a) :: k2 -> Type) |
Instance details Defined in Barbies.Generics.Constraints Methods gaddDicts :: forall (x :: k2). GAll n c (Rec (P n (X :: k1 -> Type) a') (X a) :: Type -> Type) => Rec (P n f a') (f a) x -> Rec (P n (Product (Dict c) f) a') (Product (Dict c) f a) x Source #
type GAll n (c :: k -> Constraint) (Rec l r :: Type -> Type) |
Instance details Defined in Barbies.Generics.Constraints type GAll n (c :: k -> Constraint) (Rec l r :: Type -> Type) = GAllRec n c l r

class (forall a. Eq a => Eq (f a)) => Eq1 (f :: Type -> Type) Source #

Lifting of the `Eq` class to unary type constructors.

Any instance should be subject to the following law that canonicity is preserved:

`liftEq (==)` = `(==)`

This class therefore represents the generalization of `Eq` by decomposing its main method into a canonical lifting on a canonical inner method, so that the lifting can be reused for other arguments than the canonical one.

Since: base-4.9.0.0

#### Instances

Instances details

Eq1 Complex

    >>> eq1 (1 :+ 2) (1 :+ 2)
    True

    >>> eq1 (1 :+ 2) (1 :+ 3)
    False

Since: base-4.16.0.0

Instance details Defined in Data.Functor.Classes Methods liftEq :: (a -> b -> Bool) -> Complex a -> Complex b -> Bool Source #
Eq1 SCC | Since: containers-0.5.9
Instance details Defined in Data.Graph Methods liftEq :: (a -> b -> Bool) -> SCC a -> SCC b -> Bool Source #
Eq1 IntMap | Since: containers-0.5.9
Instance details Defined in Data.IntMap.Internal Methods liftEq :: (a -> b -> Bool) -> IntMap a -> IntMap b -> Bool Source #
Eq1 Seq | Since: containers-0.5.9
Instance details Defined in Data.Sequence.Internal Methods liftEq :: (a -> b -> Bool) -> Seq a -> Seq b -> Bool Source #
Eq1 Set | Since: containers-0.5.9
Instance details Defined in Data.Set.Internal Methods liftEq :: (a -> b -> Bool) -> Set a -> Set b -> Bool Source #
Eq1 Tree | Since: containers-0.5.9
Instance details Defined in Data.Tree Methods liftEq :: (a -> b -> Bool) -> Tree a -> Tree b -> Bool Source #
Eq1 NonEmpty | Since: base-4.10.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a -> b -> Bool) -> NonEmpty a -> NonEmpty b -> Bool Source #
Eq1 Identity | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a -> b -> Bool) -> Identity a -> Identity b -> Bool Source #
Eq1 Down | Since: base-4.12.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a -> b -> Bool) -> Down a -> Down b -> Bool Source #
Eq1 Par1 |
Instance details Defined in Data.Orphans Methods liftEq :: (a -> b -> Bool) -> Par1 a -> Par1 b -> Bool Source #
Eq1 Hashed |
Instance details Defined in Data.Hashable.Class Methods liftEq :: (a -> b -> Bool) -> Hashed a -> Hashed b -> Bool Source #
Eq1 Concrete Source # |
Instance details Defined in Hedgehog.Internal.State Methods liftEq :: (a -> b -> Bool) -> Concrete a -> Concrete b -> Bool Source #
Eq1 Symbolic Source # |
Instance details Defined in Hedgehog.Internal.State Methods liftEq :: (a -> b -> Bool) -> Symbolic a -> Symbolic b -> Bool Source #
Eq1 Array | Since: primitive-0.6.4.0
Instance details Defined in Data.Primitive.Array Methods liftEq :: (a -> b -> Bool) -> Array a -> Array b -> Bool Source #
Eq1 SmallArray | Since: primitive-0.6.4.0
Instance details Defined in Data.Primitive.SmallArray Methods liftEq :: (a -> b -> Bool) -> SmallArray a -> SmallArray b -> Bool Source #
Eq1 Maybe | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a -> b -> Bool) -> Maybe a -> Maybe b -> Bool Source #
Eq1 Solo | Since: base-4.15
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a -> b -> Bool) -> Solo a -> Solo b -> Bool Source #
Eq1 [] | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a -> b -> Bool) -> [a] -> [b] -> Bool Source #
Eq k => Eq1 (Map k) | Since: containers-0.5.9
Instance details Defined in Data.Map.Internal Methods liftEq :: (a -> b -> Bool) -> Map k a -> Map k b -> Bool Source #
Eq a => Eq1 (Either a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a0 -> b -> Bool) -> Either a a0 -> Either a b -> Bool Source #
Eq1 (Proxy :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a -> b -> Bool) -> Proxy a -> Proxy b -> Bool Source #
Eq1 (U1 :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftEq :: (a -> b -> Bool) -> U1 a -> U1 b -> Bool Source #
Eq1 (UAddr :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftEq :: (a -> b -> Bool) -> UAddr a -> UAddr b -> Bool Source #
Eq1 (UChar :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftEq :: (a -> b -> Bool) -> UChar a -> UChar b -> Bool Source #
Eq1 (UDouble :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftEq :: (a -> b -> Bool) -> UDouble a -> UDouble b -> Bool Source #
Eq1 (UFloat :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftEq :: (a -> b -> Bool) -> UFloat a -> UFloat b -> Bool Source #
Eq1 (UInt :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftEq :: (a -> b -> Bool) -> UInt a -> UInt b -> Bool Source #
Eq1 (UWord :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftEq :: (a -> b -> Bool) -> UWord a -> UWord b -> Bool Source #
Eq1 (V1 :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftEq :: (a -> b -> Bool) -> V1 a -> V1 b -> Bool Source #
Eq1 f => Eq1 (Lift f) |
Instance details Defined in Control.Applicative.Lift Methods liftEq :: (a -> b -> Bool) -> Lift f a -> Lift f b -> Bool Source #
Eq1 m => Eq1 (MaybeT m) |
Instance details Defined in Control.Monad.Trans.Maybe Methods liftEq :: (a -> b -> Bool) -> MaybeT m a -> MaybeT m b -> Bool Source #
Eq a => Eq1 ((,) a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a0 -> b -> Bool) -> (a, a0) -> (a, b) -> Bool Source #
Eq a => Eq1 (Const a :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a0 -> b -> Bool) -> Const a a0 -> Const a b -> Bool Source #
(Generic1 f, Eq1 (Rep1 f)) => Eq1 (Generically1 f) | Since: base-4.17.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a -> b -> Bool) -> Generically1 f a -> Generically1 f b -> Bool Source #
Eq1 f => Eq1 (Rec1 f) |
Instance details Defined in Data.Orphans Methods liftEq :: (a -> b -> Bool) -> Rec1 f a -> Rec1 f b -> Bool Source #
Eq1 (Tagged s) |
Instance details Defined in Data.Tagged Methods liftEq :: (a -> b -> Bool) -> Tagged s a -> Tagged s b -> Bool Source #
Eq1 f => Eq1 (Backwards f) |
Instance details Defined in Control.Applicative.Backwards Methods liftEq :: (a -> b -> Bool) -> Backwards f a -> Backwards f b -> Bool Source #
(Eq e, Eq1 m) => Eq1 (ExceptT e m) |
Instance details Defined in Control.Monad.Trans.Except Methods liftEq :: (a -> b -> Bool) -> ExceptT e m a -> ExceptT e m b -> Bool Source #
Eq1 f => Eq1 (IdentityT f) |
Instance details Defined in Control.Monad.Trans.Identity Methods liftEq :: (a -> b -> Bool) -> IdentityT f a -> IdentityT f b -> Bool Source #
(Eq w, Eq1 m) => Eq1 (WriterT w m) |
Instance details Defined in Control.Monad.Trans.Writer.Lazy Methods liftEq :: (a -> b -> Bool) -> WriterT w m a -> WriterT w m b -> Bool Source #
(Eq w, Eq1 m) => Eq1 (WriterT w m) |
Instance details Defined in Control.Monad.Trans.Writer.Strict Methods liftEq :: (a -> b -> Bool) -> WriterT w m a -> WriterT w m b -> Bool Source #
Eq a => Eq1 (Constant a :: Type -> Type) |
Instance details Defined in Data.Functor.Constant Methods liftEq :: (a0 -> b -> Bool) -> Constant a a0 -> Constant a b -> Bool Source #
Eq1 f => Eq1 (Reverse f) |
Instance details Defined in Data.Functor.Reverse Methods liftEq :: (a -> b -> Bool) -> Reverse f a -> Reverse f b -> Bool Source #
(Eq a, Eq b) => Eq1 ((,,) a b) | Since: base-4.16.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a0 -> b0 -> Bool) -> (a, b, a0) -> (a, b, b0) -> Bool Source #
(Eq1 f, Eq1 g) => Eq1 (Product f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Product Methods liftEq :: (a -> b -> Bool) -> Product f g a -> Product f g b -> Bool Source #
(Eq1 f, Eq1 g) => Eq1 (Sum f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Sum Methods liftEq :: (a -> b -> Bool) -> Sum f g a -> Sum f g b -> Bool Source #
(Eq1 f, Eq1 g) => Eq1 (f :*: g) |
Instance details Defined in Data.Orphans Methods liftEq :: (a -> b -> Bool) -> (f :*: g) a -> (f :*: g) b -> Bool Source #
(Eq1 f, Eq1 g) => Eq1 (f :+: g) |
Instance details Defined in Data.Orphans Methods liftEq :: (a -> b -> Bool) -> (f :+: g) a -> (f :+: g) b -> Bool Source #
Eq c => Eq1 (K1 i c :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftEq :: (a -> b -> Bool) -> K1 i c a -> K1 i c b -> Bool Source #
(Eq a, Eq b, Eq c) => Eq1 ((,,,) a b c) | Since: base-4.16.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a0 -> b0 -> Bool) -> (a, b, c, a0) -> (a, b, c, b0) -> Bool Source #
(Eq1 f, Eq1 g) => Eq1 (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods liftEq :: (a -> b -> Bool) -> Compose f g a -> Compose f g b -> Bool Source #
(Eq1 f, Eq1 g) => Eq1 (f :.: g) |
Instance details Defined in Data.Orphans Methods liftEq :: (a -> b -> Bool) -> (f :.: g) a -> (f :.: g) b -> Bool Source #
Eq1 f => Eq1 (M1 i c f) |
Instance details Defined in Data.Orphans Methods liftEq :: (a -> b -> Bool) -> M1 i c f a -> M1 i c f b -> Bool Source #

eq1 :: (Eq1 f, Eq a) => f a -> f a -> Bool Source #

Lift the standard `(`==`)` function through the type constructor.

Since: base-4.9.0.0

class (Eq1 f, forall a. Ord a => Ord (f a)) => Ord1 (f :: Type -> Type) Source #

Lifting of the `Ord` class to unary type constructors.

Any instance should be subject to the following law that canonicity is preserved:

`liftCompare compare` = `compare`

This class therefore represents the generalization of `Ord` by decomposing its main method into a canonical lifting on a canonical inner method, so that the lifting can be reused for other arguments than the canonical one.

Since: base-4.9.0.0

#### Instances

Instances details

Ord1 IntMap | Since: containers-0.5.9
Instance details Defined in Data.IntMap.Internal Methods liftCompare :: (a -> b -> Ordering) -> IntMap a -> IntMap b -> Ordering Source #
Ord1 Seq | Since: containers-0.5.9
Instance details Defined in Data.Sequence.Internal Methods liftCompare :: (a -> b -> Ordering) -> Seq a -> Seq b -> Ordering Source #
Ord1 Set | Since: containers-0.5.9
Instance details Defined in Data.Set.Internal Methods liftCompare :: (a -> b -> Ordering) -> Set a -> Set b -> Ordering Source #
Ord1 Tree | Since: containers-0.5.9
Instance details Defined in Data.Tree Methods liftCompare :: (a -> b -> Ordering) -> Tree a -> Tree b -> Ordering Source #
Ord1 NonEmpty | Since: base-4.10.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a -> b -> Ordering) -> NonEmpty a -> NonEmpty b -> Ordering Source #
Ord1 Identity | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a -> b -> Ordering) -> Identity a -> Identity b -> Ordering Source #
Ord1 Down | Since: base-4.12.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a -> b -> Ordering) -> Down a -> Down b -> Ordering Source #
Ord1 Par1 |
Instance details Defined in Data.Orphans Methods liftCompare :: (a -> b -> Ordering) -> Par1 a -> Par1 b -> Ordering Source #
Ord1 Hashed |
Instance details Defined in Data.Hashable.Class Methods liftCompare :: (a -> b -> Ordering) -> Hashed a -> Hashed b -> Ordering Source #
Ord1 Concrete Source # |
Instance details Defined in Hedgehog.Internal.State Methods liftCompare :: (a -> b -> Ordering) -> Concrete a -> Concrete b -> Ordering Source #
Ord1 Symbolic Source # |
Instance details Defined in Hedgehog.Internal.State Methods liftCompare :: (a -> b -> Ordering) -> Symbolic a -> Symbolic b -> Ordering Source #
Ord1 Array | Since: primitive-0.6.4.0
Instance details Defined in Data.Primitive.Array Methods liftCompare :: (a -> b -> Ordering) -> Array a -> Array b -> Ordering Source #
Ord1 SmallArray | Since: primitive-0.6.4.0
Instance details Defined in Data.Primitive.SmallArray Methods liftCompare :: (a -> b -> Ordering) -> SmallArray a -> SmallArray b -> Ordering Source #
Ord1 Maybe | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a -> b -> Ordering) -> Maybe a -> Maybe b -> Ordering Source #
Ord1 Solo | Since: base-4.15
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a -> b -> Ordering) -> Solo a -> Solo b -> Ordering Source #
Ord1 [] | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a -> b -> Ordering) -> [a] -> [b] -> Ordering Source #
Ord k => Ord1 (Map k) | Since: containers-0.5.9
Instance details Defined in Data.Map.Internal Methods liftCompare :: (a -> b -> Ordering) -> Map k a -> Map k b -> Ordering Source #
Ord a => Ord1 (Either a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a0 -> b -> Ordering) -> Either a a0 -> Either a b -> Ordering Source #
Ord1 (Proxy :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a -> b -> Ordering) -> Proxy a -> Proxy b -> Ordering Source #
Ord1 (U1 :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftCompare :: (a -> b -> Ordering) -> U1 a -> U1 b -> Ordering Source #
Ord1 (UAddr :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftCompare :: (a -> b -> Ordering) -> UAddr a -> UAddr b -> Ordering Source #
Ord1 (UChar :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftCompare :: (a -> b -> Ordering) -> UChar a -> UChar b -> Ordering Source #
Ord1 (UDouble :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftCompare :: (a -> b -> Ordering) -> UDouble a -> UDouble b -> Ordering Source #
Ord1 (UFloat :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftCompare :: (a -> b -> Ordering) -> UFloat a -> UFloat b -> Ordering Source #
Ord1 (UInt :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftCompare :: (a -> b -> Ordering) -> UInt a -> UInt b -> Ordering Source #
Ord1 (UWord :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftCompare :: (a -> b -> Ordering) -> UWord a -> UWord b -> Ordering Source #
Ord1 (V1 :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftCompare :: (a -> b -> Ordering) -> V1 a -> V1 b -> Ordering Source #
Ord1 f => Ord1 (Lift f) |
Instance details Defined in Control.Applicative.Lift Methods liftCompare :: (a -> b -> Ordering) -> Lift f a -> Lift f b -> Ordering Source #
Ord1 m => Ord1 (MaybeT m) |
Instance details Defined in Control.Monad.Trans.Maybe Methods liftCompare :: (a -> b -> Ordering) -> MaybeT m a -> MaybeT m b -> Ordering Source #
Ord a => Ord1 ((,) a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a0 -> b -> Ordering) -> (a, a0) -> (a, b) -> Ordering Source #
Ord a => Ord1 (Const a :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a0 -> b -> Ordering) -> Const a a0 -> Const a b -> Ordering Source #
(Generic1 f, Ord1 (Rep1 f)) => Ord1 (Generically1 f) | Since: base-4.17.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a -> b -> Ordering) -> Generically1 f a -> Generically1 f b -> Ordering Source #
Ord1 f => Ord1 (Rec1 f) |
Instance details Defined in Data.Orphans Methods liftCompare :: (a -> b -> Ordering) -> Rec1 f a -> Rec1 f b -> Ordering Source #
Ord1 (Tagged s) |
Instance details Defined in Data.Tagged Methods liftCompare :: (a -> b -> Ordering) -> Tagged s a -> Tagged s b -> Ordering Source #
Ord1 f => Ord1 (Backwards f) |
Instance details Defined in Control.Applicative.Backwards Methods liftCompare :: (a -> b -> Ordering) -> Backwards f a -> Backwards f b -> Ordering Source #
(Ord e, Ord1 m) => Ord1 (ExceptT e m) |
Instance details Defined in Control.Monad.Trans.Except Methods liftCompare :: (a -> b -> Ordering) -> ExceptT e m a -> ExceptT e m b -> Ordering Source #
Ord1 f => Ord1 (IdentityT f) |
Instance details Defined in Control.Monad.Trans.Identity Methods liftCompare :: (a -> b -> Ordering) -> IdentityT f a -> IdentityT f b -> Ordering Source #
(Ord w, Ord1 m) => Ord1 (WriterT w m) |
Instance details Defined in Control.Monad.Trans.Writer.Lazy Methods liftCompare :: (a -> b -> Ordering) -> WriterT w m a -> WriterT w m b -> Ordering Source #
(Ord w, Ord1 m) => Ord1 (WriterT w m) |
Instance details Defined in Control.Monad.Trans.Writer.Strict Methods liftCompare :: (a -> b -> Ordering) -> WriterT w m a -> WriterT w m b -> Ordering Source #
Ord a => Ord1 (Constant a :: Type -> Type) |
Instance details Defined in Data.Functor.Constant Methods liftCompare :: (a0 -> b -> Ordering) -> Constant a a0 -> Constant a b -> Ordering Source #
Ord1 f => Ord1 (Reverse f) |
Instance details Defined in Data.Functor.Reverse Methods liftCompare :: (a -> b -> Ordering) -> Reverse f a -> Reverse f b -> Ordering Source #
(Ord a, Ord b) => Ord1 ((,,) a b) | Since: base-4.16.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a0 -> b0 -> Ordering) -> (a, b, a0) -> (a, b, b0) -> Ordering Source #
(Ord1 f, Ord1 g) => Ord1 (Product f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Product Methods liftCompare :: (a -> b -> Ordering) -> Product f g a -> Product f g b -> Ordering Source #
(Ord1 f, Ord1 g) => Ord1 (Sum f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Sum Methods liftCompare :: (a -> b -> Ordering) -> Sum f g a -> Sum f g b -> Ordering Source #
(Ord1 f, Ord1 g) => Ord1 (f :*: g) |
Instance details Defined in Data.Orphans Methods liftCompare :: (a -> b -> Ordering) -> (f :*: g) a -> (f :*: g) b -> Ordering Source #
(Ord1 f, Ord1 g) => Ord1 (f :+: g) |
Instance details Defined in Data.Orphans Methods liftCompare :: (a -> b -> Ordering) -> (f :+: g) a -> (f :+: g) b -> Ordering Source #
Ord c => Ord1 (K1 i c :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftCompare :: (a -> b -> Ordering) -> K1 i c a -> K1 i c b -> Ordering Source #
(Ord a, Ord b, Ord c) => Ord1 ((,,,) a b c) | Since: base-4.16.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a0 -> b0 -> Ordering) -> (a, b, c, a0) -> (a, b, c, b0) -> Ordering Source #
(Ord1 f, Ord1 g) => Ord1 (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods liftCompare :: (a -> b -> Ordering) -> Compose f g a -> Compose f g b -> Ordering Source #
(Ord1 f, Ord1 g) => Ord1 (f :.: g) |
Instance details Defined in Data.Orphans Methods liftCompare :: (a -> b -> Ordering) -> (f :.: g) a -> (f :.: g) b -> Ordering Source #
Ord1 f => Ord1 (M1 i c f) |
Instance details Defined in Data.Orphans Methods liftCompare :: (a -> b -> Ordering) -> M1 i c f a -> M1 i c f b -> Ordering Source #

compare1 :: (Ord1 f, Ord a) => f a -> f a -> Ordering Source #

Lift the standard `compare` function through the type constructor.

Since: base-4.9.0.0

class (forall a. Show a => Show (f a)) => Show1 (f :: Type -> Type) Source #

Lifting of the `Show` class to unary type constructors.

Any instance should be subject to the following laws that canonicity is preserved:

`liftShowsPrec showsPrec showList` = `showsPrec`

`liftShowList showsPrec showList` = `showList`

This class therefore represents the generalization of `Show` by decomposing it's methods into a canonical lifting on a canonical inner method, so that the lifting can be reused for other arguments than the canonical one.

Since: base-4.9.0.0

#### Instances

Instances details

Show1 Complex

    >>> showsPrec1 0 (2 :+ 3) ""
    "2 :+ 3"

Since: base-4.16.0.0

Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Complex a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Complex a] -> ShowS Source #
Show1 SCC | Since: containers-0.5.9
Instance details Defined in Data.Graph Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> SCC a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [SCC a] -> ShowS Source #
Show1 IntMap | Since: containers-0.5.9
Instance details Defined in Data.IntMap.Internal Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> IntMap a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [IntMap a] -> ShowS Source #
Show1 Seq | Since: containers-0.5.9
Instance details Defined in Data.Sequence.Internal Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Seq a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Seq a] -> ShowS Source #
Show1 Set | Since: containers-0.5.9
Instance details Defined in Data.Set.Internal Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Set a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Set a] -> ShowS Source #
Show1 Tree | Since: containers-0.5.9
Instance details Defined in Data.Tree Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Tree a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Tree a] -> ShowS Source #
Show1 NonEmpty | Since: base-4.10.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> NonEmpty a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [NonEmpty a] -> ShowS Source #
Show1 Identity | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Identity a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Identity a] -> ShowS Source #
Show1 Down | Since: base-4.12.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Down a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Down a] -> ShowS Source #
Show1 Par1 |
Instance details Defined in Data.Orphans Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Par1 a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Par1 a] -> ShowS Source #
Show1 Hashed |
Instance details Defined in Data.Hashable.Class Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Hashed a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Hashed a] -> ShowS Source #
Show1 Concrete Source # |
Instance details Defined in Hedgehog.Internal.State Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Concrete a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Concrete a] -> ShowS Source #
Show1 Symbolic Source # |
Instance details Defined in Hedgehog.Internal.State Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Symbolic a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Symbolic a] -> ShowS Source #
Show1 Array | Since: primitive-0.6.4.0
Instance details Defined in Data.Primitive.Array Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Array a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Array a] -> ShowS Source #
Show1 SmallArray | Since: primitive-0.6.4.0
Instance details Defined in Data.Primitive.SmallArray Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> SmallArray a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [SmallArray a] -> ShowS Source #
Show1 Maybe | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Maybe a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Maybe a] -> ShowS Source #
Show1 Solo | Since: base-4.15
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Solo a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Solo a] -> ShowS Source #
Show1 [] | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> [a] -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [[a]] -> ShowS Source #
Show k => Show1 (Map k) | Since: containers-0.5.9
Instance details Defined in Data.Map.Internal Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Map k a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Map k a] -> ShowS Source #
Show a => Show1 (Either a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> Either a a0 -> ShowS Source # liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [Either a a0] -> ShowS Source #
Show1 (Proxy :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Proxy a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Proxy a] -> ShowS Source #
Show1 (U1 :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> U1 a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [U1 a] -> ShowS Source #
Show1 (UAddr :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> UAddr a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [UAddr a] -> ShowS Source #
Show1 (UChar :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> UChar a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [UChar a] -> ShowS Source #
Show1 (UDouble :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> UDouble a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [UDouble a] -> ShowS Source #
Show1 (UFloat :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> UFloat a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [UFloat a] -> ShowS Source #
Show1 (UInt :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> UInt a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [UInt a] -> ShowS Source #
Show1 (UWord :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> UWord a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [UWord a] -> ShowS Source #
Show1 (V1 :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> V1 a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [V1 a] -> ShowS Source #
Show1 m => Show1 (NodeT m) Source # |
Instance details Defined in Hedgehog.Internal.Tree Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> NodeT m a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [NodeT m a] -> ShowS Source #
Show1 m => Show1 (TreeT m) Source # |
Instance details Defined in Hedgehog.Internal.Tree Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> TreeT m a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [TreeT m a] -> ShowS Source #
Show1 f => Show1 (Lift f) |
Instance details Defined in Control.Applicative.Lift Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Lift f a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Lift f a] -> ShowS Source #
Show1 m => Show1 (MaybeT m) |
Instance details Defined in Control.Monad.Trans.Maybe Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> MaybeT m a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [MaybeT m a] -> ShowS Source #
Show a => Show1 ((,) a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> (a, a0) -> ShowS Source # liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [(a, a0)] -> ShowS Source #
Show a => Show1 (Const a :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> Const a a0 -> ShowS Source # liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [Const a a0] -> ShowS Source #
Show1 f => Show1 (Rec1 f) |
Instance details Defined in Data.Orphans Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Rec1 f a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Rec1 f a] -> ShowS Source #
Show1 (Tagged s) |
Instance details Defined in Data.Tagged Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Tagged s a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Tagged s a] -> ShowS Source #
Show1 f => Show1 (Backwards f) |
Instance details Defined in Control.Applicative.Backwards Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Backwards f a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Backwards f a] -> ShowS Source #
(Show e, Show1 m) => Show1 (ExceptT e m) |
Instance details Defined in Control.Monad.Trans.Except Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> ExceptT e m a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [ExceptT e m a] -> ShowS Source #
Show1 f => Show1 (IdentityT f) |
Instance details Defined in Control.Monad.Trans.Identity Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> IdentityT f a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [IdentityT f a] -> ShowS Source #
(Show w, Show1 m) => Show1 (WriterT w m) |
Instance details Defined in Control.Monad.Trans.Writer.Lazy Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> WriterT w m a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [WriterT w m a] -> ShowS Source #
(Show w, Show1 m) => Show1 (WriterT w m) |
Instance details Defined in Control.Monad.Trans.Writer.Strict Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> WriterT w m a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [WriterT w m a] -> ShowS Source #
Show a => Show1 (Constant a :: Type -> Type) |
Instance details Defined in Data.Functor.Constant Methods liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> Constant a a0 -> ShowS Source # liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [Constant a a0] -> ShowS Source #
Show1 f => Show1 (Reverse f) |
Instance details Defined in Data.Functor.Reverse Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Reverse f a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Reverse f a] -> ShowS Source #
(Show a, Show b) => Show1 ((,,) a b) | Since: base-4.16.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> (a, b, a0) -> ShowS Source # liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [(a, b, a0)] -> ShowS Source #
(Show1 f, Show1 g) => Show1 (Product f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Product Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Product f g a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Product f g a] -> ShowS Source #
(Show1 f, Show1 g) => Show1 (Sum f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Sum Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Sum f g a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Sum f g a] -> ShowS Source #
(Show1 f, Show1 g) => Show1 (f :*: g) |
Instance details Defined in Data.Orphans Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> (f :*: g) a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [(f :*: g) a] -> ShowS Source #
(Show1 f, Show1 g) => Show1 (f :+: g) |
Instance details Defined in Data.Orphans Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> (f :+: g) a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [(f :+: g) a] -> ShowS Source #
Show c => Show1 (K1 i c :: Type -> Type) |
Instance details Defined in Data.Orphans Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> K1 i c a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [K1 i c a] -> ShowS Source #
(Show a, Show b, Show c) => Show1 ((,,,) a b c) | Since: base-4.16.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> (a, b, c, a0) -> ShowS Source # liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [(a, b, c, a0)] -> ShowS Source #
(Show1 f, Show1 g) => Show1 (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Compose f g a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Compose f g a] -> ShowS Source #
(Show1 f, Show1 g) => Show1 (f :.: g) |
Instance details Defined in Data.Orphans Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> (f :.: g) a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [(f :.: g) a] -> ShowS Source #
Show1 f => Show1 (M1 i c f) |
Instance details Defined in Data.Orphans Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> M1 i c f a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [M1 i c f a] -> ShowS Source #

showsPrec1 :: (Show1 f, Show a) => Int -> f a -> ShowS Source #

Lift the standard `showsPrec` and `showList` functions through the type constructor.

Since: base-4.9.0.0

# Deprecated

class HTraversable (t :: (Type -> Type) -> Type) where Source #

Deprecated: Replace with Hedgehog.TraversableB (defined in Data.Functor.Barbie) which can be derived automatically using GHC.Generics

Higher-order traversable functors.

Deprecated in favor of `TraversableB` which can be derived using GHC.Generics

Methods

htraverse :: Applicative f => (forall a. g a -> f (h a)) -> t g -> f (t h) Source #