quickcheck-combinators-0.0.3: Simple type-level combinators for augmenting QuickCheck instances.

Safe HaskellNone
LanguageHaskell2010

Test.QuickCheck.Combinators

Synopsis

Documentation

newtype AtLeast (n :: Nat) t a Source #

Generate with a minimum, inclusive size as n :: Nat

Constructors

AtLeast 

Fields

Instances

Monad t => Monad (AtLeast n t) Source # 

Methods

(>>=) :: AtLeast n t a -> (a -> AtLeast n t b) -> AtLeast n t b #

(>>) :: AtLeast n t a -> AtLeast n t b -> AtLeast n t b #

return :: a -> AtLeast n t a #

fail :: String -> AtLeast n t a #

Functor t => Functor (AtLeast n t) Source # 

Methods

fmap :: (a -> b) -> AtLeast n t a -> AtLeast n t b #

(<$) :: a -> AtLeast n t b -> AtLeast n t a #

Applicative t => Applicative (AtLeast n t) Source # 

Methods

pure :: a -> AtLeast n t a #

(<*>) :: AtLeast n t (a -> b) -> AtLeast n t a -> AtLeast n t b #

liftA2 :: (a -> b -> c) -> AtLeast n t a -> AtLeast n t b -> AtLeast n t c #

(*>) :: AtLeast n t a -> AtLeast n t b -> AtLeast n t b #

(<*) :: AtLeast n t a -> AtLeast n t b -> AtLeast n t a #

Foldable t => Foldable (AtLeast n t) Source # 

Methods

fold :: Monoid m => AtLeast n t m -> m #

foldMap :: Monoid m => (a -> m) -> AtLeast n t a -> m #

foldr :: (a -> b -> b) -> b -> AtLeast n t a -> b #

foldr' :: (a -> b -> b) -> b -> AtLeast n t a -> b #

foldl :: (b -> a -> b) -> b -> AtLeast n t a -> b #

foldl' :: (b -> a -> b) -> b -> AtLeast n t a -> b #

foldr1 :: (a -> a -> a) -> AtLeast n t a -> a #

foldl1 :: (a -> a -> a) -> AtLeast n t a -> a #

toList :: AtLeast n t a -> [a] #

null :: AtLeast n t a -> Bool #

length :: AtLeast n t a -> Int #

elem :: Eq a => a -> AtLeast n t a -> Bool #

maximum :: Ord a => AtLeast n t a -> a #

minimum :: Ord a => AtLeast n t a -> a #

sum :: Num a => AtLeast n t a -> a #

product :: Num a => AtLeast n t a -> a #

Traversable t => Traversable (AtLeast n t) Source # 

Methods

traverse :: Applicative f => (a -> f b) -> AtLeast n t a -> f (AtLeast n t b) #

sequenceA :: Applicative f => AtLeast n t (f a) -> f (AtLeast n t a) #

mapM :: Monad m => (a -> m b) -> AtLeast n t a -> m (AtLeast n t b) #

sequence :: Monad m => AtLeast n t (m a) -> m (AtLeast n t a) #

Enum (t a) => Enum (AtLeast n t a) Source # 

Methods

succ :: AtLeast n t a -> AtLeast n t a #

pred :: AtLeast n t a -> AtLeast n t a #

toEnum :: Int -> AtLeast n t a #

fromEnum :: AtLeast n t a -> Int #

enumFrom :: AtLeast n t a -> [AtLeast n t a] #

enumFromThen :: AtLeast n t a -> AtLeast n t a -> [AtLeast n t a] #

enumFromTo :: AtLeast n t a -> AtLeast n t a -> [AtLeast n t a] #

enumFromThenTo :: AtLeast n t a -> AtLeast n t a -> AtLeast n t a -> [AtLeast n t a] #

Eq (t a) => Eq (AtLeast n t a) Source # 

Methods

(==) :: AtLeast n t a -> AtLeast n t a -> Bool #

(/=) :: AtLeast n t a -> AtLeast n t a -> Bool #

(Data (t a), Typeable * a, Typeable (* -> *) t, KnownNat n) => Data (AtLeast n t a) Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> AtLeast n t a -> c (AtLeast n t a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (AtLeast n t a) #

toConstr :: AtLeast n t a -> Constr #

dataTypeOf :: AtLeast n t a -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (AtLeast n t a)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (AtLeast n t a)) #

gmapT :: (forall b. Data b => b -> b) -> AtLeast n t a -> AtLeast n t a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> AtLeast n t a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> AtLeast n t a -> r #

gmapQ :: (forall d. Data d => d -> u) -> AtLeast n t a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> AtLeast n t a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> AtLeast n t a -> m (AtLeast n t a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> AtLeast n t a -> m (AtLeast n t a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> AtLeast n t a -> m (AtLeast n t a) #

Ord (t a) => Ord (AtLeast n t a) Source # 

Methods

compare :: AtLeast n t a -> AtLeast n t a -> Ordering #

(<) :: AtLeast n t a -> AtLeast n t a -> Bool #

(<=) :: AtLeast n t a -> AtLeast n t a -> Bool #

(>) :: AtLeast n t a -> AtLeast n t a -> Bool #

(>=) :: AtLeast n t a -> AtLeast n t a -> Bool #

max :: AtLeast n t a -> AtLeast n t a -> AtLeast n t a #

min :: AtLeast n t a -> AtLeast n t a -> AtLeast n t a #

Read (t a) => Read (AtLeast n t a) Source # 

Methods

readsPrec :: Int -> ReadS (AtLeast n t a) #

readList :: ReadS [AtLeast n t a] #

readPrec :: ReadPrec (AtLeast n t a) #

readListPrec :: ReadPrec [AtLeast n t a] #

Show (t a) => Show (AtLeast n t a) Source # 

Methods

showsPrec :: Int -> AtLeast n t a -> ShowS #

show :: AtLeast n t a -> String #

showList :: [AtLeast n t a] -> ShowS #

Generic (AtLeast n t a) Source # 

Associated Types

type Rep (AtLeast n t a) :: * -> * #

Methods

from :: AtLeast n t a -> Rep (AtLeast n t a) x #

to :: Rep (AtLeast n t a) x -> AtLeast n t a #

Monoid (t a) => Monoid (AtLeast n t a) Source # 

Methods

mempty :: AtLeast n t a #

mappend :: AtLeast n t a -> AtLeast n t a -> AtLeast n t a #

mconcat :: [AtLeast n t a] -> AtLeast n t a #

(Arbitrary a, Ord a, UnfoldableR p [], p a, KnownNat n) => Arbitrary (AtLeast n OrderedList a) Source # 
(UnfoldableR p t, Monoid (t a), Arbitrary a, KnownNat n, p a) => Arbitrary (AtLeast n t a) Source # 

Methods

arbitrary :: Gen (AtLeast n t a) #

shrink :: AtLeast n t a -> [AtLeast n t a] #

type Rep (AtLeast n t a) Source # 
type Rep (AtLeast n t a) = D1 * (MetaData "AtLeast" "Test.QuickCheck.Combinators" "quickcheck-combinators-0.0.3-4Hu074fv3uuUOCusS28mP" True) (C1 * (MetaCons "AtLeast" PrefixI True) (S1 * (MetaSel (Just Symbol "getAtLeast") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (t a))))

newtype AtMost (n :: Nat) t a Source #

Generate with a maximum, inclusive size as n :: Nat

Constructors

AtMost 

Fields

Instances

Monad t => Monad (AtMost n t) Source # 

Methods

(>>=) :: AtMost n t a -> (a -> AtMost n t b) -> AtMost n t b #

(>>) :: AtMost n t a -> AtMost n t b -> AtMost n t b #

return :: a -> AtMost n t a #

fail :: String -> AtMost n t a #

Functor t => Functor (AtMost n t) Source # 

Methods

fmap :: (a -> b) -> AtMost n t a -> AtMost n t b #

(<$) :: a -> AtMost n t b -> AtMost n t a #

Applicative t => Applicative (AtMost n t) Source # 

Methods

pure :: a -> AtMost n t a #

(<*>) :: AtMost n t (a -> b) -> AtMost n t a -> AtMost n t b #

liftA2 :: (a -> b -> c) -> AtMost n t a -> AtMost n t b -> AtMost n t c #

(*>) :: AtMost n t a -> AtMost n t b -> AtMost n t b #

(<*) :: AtMost n t a -> AtMost n t b -> AtMost n t a #

Foldable t => Foldable (AtMost n t) Source # 

Methods

fold :: Monoid m => AtMost n t m -> m #

foldMap :: Monoid m => (a -> m) -> AtMost n t a -> m #

foldr :: (a -> b -> b) -> b -> AtMost n t a -> b #

foldr' :: (a -> b -> b) -> b -> AtMost n t a -> b #

foldl :: (b -> a -> b) -> b -> AtMost n t a -> b #

foldl' :: (b -> a -> b) -> b -> AtMost n t a -> b #

foldr1 :: (a -> a -> a) -> AtMost n t a -> a #

foldl1 :: (a -> a -> a) -> AtMost n t a -> a #

toList :: AtMost n t a -> [a] #

null :: AtMost n t a -> Bool #

length :: AtMost n t a -> Int #

elem :: Eq a => a -> AtMost n t a -> Bool #

maximum :: Ord a => AtMost n t a -> a #

minimum :: Ord a => AtMost n t a -> a #

sum :: Num a => AtMost n t a -> a #

product :: Num a => AtMost n t a -> a #

Traversable t => Traversable (AtMost n t) Source # 

Methods

traverse :: Applicative f => (a -> f b) -> AtMost n t a -> f (AtMost n t b) #

sequenceA :: Applicative f => AtMost n t (f a) -> f (AtMost n t a) #

mapM :: Monad m => (a -> m b) -> AtMost n t a -> m (AtMost n t b) #

sequence :: Monad m => AtMost n t (m a) -> m (AtMost n t a) #

Enum (t a) => Enum (AtMost n t a) Source # 

Methods

succ :: AtMost n t a -> AtMost n t a #

pred :: AtMost n t a -> AtMost n t a #

toEnum :: Int -> AtMost n t a #

fromEnum :: AtMost n t a -> Int #

enumFrom :: AtMost n t a -> [AtMost n t a] #

enumFromThen :: AtMost n t a -> AtMost n t a -> [AtMost n t a] #

enumFromTo :: AtMost n t a -> AtMost n t a -> [AtMost n t a] #

enumFromThenTo :: AtMost n t a -> AtMost n t a -> AtMost n t a -> [AtMost n t a] #

Eq (t a) => Eq (AtMost n t a) Source # 

Methods

(==) :: AtMost n t a -> AtMost n t a -> Bool #

(/=) :: AtMost n t a -> AtMost n t a -> Bool #

(Data (t a), Typeable * a, Typeable (* -> *) t, KnownNat n) => Data (AtMost n t a) Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> AtMost n t a -> c (AtMost n t a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (AtMost n t a) #

toConstr :: AtMost n t a -> Constr #

dataTypeOf :: AtMost n t a -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (AtMost n t a)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (AtMost n t a)) #

gmapT :: (forall b. Data b => b -> b) -> AtMost n t a -> AtMost n t a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> AtMost n t a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> AtMost n t a -> r #

gmapQ :: (forall d. Data d => d -> u) -> AtMost n t a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> AtMost n t a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> AtMost n t a -> m (AtMost n t a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> AtMost n t a -> m (AtMost n t a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> AtMost n t a -> m (AtMost n t a) #

Ord (t a) => Ord (AtMost n t a) Source # 

Methods

compare :: AtMost n t a -> AtMost n t a -> Ordering #

(<) :: AtMost n t a -> AtMost n t a -> Bool #

(<=) :: AtMost n t a -> AtMost n t a -> Bool #

(>) :: AtMost n t a -> AtMost n t a -> Bool #

(>=) :: AtMost n t a -> AtMost n t a -> Bool #

max :: AtMost n t a -> AtMost n t a -> AtMost n t a #

min :: AtMost n t a -> AtMost n t a -> AtMost n t a #

Read (t a) => Read (AtMost n t a) Source # 

Methods

readsPrec :: Int -> ReadS (AtMost n t a) #

readList :: ReadS [AtMost n t a] #

readPrec :: ReadPrec (AtMost n t a) #

readListPrec :: ReadPrec [AtMost n t a] #

Show (t a) => Show (AtMost n t a) Source # 

Methods

showsPrec :: Int -> AtMost n t a -> ShowS #

show :: AtMost n t a -> String #

showList :: [AtMost n t a] -> ShowS #

Generic (AtMost n t a) Source # 

Associated Types

type Rep (AtMost n t a) :: * -> * #

Methods

from :: AtMost n t a -> Rep (AtMost n t a) x #

to :: Rep (AtMost n t a) x -> AtMost n t a #

Monoid (t a) => Monoid (AtMost n t a) Source # 

Methods

mempty :: AtMost n t a #

mappend :: AtMost n t a -> AtMost n t a -> AtMost n t a #

mconcat :: [AtMost n t a] -> AtMost n t a #

(Arbitrary a, Ord a, UnfoldableR p [], p a, KnownNat n) => Arbitrary (AtMost n OrderedList a) Source # 
(UnfoldableR p t, Monoid (t a), Arbitrary a, KnownNat m, p a) => Arbitrary (AtMost m t a) Source # 

Methods

arbitrary :: Gen (AtMost m t a) #

shrink :: AtMost m t a -> [AtMost m t a] #

type Rep (AtMost n t a) Source # 
type Rep (AtMost n t a) = D1 * (MetaData "AtMost" "Test.QuickCheck.Combinators" "quickcheck-combinators-0.0.3-4Hu074fv3uuUOCusS28mP" True) (C1 * (MetaCons "AtMost" PrefixI True) (S1 * (MetaSel (Just Symbol "getAtMost") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (t a))))

newtype Between (n :: Nat) (m :: Nat) t a Source #

Generate between the inclusive range of n :: Nat and m :: Nat

Constructors

Between 

Fields

Instances

Monad t => Monad (Between n m t) Source # 

Methods

(>>=) :: Between n m t a -> (a -> Between n m t b) -> Between n m t b #

(>>) :: Between n m t a -> Between n m t b -> Between n m t b #

return :: a -> Between n m t a #

fail :: String -> Between n m t a #

Functor t => Functor (Between n m t) Source # 

Methods

fmap :: (a -> b) -> Between n m t a -> Between n m t b #

(<$) :: a -> Between n m t b -> Between n m t a #

Applicative t => Applicative (Between n m t) Source # 

Methods

pure :: a -> Between n m t a #

(<*>) :: Between n m t (a -> b) -> Between n m t a -> Between n m t b #

liftA2 :: (a -> b -> c) -> Between n m t a -> Between n m t b -> Between n m t c #

(*>) :: Between n m t a -> Between n m t b -> Between n m t b #

(<*) :: Between n m t a -> Between n m t b -> Between n m t a #

Foldable t => Foldable (Between n m t) Source # 

Methods

fold :: Monoid m => Between n m t m -> m #

foldMap :: Monoid m => (a -> m) -> Between n m t a -> m #

foldr :: (a -> b -> b) -> b -> Between n m t a -> b #

foldr' :: (a -> b -> b) -> b -> Between n m t a -> b #

foldl :: (b -> a -> b) -> b -> Between n m t a -> b #

foldl' :: (b -> a -> b) -> b -> Between n m t a -> b #

foldr1 :: (a -> a -> a) -> Between n m t a -> a #

foldl1 :: (a -> a -> a) -> Between n m t a -> a #

toList :: Between n m t a -> [a] #

null :: Between n m t a -> Bool #

length :: Between n m t a -> Int #

elem :: Eq a => a -> Between n m t a -> Bool #

maximum :: Ord a => Between n m t a -> a #

minimum :: Ord a => Between n m t a -> a #

sum :: Num a => Between n m t a -> a #

product :: Num a => Between n m t a -> a #

Traversable t => Traversable (Between n m t) Source # 

Methods

traverse :: Applicative f => (a -> f b) -> Between n m t a -> f (Between n m t b) #

sequenceA :: Applicative f => Between n m t (f a) -> f (Between n m t a) #

mapM :: Monad m => (a -> m b) -> Between n m t a -> m (Between n m t b) #

sequence :: Monad m => Between n m t (m a) -> m (Between n m t a) #

Enum (t a) => Enum (Between n m t a) Source # 

Methods

succ :: Between n m t a -> Between n m t a #

pred :: Between n m t a -> Between n m t a #

toEnum :: Int -> Between n m t a #

fromEnum :: Between n m t a -> Int #

enumFrom :: Between n m t a -> [Between n m t a] #

enumFromThen :: Between n m t a -> Between n m t a -> [Between n m t a] #

enumFromTo :: Between n m t a -> Between n m t a -> [Between n m t a] #

enumFromThenTo :: Between n m t a -> Between n m t a -> Between n m t a -> [Between n m t a] #

Eq (t a) => Eq (Between n m t a) Source # 

Methods

(==) :: Between n m t a -> Between n m t a -> Bool #

(/=) :: Between n m t a -> Between n m t a -> Bool #

(Data (t a), Typeable * a, Typeable (* -> *) t, KnownNat m, KnownNat n) => Data (Between n m t a) Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Between n m t a -> c (Between n m t a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Between n m t a) #

toConstr :: Between n m t a -> Constr #

dataTypeOf :: Between n m t a -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Between n m t a)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Between n m t a)) #

gmapT :: (forall b. Data b => b -> b) -> Between n m t a -> Between n m t a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Between n m t a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Between n m t a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Between n m t a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Between n m t a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Between n m t a -> m (Between n m t a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Between n m t a -> m (Between n m t a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Between n m t a -> m (Between n m t a) #

Ord (t a) => Ord (Between n m t a) Source # 

Methods

compare :: Between n m t a -> Between n m t a -> Ordering #

(<) :: Between n m t a -> Between n m t a -> Bool #

(<=) :: Between n m t a -> Between n m t a -> Bool #

(>) :: Between n m t a -> Between n m t a -> Bool #

(>=) :: Between n m t a -> Between n m t a -> Bool #

max :: Between n m t a -> Between n m t a -> Between n m t a #

min :: Between n m t a -> Between n m t a -> Between n m t a #

Read (t a) => Read (Between n m t a) Source # 

Methods

readsPrec :: Int -> ReadS (Between n m t a) #

readList :: ReadS [Between n m t a] #

readPrec :: ReadPrec (Between n m t a) #

readListPrec :: ReadPrec [Between n m t a] #

Show (t a) => Show (Between n m t a) Source # 

Methods

showsPrec :: Int -> Between n m t a -> ShowS #

show :: Between n m t a -> String #

showList :: [Between n m t a] -> ShowS #

Generic (Between n m t a) Source # 

Associated Types

type Rep (Between n m t a) :: * -> * #

Methods

from :: Between n m t a -> Rep (Between n m t a) x #

to :: Rep (Between n m t a) x -> Between n m t a #

Monoid (t a) => Monoid (Between n m t a) Source # 

Methods

mempty :: Between n m t a #

mappend :: Between n m t a -> Between n m t a -> Between n m t a #

mconcat :: [Between n m t a] -> Between n m t a #

(Arbitrary a, Ord a, KnownNat n, UnfoldableR p [], p a, KnownNat m) => Arbitrary (Between n m OrderedList a) Source # 
(UnfoldableR p t, Monoid (t a), Arbitrary a, KnownNat n, KnownNat m, p a) => Arbitrary (Between n m t a) Source # 

Methods

arbitrary :: Gen (Between n m t a) #

shrink :: Between n m t a -> [Between n m t a] #

type Rep (Between n m t a) Source # 
type Rep (Between n m t a) = D1 * (MetaData "Between" "Test.QuickCheck.Combinators" "quickcheck-combinators-0.0.3-4Hu074fv3uuUOCusS28mP" True) (C1 * (MetaCons "Between" PrefixI True) (S1 * (MetaSel (Just Symbol "getBetween") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (t a))))

type NonMempty = AtLeast 1 Source #

Convenience for AtLeast 1