-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Standard spec's for GenValidity instances -- -- Please see README.md @package genvalidity-hspec @version 0.2.0.0 module Test.Validity -- | A concrete, poly-kinded proxy type data Proxy k (t :: k) :: forall k. k -> * Proxy :: Proxy k -- | A Spec that specifies that arbitrary only generates -- data that satisfy isValid and that shrink only -- produces data that satisfy isValid. -- -- Example usage: -- --
-- arbitrarySpec (Proxy :: Proxy MyData) --arbitrarySpec :: (Typeable a, Show a, Validity a, Arbitrary a) => Proxy a -> Spec -- | arbitrary only generates valid data arbitraryGeneratesOnlyValid :: (Show a, Validity a, Arbitrary a) => Proxy a -> Property -- | shrink only produces valid data shrinkProducesOnlyValids :: (Show a, Validity a, Arbitrary a) => Proxy a -> Property -- | A Spec that specifies that genValid only generates -- valid data and that genInvalid only generates invalid data. -- -- In general it is a good idea to add this spec to your test suite if -- you write a custom implementation of genValid or -- genInvalid. -- -- Example usage: -- --
-- genValiditySpec (Proxy :: Proxy MyData) --genValiditySpec :: (Typeable a, Show a, GenValidity a) => Proxy a -> Spec -- | genValid only generates valid data genValidityValidGeneratesValid :: (Show a, GenValidity a) => Proxy a -> Property -- | genValid only generates invalid data genValidityInvalidGeneratesInvalid :: (Show a, GenValidity a) => Proxy a -> Property -- | A Spec that specifies that isValidFor implies -- isValid -- -- In general it is a good idea to add this spec to your test suite if -- the a in RelativeValidity a b also has a -- Validity instance. -- -- Example usage: -- --
-- relativeValiditySpec -- (Proxy :: Proxy MyDataFor) -- (Proxy :: Proxy MyOtherData) --relativeValiditySpec :: (Typeable a, Typeable b, Data a, Data b, Show a, Show b, GenValidity a, GenValidity b, GenRelativeValidity a b) => Proxy a -> Proxy b -> Spec -- | isValidFor a b implies isValid a for all b relativeValidityImpliesValidA :: (Show a, Show b, GenValidity a, GenValidity b, RelativeValidity a b) => Proxy a -> Proxy b -> Property -- | isValidFor a b implies isValid b for all a relativeValidityImpliesValidB :: (Show a, Show b, GenValidity a, GenValidity b, RelativeValidity a b) => Proxy a -> Proxy b -> Property -- | A Spec that specifies that genValidFor and -- genInvalidFor work as intended. -- -- In general it is a good idea to add this spec to your test suite if -- you write a custom implementation of genValidFor or -- genInvalidFor. -- -- Example usage: -- --
-- relativeGenValiditySpec (proxy :: MyDataFor) (proxy :: MyOtherData) --genRelativeValiditySpec :: (Typeable a, Typeable b, Show a, Show b, GenValidity a, GenValidity b, RelativeValidity a b, GenRelativeValidity a b) => Proxy a -> Proxy b -> Spec -- | genValidFor b only generates values that satisfy -- isValidFor b genRelativeValidityValidGeneratesValid :: (Show a, Show b, GenValidity a, GenValidity b, RelativeValidity a b, GenRelativeValidity a b) => Proxy a -> Proxy b -> Property -- | genInvalidFor b only generates values that do not satisfy -- isValidFor b genRelativeValidityInvalidGeneratesInvalid :: (Show a, Show b, GenValidity a, GenValidity b, RelativeValidity a b, GenRelativeValidity a b) => Proxy a -> Proxy b -> Property -- | The function produces valid output when the input is generated as -- specified by the given generator. producesValidsOnGen :: (Show a, Show b, Validity b) => (a -> b) -> Gen a -> Property -- | The function produces valid output when the input is generated by -- genUnchecked alwaysProducesValid :: (Show a, Show b, GenValidity a, Validity b) => (a -> b) -> Property -- | The function produces valid output when the input is generated by -- genValid producesValidsOnValids :: (Show a, Show b, GenValidity a, Validity b) => (a -> b) -> Property producesValidsOnGens2 :: (Show a, Show b, Show c, Validity c) => (a -> b -> c) -> Gen a -> Gen b -> Property alwaysProducesValid2 :: (Show a, Show b, Show c, GenValidity a, GenValidity b, Validity c) => (a -> b -> c) -> Property producesValidsOnValids2 :: (Show a, Show b, Show c, GenValidity a, GenValidity b, Validity c) => (a -> b -> c) -> Property -- | A class of types that are the result of functions that can fail -- -- You should not use this class yourself. class CanFail f hasFailed :: CanFail f => f a -> Bool resultIfSucceeded :: CanFail f => f a -> Maybe a -- | 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 -> Property -- | The function succeeds if the input is generated by genValid succeedsOnValidInput :: (Show a, Show b, Show (f b), GenValidity a, CanFail f) => (a -> f b) -> Property -- | 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 -> Property -- | The function fails if the input is generated by genInvalid failsOnInvalidInput :: (Show a, Show b, Show (f b), GenValidity a, CanFail f) => (a -> f b) -> Property -- | 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 -> Property -- | 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), GenValidity a, Validity b, CanFail f) => (a -> f b) -> Property instance Test.Validity.CanFail GHC.Base.Maybe instance Test.Validity.CanFail (Data.Either.Either e)