{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}

module Test.Validity.Functions.CanFail
    ( succeedsOnGen
    , succeedsOnValid
    , succeeds
    , succeedsOnArbitrary
    , succeedsOnGens2
    , succeedsOnValids2
    , succeeds2
    , succeedsOnArbitrary2
    , failsOnGen
    , failsOnInvalid
    , failsOnGens2
    , failsOnInvalid2
    , validIfSucceedsOnGen
    , validIfSucceedsOnValid
    , validIfSucceedsOnArbitrary
    , validIfSucceeds
    , validIfSucceedsOnGens2
    , validIfSucceedsOnValids2
    , validIfSucceeds2
    , validIfSucceedsOnArbitrary2
    , validIfSucceedsOnGens3
    , validIfSucceedsOnValids3
    , validIfSucceeds3
    , validIfSucceedsOnArbitrary3
    ) where

import Data.GenValidity

import Test.Hspec
import Test.QuickCheck

import Test.Validity.Types
import Test.Validity.Property.Utils

-- | The function succeeds if the input is generated by the given generator
succeedsOnGen ::
       (Show a, Show b, Show (f b), CanFail f)
    => (a -> f b)
    -> Gen a
    -> (a -> [a])
    -> Property
succeedsOnGen :: (a -> f b) -> Gen a -> (a -> [a]) -> Property
succeedsOnGen func :: a -> f b
func gen :: Gen a
gen s :: a -> [a]
s =
    Gen a -> (a -> [a]) -> (a -> Expectation) -> Property
forall a prop.
(Show a, Testable prop) =>
Gen a -> (a -> [a]) -> (a -> prop) -> Property
forAllShrink Gen a
gen a -> [a]
s ((a -> Expectation) -> Property) -> (a -> Expectation) -> Property
forall a b. (a -> b) -> a -> b
$ \a :: a
a -> a -> f b
func a
a f b -> (f b -> Bool) -> Expectation
forall a. (HasCallStack, Show a) => a -> (a -> Bool) -> Expectation
`shouldSatisfy` (Bool -> Bool
not (Bool -> Bool) -> (f b -> Bool) -> f b -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. f b -> Bool
forall (f :: * -> *) a. CanFail f => f a -> Bool
hasFailed)

-- | The function succeeds if the input is generated by @genValid@
succeedsOnValid ::
       (Show a, Show b, Show (f b), GenValid a, CanFail f)
    => (a -> f b)
    -> Property
succeedsOnValid :: (a -> f b) -> Property
succeedsOnValid f :: a -> f b
f = (a -> f b) -> Gen a -> (a -> [a]) -> Property
forall a b (f :: * -> *).
(Show a, Show b, Show (f b), CanFail f) =>
(a -> f b) -> Gen a -> (a -> [a]) -> Property
succeedsOnGen a -> f b
f Gen a
forall a. GenValid a => Gen a
genValid a -> [a]
forall a. GenValid a => a -> [a]
shrinkValid

-- | The function succeeds if the input is generated by @genUnchecked@
succeeds ::
       (Show a, Show b, Show (f b), GenUnchecked a, CanFail f)
    => (a -> f b)
    -> Property
succeeds :: (a -> f b) -> Property
succeeds f :: a -> f b
f = (a -> f b) -> Gen a -> (a -> [a]) -> Property
forall a b (f :: * -> *).
(Show a, Show b, Show (f b), CanFail f) =>
(a -> f b) -> Gen a -> (a -> [a]) -> Property
succeedsOnGen a -> f b
f Gen a
forall a. GenUnchecked a => Gen a
genUnchecked a -> [a]
forall a. GenUnchecked a => a -> [a]
shrinkUnchecked

-- | The function succeeds if the input is generated by @arbitrary@
succeedsOnArbitrary ::
       (Show a, Show b, Show (f b), Arbitrary a, CanFail f)
    => (a -> f b)
    -> Property
succeedsOnArbitrary :: (a -> f b) -> Property
succeedsOnArbitrary f :: a -> f b
f = (a -> f b) -> Gen a -> (a -> [a]) -> Property
forall a b (f :: * -> *).
(Show a, Show b, Show (f b), CanFail f) =>
(a -> f b) -> Gen a -> (a -> [a]) -> Property
succeedsOnGen a -> f b
f Gen a
forall a. Arbitrary a => Gen a
arbitrary a -> [a]
forall a. Arbitrary a => a -> [a]
shrink

-- | The function fails if the input is generated by the given generator
failsOnGen ::
       (Show a, Show b, Show (f b), CanFail f)
    => (a -> f b)
    -> Gen a
    -> (a -> [a])
    -> Property
failsOnGen :: (a -> f b) -> Gen a -> (a -> [a]) -> Property
failsOnGen func :: a -> f b
func gen :: Gen a
gen s :: a -> [a]
s =
    Gen a -> (a -> [a]) -> (a -> Expectation) -> Property
forall a prop.
(Show a, Testable prop) =>
Gen a -> (a -> [a]) -> (a -> prop) -> Property
forAllShrink Gen a
gen a -> [a]
s ((a -> Expectation) -> Property) -> (a -> Expectation) -> Property
forall a b. (a -> b) -> a -> b
$ \a :: a
a -> a -> f b
func a
a f b -> (f b -> Bool) -> Expectation
forall a. (HasCallStack, Show a) => a -> (a -> Bool) -> Expectation
`shouldSatisfy` f b -> Bool
forall (f :: * -> *) a. CanFail f => f a -> Bool
hasFailed

-- | The function fails if the input is generated by @genInvalid@
failsOnInvalid ::
       (Show a, Show b, Show (f b), GenInvalid a, CanFail f)
    => (a -> f b)
    -> Property
failsOnInvalid :: (a -> f b) -> Property
failsOnInvalid f :: a -> f b
f = (a -> f b) -> Gen a -> (a -> [a]) -> Property
forall a b (f :: * -> *).
(Show a, Show b, Show (f b), CanFail f) =>
(a -> f b) -> Gen a -> (a -> [a]) -> Property
failsOnGen a -> f b
f Gen a
forall a. GenInvalid a => Gen a
genInvalid a -> [a]
forall a. GenInvalid a => a -> [a]
shrinkInvalid

-- | The function produces output that satisfies @isValid@ if it is given input
-- that is generated by the given generator.
validIfSucceedsOnGen ::
       (Show a, Show b, Show (f b), Validity b, CanFail f)
    => (a -> f b)
    -> Gen a
    -> (a -> [a])
    -> Property
validIfSucceedsOnGen :: (a -> f b) -> Gen a -> (a -> [a]) -> Property
validIfSucceedsOnGen func :: a -> f b
func gen :: Gen a
gen s :: a -> [a]
s =
    Gen a -> (a -> [a]) -> (a -> Expectation) -> Property
forall a prop.
(Show a, Testable prop) =>
Gen a -> (a -> [a]) -> (a -> prop) -> Property
forAllShrink Gen a
gen a -> [a]
s ((a -> Expectation) -> Property) -> (a -> Expectation) -> Property
forall a b. (a -> b) -> a -> b
$ \a :: a
a ->
        case f b -> Maybe b
forall (f :: * -> *) a. CanFail f => f a -> Maybe a
resultIfSucceeded (a -> f b
func a
a) of
            Nothing -> () -> Expectation
forall (m :: * -> *) a. Monad m => a -> m a
return () -- Can happen
            Just res :: b
res -> b -> Expectation
forall a. (Show a, Validity a) => a -> Expectation
shouldBeValid b
res

-- | The function produces output that satisfies @isValid@ if it is given input
-- that is generated by @arbitrary@.
validIfSucceedsOnValid ::
       (Show a, Show b, Show (f b), GenValid a, Validity b, CanFail f)
    => (a -> f b)
    -> Property
validIfSucceedsOnValid :: (a -> f b) -> Property
validIfSucceedsOnValid f :: a -> f b
f = (a -> f b) -> Gen a -> (a -> [a]) -> Property
forall a b (f :: * -> *).
(Show a, Show b, Show (f b), Validity b, CanFail f) =>
(a -> f b) -> Gen a -> (a -> [a]) -> Property
validIfSucceedsOnGen a -> f b
f Gen a
forall a. GenValid a => Gen a
genValid a -> [a]
forall a. GenValid a => a -> [a]
shrinkValid

-- | The function produces output that satisfies @isValid@ if it is given input
-- that is generated by @arbitrary@.
validIfSucceedsOnArbitrary ::
       (Show a, Show b, Show (f b), Arbitrary a, Validity b, CanFail f)
    => (a -> f b)
    -> Property
validIfSucceedsOnArbitrary :: (a -> f b) -> Property
validIfSucceedsOnArbitrary f :: a -> f b
f = (a -> f b) -> Gen a -> (a -> [a]) -> Property
forall a b (f :: * -> *).
(Show a, Show b, Show (f b), Validity b, CanFail f) =>
(a -> f b) -> Gen a -> (a -> [a]) -> Property
validIfSucceedsOnGen a -> f b
f Gen a
forall a. Arbitrary a => Gen a
arbitrary a -> [a]
forall a. Arbitrary a => a -> [a]
shrink

-- | The function produces output that satisfies @isValid@ if it is given input
-- that is generated by @genUnchecked@.
validIfSucceeds ::
       (Show a, Show b, Show (f b), GenUnchecked a, Validity b, CanFail f)
    => (a -> f b)
    -> Property
validIfSucceeds :: (a -> f b) -> Property
validIfSucceeds f :: a -> f b
f = (a -> f b) -> Gen a -> (a -> [a]) -> Property
forall a b (f :: * -> *).
(Show a, Show b, Show (f b), Validity b, CanFail f) =>
(a -> f b) -> Gen a -> (a -> [a]) -> Property
validIfSucceedsOnGen a -> f b
f Gen a
forall a. GenUnchecked a => Gen a
genUnchecked a -> [a]
forall a. GenUnchecked a => a -> [a]
shrinkUnchecked

succeedsOnGens2 ::
       (Show a, Show b, Show c, Show (f c), CanFail f)
    => (a -> b -> f c)
    -> Gen (a, b)
    -> ((a, b) -> [(a, b)])
    -> Property
succeedsOnGens2 :: (a -> b -> f c) -> Gen (a, b) -> ((a, b) -> [(a, b)]) -> Property
succeedsOnGens2 func :: a -> b -> f c
func gen :: Gen (a, b)
gen s :: (a, b) -> [(a, b)]
s =
    Gen (a, b)
-> ((a, b) -> [(a, b)]) -> ((a, b) -> Expectation) -> Property
forall a prop.
(Show a, Testable prop) =>
Gen a -> (a -> [a]) -> (a -> prop) -> Property
forAllShrink Gen (a, b)
gen (a, b) -> [(a, b)]
s (((a, b) -> Expectation) -> Property)
-> ((a, b) -> Expectation) -> Property
forall a b. (a -> b) -> a -> b
$ \(a :: a
a, b :: b
b) -> a -> b -> f c
func a
a b
b f c -> (f c -> Bool) -> Expectation
forall a. (HasCallStack, Show a) => a -> (a -> Bool) -> Expectation
`shouldSatisfy` (Bool -> Bool
not (Bool -> Bool) -> (f c -> Bool) -> f c -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. f c -> Bool
forall (f :: * -> *) a. CanFail f => f a -> Bool
hasFailed)

succeedsOnValids2 ::
       (Show a, Show b, Show c, Show (f c), GenValid a, GenValid b, CanFail f)
    => (a -> b -> f c)
    -> Property
succeedsOnValids2 :: (a -> b -> f c) -> Property
succeedsOnValids2 func :: a -> b -> f c
func = (a -> b -> f c) -> Gen (a, b) -> ((a, b) -> [(a, b)]) -> Property
forall a b c (f :: * -> *).
(Show a, Show b, Show c, Show (f c), CanFail f) =>
(a -> b -> f c) -> Gen (a, b) -> ((a, b) -> [(a, b)]) -> Property
succeedsOnGens2 a -> b -> f c
func Gen (a, b)
forall a. GenValid a => Gen a
genValid (a, b) -> [(a, b)]
forall a. GenValid a => a -> [a]
shrinkValid

succeeds2 ::
       ( Show a
       , Show b
       , Show c
       , Show (f c)
       , GenUnchecked a
       , GenUnchecked b
       , CanFail f
       )
    => (a -> b -> f c)
    -> Property
succeeds2 :: (a -> b -> f c) -> Property
succeeds2 func :: a -> b -> f c
func = (a -> b -> f c) -> Gen (a, b) -> ((a, b) -> [(a, b)]) -> Property
forall a b c (f :: * -> *).
(Show a, Show b, Show c, Show (f c), CanFail f) =>
(a -> b -> f c) -> Gen (a, b) -> ((a, b) -> [(a, b)]) -> Property
succeedsOnGens2 a -> b -> f c
func Gen (a, b)
forall a. GenUnchecked a => Gen a
genUnchecked (a, b) -> [(a, b)]
forall a. GenUnchecked a => a -> [a]
shrinkUnchecked

succeedsOnArbitrary2 ::
       (Show a, Show b, Show c, Show (f c), Arbitrary a, Arbitrary b, CanFail f)
    => (a -> b -> f c)
    -> Property
succeedsOnArbitrary2 :: (a -> b -> f c) -> Property
succeedsOnArbitrary2 func :: a -> b -> f c
func = (a -> b -> f c) -> Gen (a, b) -> ((a, b) -> [(a, b)]) -> Property
forall a b c (f :: * -> *).
(Show a, Show b, Show c, Show (f c), CanFail f) =>
(a -> b -> f c) -> Gen (a, b) -> ((a, b) -> [(a, b)]) -> Property
succeedsOnGens2 a -> b -> f c
func Gen (a, b)
forall a. Arbitrary a => Gen a
arbitrary (a, b) -> [(a, b)]
forall a. Arbitrary a => a -> [a]
shrink

failsOnGens2 ::
       (Show a, Show b, Show c, Show (f c), CanFail f)
    => (a -> b -> f c)
    -> Gen a
    -> (a -> [a])
    -> Gen b
    -> (b -> [b])
    -> Property
failsOnGens2 :: (a -> b -> f c)
-> Gen a -> (a -> [a]) -> Gen b -> (b -> [b]) -> Property
failsOnGens2 func :: a -> b -> f c
func genA :: Gen a
genA sA :: a -> [a]
sA genB :: Gen b
genB sB :: b -> [b]
sB =
    Gen a -> (a -> [a]) -> (a -> Property) -> Property
forall a prop.
(Show a, Testable prop) =>
Gen a -> (a -> [a]) -> (a -> prop) -> Property
forAllShrink Gen a
genA a -> [a]
sA ((a -> Property) -> Property) -> (a -> Property) -> Property
forall a b. (a -> b) -> a -> b
$ \a :: a
a ->
        Gen b -> (b -> [b]) -> (b -> Expectation) -> Property
forall a prop.
(Show a, Testable prop) =>
Gen a -> (a -> [a]) -> (a -> prop) -> Property
forAllShrink Gen b
genB b -> [b]
sB ((b -> Expectation) -> Property) -> (b -> Expectation) -> Property
forall a b. (a -> b) -> a -> b
$ \b :: b
b -> a -> b -> f c
func a
a b
b f c -> (f c -> Bool) -> Expectation
forall a. (HasCallStack, Show a) => a -> (a -> Bool) -> Expectation
`shouldSatisfy` f c -> Bool
forall (f :: * -> *) a. CanFail f => f a -> Bool
hasFailed

failsOnInvalid2 ::
       ( Show a
       , Show b
       , Show c
       , Show (f c)
       , GenUnchecked a
       , GenUnchecked b
       , GenInvalid a
       , GenInvalid b
       , CanFail f
       )
    => (a -> b -> f c)
    -> Property
failsOnInvalid2 :: (a -> b -> f c) -> Property
failsOnInvalid2 func :: a -> b -> f c
func =
    (a -> b -> f c)
-> Gen a -> (a -> [a]) -> Gen b -> (b -> [b]) -> Property
forall a b c (f :: * -> *).
(Show a, Show b, Show c, Show (f c), CanFail f) =>
(a -> b -> f c)
-> Gen a -> (a -> [a]) -> Gen b -> (b -> [b]) -> Property
failsOnGens2 a -> b -> f c
func Gen a
forall a. GenInvalid a => Gen a
genInvalid a -> [a]
forall a. GenInvalid a => a -> [a]
shrinkInvalid Gen b
forall a. GenUnchecked a => Gen a
genUnchecked b -> [b]
forall a. GenUnchecked a => a -> [a]
shrinkUnchecked Property -> Property -> Property
forall prop1 prop2.
(Testable prop1, Testable prop2) =>
prop1 -> prop2 -> Property
.&&.
    (a -> b -> f c)
-> Gen a -> (a -> [a]) -> Gen b -> (b -> [b]) -> Property
forall a b c (f :: * -> *).
(Show a, Show b, Show c, Show (f c), CanFail f) =>
(a -> b -> f c)
-> Gen a -> (a -> [a]) -> Gen b -> (b -> [b]) -> Property
failsOnGens2 a -> b -> f c
func Gen a
forall a. GenUnchecked a => Gen a
genUnchecked a -> [a]
forall a. GenUnchecked a => a -> [a]
shrinkUnchecked Gen b
forall a. GenInvalid a => Gen a
genInvalid b -> [b]
forall a. GenInvalid a => a -> [a]
shrinkInvalid

validIfSucceedsOnGens2 ::
       (Show a, Show b, Show c, Show (f c), Validity c, CanFail f)
    => (a -> b -> f c)
    -> Gen (a, b)
    -> ((a, b) -> [(a, b)])
    -> Property
validIfSucceedsOnGens2 :: (a -> b -> f c) -> Gen (a, b) -> ((a, b) -> [(a, b)]) -> Property
validIfSucceedsOnGens2 func :: a -> b -> f c
func gen :: Gen (a, b)
gen s :: (a, b) -> [(a, b)]
s =
    Gen (a, b)
-> ((a, b) -> [(a, b)]) -> ((a, b) -> Expectation) -> Property
forall a prop.
(Show a, Testable prop) =>
Gen a -> (a -> [a]) -> (a -> prop) -> Property
forAllShrink Gen (a, b)
gen (a, b) -> [(a, b)]
s (((a, b) -> Expectation) -> Property)
-> ((a, b) -> Expectation) -> Property
forall a b. (a -> b) -> a -> b
$ \(a :: a
a, b :: b
b) ->
        case f c -> Maybe c
forall (f :: * -> *) a. CanFail f => f a -> Maybe a
resultIfSucceeded (a -> b -> f c
func a
a b
b) of
            Nothing -> () -> Expectation
forall (m :: * -> *) a. Monad m => a -> m a
return () -- Can happen
            Just res :: c
res -> c -> Expectation
forall a. (Show a, Validity a) => a -> Expectation
shouldBeValid c
res

validIfSucceedsOnValids2 ::
       ( Show a
       , Show b
       , Show c
       , Show (f c)
       , GenValid a
       , GenValid b
       , Validity c
       , CanFail f
       )
    => (a -> b -> f c)
    -> Property
validIfSucceedsOnValids2 :: (a -> b -> f c) -> Property
validIfSucceedsOnValids2 func :: a -> b -> f c
func = (a -> b -> f c) -> Gen (a, b) -> ((a, b) -> [(a, b)]) -> Property
forall a b c (f :: * -> *).
(Show a, Show b, Show c, Show (f c), Validity c, CanFail f) =>
(a -> b -> f c) -> Gen (a, b) -> ((a, b) -> [(a, b)]) -> Property
validIfSucceedsOnGens2 a -> b -> f c
func Gen (a, b)
forall a. GenValid a => Gen a
genValid (a, b) -> [(a, b)]
forall a. GenValid a => a -> [a]
shrinkValid

validIfSucceeds2 ::
       ( Show a
       , Show b
       , Show c
       , Show (f c)
       , GenUnchecked a
       , GenUnchecked b
       , Validity c
       , CanFail f
       )
    => (a -> b -> f c)
    -> Property
validIfSucceeds2 :: (a -> b -> f c) -> Property
validIfSucceeds2 func :: a -> b -> f c
func = (a -> b -> f c) -> Gen (a, b) -> ((a, b) -> [(a, b)]) -> Property
forall a b c (f :: * -> *).
(Show a, Show b, Show c, Show (f c), Validity c, CanFail f) =>
(a -> b -> f c) -> Gen (a, b) -> ((a, b) -> [(a, b)]) -> Property
validIfSucceedsOnGens2 a -> b -> f c
func Gen (a, b)
forall a. GenUnchecked a => Gen a
genUnchecked (a, b) -> [(a, b)]
forall a. GenUnchecked a => a -> [a]
shrinkUnchecked

validIfSucceedsOnArbitrary2 ::
       ( Show a
       , Show b
       , Show c
       , Show (f c)
       , Arbitrary a
       , Arbitrary b
       , Validity c
       , CanFail f
       )
    => (a -> b -> f c)
    -> Property
validIfSucceedsOnArbitrary2 :: (a -> b -> f c) -> Property
validIfSucceedsOnArbitrary2 func :: a -> b -> f c
func = (a -> b -> f c) -> Gen (a, b) -> ((a, b) -> [(a, b)]) -> Property
forall a b c (f :: * -> *).
(Show a, Show b, Show c, Show (f c), Validity c, CanFail f) =>
(a -> b -> f c) -> Gen (a, b) -> ((a, b) -> [(a, b)]) -> Property
validIfSucceedsOnGens2 a -> b -> f c
func Gen (a, b)
forall a. Arbitrary a => Gen a
arbitrary (a, b) -> [(a, b)]
forall a. Arbitrary a => a -> [a]
shrink

validIfSucceedsOnGens3 ::
       (Show a, Show b, Show c, Show d, Show (f d), Validity d, CanFail f)
    => (a -> b -> c -> f d)
    -> Gen (a, b, c)
    -> ((a, b, c) -> [(a, b, c)])
    -> Property
validIfSucceedsOnGens3 :: (a -> b -> c -> f d)
-> Gen (a, b, c) -> ((a, b, c) -> [(a, b, c)]) -> Property
validIfSucceedsOnGens3 func :: a -> b -> c -> f d
func gen :: Gen (a, b, c)
gen s :: (a, b, c) -> [(a, b, c)]
s =
    Gen (a, b, c)
-> ((a, b, c) -> [(a, b, c)])
-> ((a, b, c) -> Expectation)
-> Property
forall a prop.
(Show a, Testable prop) =>
Gen a -> (a -> [a]) -> (a -> prop) -> Property
forAllShrink Gen (a, b, c)
gen (a, b, c) -> [(a, b, c)]
s (((a, b, c) -> Expectation) -> Property)
-> ((a, b, c) -> Expectation) -> Property
forall a b. (a -> b) -> a -> b
$ \(a :: a
a, b :: b
b, c :: c
c) ->
        case f d -> Maybe d
forall (f :: * -> *) a. CanFail f => f a -> Maybe a
resultIfSucceeded (a -> b -> c -> f d
func a
a b
b c
c) of
            Nothing -> () -> Expectation
forall (m :: * -> *) a. Monad m => a -> m a
return () -- Can happen
            Just res :: d
res -> d -> Expectation
forall a. (Show a, Validity a) => a -> Expectation
shouldBeValid d
res

validIfSucceedsOnValids3 ::
       ( Show a
       , Show b
       , Show c
       , Show d
       , Show (f d)
       , GenValid a
       , GenValid b
       , GenValid c
       , Validity d
       , CanFail f
       )
    => (a -> b -> c -> f d)
    -> Property
validIfSucceedsOnValids3 :: (a -> b -> c -> f d) -> Property
validIfSucceedsOnValids3 func :: a -> b -> c -> f d
func = (a -> b -> c -> f d)
-> Gen (a, b, c) -> ((a, b, c) -> [(a, b, c)]) -> Property
forall a b c d (f :: * -> *).
(Show a, Show b, Show c, Show d, Show (f d), Validity d,
 CanFail f) =>
(a -> b -> c -> f d)
-> Gen (a, b, c) -> ((a, b, c) -> [(a, b, c)]) -> Property
validIfSucceedsOnGens3 a -> b -> c -> f d
func Gen (a, b, c)
forall a. GenValid a => Gen a
genValid (a, b, c) -> [(a, b, c)]
forall a. GenValid a => a -> [a]
shrinkValid

validIfSucceeds3 ::
       ( Show a
       , Show b
       , Show c
       , Show d
       , Show (f d)
       , GenUnchecked a
       , GenUnchecked b
       , GenUnchecked c
       , Validity d
       , CanFail f
       )
    => (a -> b -> c -> f d)
    -> Property
validIfSucceeds3 :: (a -> b -> c -> f d) -> Property
validIfSucceeds3 func :: a -> b -> c -> f d
func = (a -> b -> c -> f d)
-> Gen (a, b, c) -> ((a, b, c) -> [(a, b, c)]) -> Property
forall a b c d (f :: * -> *).
(Show a, Show b, Show c, Show d, Show (f d), Validity d,
 CanFail f) =>
(a -> b -> c -> f d)
-> Gen (a, b, c) -> ((a, b, c) -> [(a, b, c)]) -> Property
validIfSucceedsOnGens3 a -> b -> c -> f d
func Gen (a, b, c)
forall a. GenUnchecked a => Gen a
genUnchecked (a, b, c) -> [(a, b, c)]
forall a. GenUnchecked a => a -> [a]
shrinkUnchecked

validIfSucceedsOnArbitrary3 ::
       ( Show a
       , Show b
       , Show c
       , Show d
       , Show (f d)
       , Arbitrary a
       , Arbitrary b
       , Arbitrary c
       , Validity d
       , CanFail f
       )
    => (a -> b -> c -> f d)
    -> Property
validIfSucceedsOnArbitrary3 :: (a -> b -> c -> f d) -> Property
validIfSucceedsOnArbitrary3 func :: a -> b -> c -> f d
func = (a -> b -> c -> f d)
-> Gen (a, b, c) -> ((a, b, c) -> [(a, b, c)]) -> Property
forall a b c d (f :: * -> *).
(Show a, Show b, Show c, Show d, Show (f d), Validity d,
 CanFail f) =>
(a -> b -> c -> f d)
-> Gen (a, b, c) -> ((a, b, c) -> [(a, b, c)]) -> Property
validIfSucceedsOnGens3 a -> b -> c -> f d
func Gen (a, b, c)
forall a. Arbitrary a => Gen a
arbitrary (a, b, c) -> [(a, b, c)]
forall a. Arbitrary a => a -> [a]
shrink