constrained-generators-0.2.0.0: Framework for generating constrained random data using a subset of first order logic
Safe HaskellSafe-Inferred
LanguageHaskell2010

Constrained.TheKnot

Description

All the things that are mutually recursive.

Synopsis

Documentation

data SumSpec a b Source #

The Specification for Sums.

Constructors

SumSpecRaw (Maybe String) (Maybe (Int, Int)) (Specification a) (Specification b) 

Instances

Instances details
(Arbitrary (Specification a), Arbitrary (Specification b)) ⇒ Arbitrary (SumSpec a b) Source # 
Instance details

Defined in Constrained.TheKnot

Methods

arbitraryGen (SumSpec a b) Source #

shrinkSumSpec a b → [SumSpec a b] Source #

(HasSpec a, HasSpec b, KnownNat (CountCases b)) ⇒ Monoid (SumSpec a b) Source # 
Instance details

Defined in Constrained.TheKnot

Methods

memptySumSpec a b

mappendSumSpec a b → SumSpec a b → SumSpec a b

mconcat ∷ [SumSpec a b] → SumSpec a b

(HasSpec a, HasSpec b) ⇒ Semigroup (SumSpec a b) Source # 
Instance details

Defined in Constrained.TheKnot

Methods

(<>)SumSpec a b → SumSpec a b → SumSpec a b #

sconcatNonEmpty (SumSpec a b) → SumSpec a b

stimes ∷ Integral b0 ⇒ b0 → SumSpec a b → SumSpec a b

(KnownNat (CountCases b), HasSpec a, HasSpec b) ⇒ Show (SumSpec a b) Source # 
Instance details

Defined in Constrained.TheKnot

Methods

showsPrec ∷ Int → SumSpec a b → ShowS

showSumSpec a b → String

showList ∷ [SumSpec a b] → ShowS

pattern SumSpec ∷ Maybe (Int, Int) → Specification a → Specification b → SumSpec a b Source #

guardSumSpec ∷ ∀ a b. (HasSpec a, HasSpec b, KnownNat (CountCases b)) ⇒ [String] → SumSpec a b → Specification (Sum a b) Source #

combTypeName ∷ Maybe String → Maybe String → Maybe String Source #

type family CountCases a where ... Source #

Equations

CountCases (Sum a b) = 1 + CountCases b 
CountCases _ = 1 

countCases ∷ ∀ a. KnownNat (CountCases a) ⇒ Int Source #

totalWeightList (Weighted f) as → Maybe Int Source #

sumType ∷ Maybe String → String Source #

caseBoolSpecHasSpec a ⇒ Specification Bool → (Bool → Specification a) → Specification a Source #

data BoolW (sym ∷ Symbol) (dom ∷ [Type]) (rng ∷ Type) where Source #

Operations on Bool

Constructors

NotWBoolW "not_" '[Bool] Bool 
OrWBoolW "or_" '[Bool, Bool] Bool 

Instances

Instances details
Semantics BoolW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

semantics ∷ ∀ (s ∷ Symbol) (d ∷ [Type]) r. BoolW s d r → FunTy d r Source #

Syntax BoolW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

isInFix ∷ ∀ (s ∷ Symbol) (dom ∷ [Type]) rng. BoolW s dom rng → Bool Source #

prettyWit ∷ ∀ (s ∷ Symbol) (dom ∷ [Type]) rng ann. (All HasSpec dom, HasSpec rng) ⇒ BoolW s dom rng → List Term dom → Int → Maybe (Doc ann) Source #

(HasSpec Bool, TypeSpec Bool ~ SumSpec () ()) ⇒ Logic "not_" BoolW '[Bool] Bool Source # 
Instance details

Defined in Constrained.TheKnot

Methods

infoBoolW "not_" '[Bool] Bool → String Source #

propagateContext "not_" BoolW '[Bool] Bool hole → Specification Bool → Specification hole Source #

rewriteRulesBoolW "not_" '[Bool] Bool → List Term '[Bool] → Evidence (AppRequires "not_" BoolW '[Bool] Bool) → Maybe (Term Bool) Source #

mapTypeSpec ∷ ('[Bool] ~ '[a], Bool ~ b, HasSpec a, HasSpec b) ⇒ BoolW "not_" '[a] b → TypeSpec a → Specification b Source #

saturateBoolW "not_" '[Bool] Bool → List Term '[Bool] → [Pred] Source #

HasSpec Bool ⇒ Logic "or_" BoolW '[Bool, Bool] Bool Source # 
Instance details

Defined in Constrained.TheKnot

Methods

infoBoolW "or_" '[Bool, Bool] Bool → String Source #

propagateContext "or_" BoolW '[Bool, Bool] Bool hole → Specification Bool → Specification hole Source #

rewriteRulesBoolW "or_" '[Bool, Bool] Bool → List Term '[Bool, Bool] → Evidence (AppRequires "or_" BoolW '[Bool, Bool] Bool) → Maybe (Term Bool) Source #

mapTypeSpec ∷ ('[Bool, Bool] ~ '[a], Bool ~ b, HasSpec a, HasSpec b) ⇒ BoolW "or_" '[a] b → TypeSpec a → Specification b Source #

saturateBoolW "or_" '[Bool, Bool] Bool → List Term '[Bool, Bool] → [Pred] Source #

Show (BoolW s dom rng) Source # 
Instance details

Defined in Constrained.TheKnot

Methods

showsPrec ∷ Int → BoolW s dom rng → ShowS

showBoolW s dom rng → String

showList ∷ [BoolW s dom rng] → ShowS

Eq (BoolW s dom rng) Source # 
Instance details

Defined in Constrained.TheKnot

Methods

(==)BoolW s dom rng → BoolW s dom rng → Bool

(/=)BoolW s dom rng → BoolW s dom rng → Bool

boolSemBoolW sym dom rng → FunTy dom rng Source #

not_Term Bool → Term Bool Source #

okOr ∷ Bool → Bool → Specification Bool Source #

We have something like (constant ||. HOLE) must evaluate to need. Return a (Specification Bool) for HOLE, that makes that True.

or_Term Bool → Term Bool → Term Bool Source #

(==.)HasSpec a ⇒ Term a → Term a → Term Bool infix 4 Source #

(<=.) ∷ ∀ a. OrdLike a ⇒ Term a → Term a → Term Bool infixr 4 Source #

(<.) ∷ ∀ a. OrdLike a ⇒ Term a → Term a → Term Bool infixr 4 Source #

(>=.) ∷ ∀ a. OrdLike a ⇒ Term a → Term a → Term Bool infixr 4 Source #

(>.) ∷ ∀ a. OrdLike a ⇒ Term a → Term a → Term Bool infixr 4 Source #

ifElse ∷ (IsPred p, IsPred q) ⇒ Term Bool → p → q → Pred Source #

If the `Specification Bool` doesn't constrain the boolean you will get a TrueSpec out.

whenTrue ∷ ∀ p. IsPred p ⇒ Term Bool → p → Pred Source #

pinnedBy ∷ ∀ a. HasSpec a ⇒ Var a → Pred → Maybe (Term a) Source #

Is the variable x pinned to some free term in p? (free term meaning that all the variables in the term are free in p).

TODO: complete this with more cases!

substituteAndSimplifyTermSubstTerm a → Term a Source #

Apply a substitution and simplify the resulting term if the substitution changed the term.

simplifyTerm ∷ ∀ a. Term a → Term a Source #

Simplify a Term, if the Term is an App, apply the rewrite rules chosen by the (Logic sym t bs a) instance attached to the function witness f

computeSpecSimplified ∷ ∀ a. (HasSpec a, HasCallStack) ⇒ Var a → PredGE (Specification a) Source #

Precondition: the Pred defines the `Var a` Runs in GE in order for us to have detailed context on failure.

computeSpec ∷ ∀ a. (HasSpec a, HasCallStack) ⇒ Var a → PredGE (Specification a) Source #

Precondition: the `Pred fn` defines the `Var a`. Runs in GE in order for us to have detailed context on failure.

sumWeightL ∷ Maybe (Int, Int) → Doc a Source #

sumWeightR ∷ Maybe (Int, Int) → Doc a Source #

caseSpec ∷ ∀ as. HasSpec (SumOver as) ⇒ Maybe String → List (Weighted Specification) as → Specification (SumOver as) Source #

Turn a list of branches into a SumSpec. If all the branches fail return an ErrorSpec. Note the requirement of HasSpec(SumOver).

genFromSpecT ∷ ∀ a m. (HasCallStack, HasSpec a, MonadGenError m) ⇒ Specification a → GenT m a Source #

Generate a value that satisfies the spec. This function can fail if the spec is inconsistent, there is a dependency error, or if the underlying generators are not flexible enough.

genFromSpec ∷ ∀ a. (HasCallStack, HasSpec a) ⇒ Specification a → Gen a Source #

A version of genFromSpecT that simply errors if the generator fails

genFromSpecWithSeed ∷ ∀ a. (HasCallStack, HasSpec a) ⇒ Int → Int → Specification a → a Source #

A version of genFromSpecT that takes a seed and a size and gives you a result

debugSpec ∷ ∀ a. HasSpec a ⇒ Specification a → IO () Source #

A version of genFromSpecT that runs in the IO monad. Good for debugging.

irreflexiveDependencyOn ∷ ∀ t t'. (HasVariables t, HasVariables t') ⇒ t → t' → DependGraph Source #

solvableFromName → Set NameDependGraph → Bool Source #

shrinkWithSpec ∷ ∀ a. HasSpec a ⇒ Specification a → a → [a] Source #

shrinkFromPredsHasSpec a ⇒ PredVar a → a → [a] Source #

fixupWithSpec ∷ ∀ a. HasSpec a ⇒ Specification a → a → Maybe a Source #

prepareLinearizationPredGE SolverPlan Source #

Linearize a predicate, turning it into a list of variables to solve and their defining constraints such that each variable can be solved independently.

flattenPredPred → [Pred] Source #

Flatten nested Let, Exists, and And in a `Pred fn`. Let and Exists bound variables become free in the result.

mergeSolverStageSolverStage → [SolverStage] → [SolverStage] Source #

Does nothing if the variable is not in the plan already.

printPlanHasSpec a ⇒ Specification a → IO () Source #

genFromPreds ∷ ∀ m. MonadGenError m ⇒ EnvPredGenT m Env Source #

Generate a satisfying Env for a `p : Pred fn`. The Env contains values for all the free variables in `flattenPred p`.

backPropagationSolverPlanSolverPlan Source #

Push as much information we can backwards through the plan.

mapSpec ∷ ∀ s t a b. (Logic s t '[a] b, HasSpec a, HasSpec b) ⇒ t s '[a] b → Specification a → Specification b Source #

Functor like property for Specification, but instead of a Haskell function (a -> b), it takes a function symbol (t c s '[a] b) from a to b. Note, in this context, a function symbol is some constructor of a witnesstype. Eg. ProdFstW, InjRightW, SingletonW, etc. NOT the lifted versions like fst_ singleton_, which construct Terms. We had to wait until here to define this because it depends on Semigroup property of Specification, and Asserting equality

pairView ∷ ∀ a b. (HasSpec a, HasSpec b) ⇒ Term (Prod a b) → Maybe (Term a, Term b) Source #

cartesian ∷ ∀ a b. (HasSpec a, HasSpec b) ⇒ Specification a → Specification b → Specification (Prod a b) Source #

data PairSpec a b Source #

Constructors

Cartesian (Specification a) (Specification b) 

Instances

Instances details
(Arbitrary (Specification a), Arbitrary (Specification b)) ⇒ Arbitrary (PairSpec a b) Source # 
Instance details

Defined in Constrained.TheKnot

Methods

arbitraryGen (PairSpec a b) Source #

shrinkPairSpec a b → [PairSpec a b] Source #

(HasSpec a, HasSpec b) ⇒ Show (PairSpec a b) Source # 
Instance details

Defined in Constrained.TheKnot

Methods

showsPrec ∷ Int → PairSpec a b → ShowS

showPairSpec a b → String

showList ∷ [PairSpec a b] → ShowS

prodFst_ ∷ (HasSpec a, HasSpec b) ⇒ Term (Prod a b) → Term a Source #

prodSnd_ ∷ (HasSpec a, HasSpec b) ⇒ Term (Prod a b) → Term b Source #

sameFst ∷ Eq a1 ⇒ a1 → [Prod a1 a2] → [a2] Source #

sameSnd ∷ Eq a1 ⇒ a1 → [Prod a2 a1] → [a2] Source #

prod_ ∷ (HasSpec a, HasSpec b) ⇒ Term a → Term b → Term (Prod a b) Source #

Orphan instances

HasSpec Integer Source # 
Instance details

Associated Types

type TypeSpec Integer Source #

type Prerequisites Integer Source #

Methods

emptySpecTypeSpec Integer Source #

combineSpecTypeSpec Integer → TypeSpec Integer → Specification Integer Source #

genFromTypeSpec ∷ ∀ (m ∷ Type → Type). (HasCallStack, MonadGenError m) ⇒ TypeSpec Integer → GenT m Integer Source #

conformsTo ∷ Integer → TypeSpec Integer → Bool Source #

shrinkWithTypeSpecTypeSpec Integer → Integer → [Integer] Source #

toPredsTerm Integer → TypeSpec Integer → Pred Source #

cardinalTypeSpecTypeSpec Integer → Specification Integer Source #

cardinalTrueSpecSpecification Integer Source #

typeSpecHasErrorTypeSpec Integer → Maybe (NonEmpty String) Source #

alternateShowTypeSpec Integer → BinaryShow Source #

monadConformsTo ∷ Integer → TypeSpec Integer → Writer [String] Bool Source #

typeSpecOptTypeSpec Integer → [Integer] → Specification Integer Source #

guardTypeSpec ∷ [String] → TypeSpec Integer → Specification Integer Source #

prerequisitesEvidence (Prerequisites Integer) Source #

HasSpec Bool Source # 
Instance details

Associated Types

type TypeSpec Bool Source #

type Prerequisites Bool Source #

Methods

emptySpecTypeSpec Bool Source #

combineSpecTypeSpec Bool → TypeSpec Bool → Specification Bool Source #

genFromTypeSpec ∷ ∀ (m ∷ Type → Type). (HasCallStack, MonadGenError m) ⇒ TypeSpec Bool → GenT m Bool Source #

conformsTo ∷ Bool → TypeSpec Bool → Bool Source #

shrinkWithTypeSpecTypeSpec Bool → Bool → [Bool] Source #

toPredsTerm Bool → TypeSpec Bool → Pred Source #

cardinalTypeSpecTypeSpec Bool → Specification Integer Source #

cardinalTrueSpecSpecification Integer Source #

typeSpecHasErrorTypeSpec Bool → Maybe (NonEmpty String) Source #

alternateShowTypeSpec Bool → BinaryShow Source #

monadConformsTo ∷ Bool → TypeSpec Bool → Writer [String] Bool Source #

typeSpecOptTypeSpec Bool → [Bool] → Specification Bool Source #

guardTypeSpec ∷ [String] → TypeSpec Bool → Specification Bool Source #

prerequisitesEvidence (Prerequisites Bool) Source #

HasSimpleRep Bool Source # 
Instance details

Associated Types

type SimpleRep Bool Source #

type TheSop Bool ∷ [Type] Source #

Methods

toSimpleRep ∷ Bool → SimpleRep Bool Source #

fromSimpleRepSimpleRep Bool → Bool Source #

OrdLike a ⇒ Logic "<." NumOrdW '[a, a] Bool Source # 
Instance details

Methods

infoNumOrdW "<." '[a, a] Bool → String Source #

propagateContext "<." NumOrdW '[a, a] Bool hole → Specification Bool → Specification hole Source #

rewriteRulesNumOrdW "<." '[a, a] Bool → List Term '[a, a] → Evidence (AppRequires "<." NumOrdW '[a, a] Bool) → Maybe (Term Bool) Source #

mapTypeSpec ∷ ('[a, a] ~ '[a0], Bool ~ b, HasSpec a0, HasSpec b) ⇒ NumOrdW "<." '[a0] b → TypeSpec a0 → Specification b Source #

saturateNumOrdW "<." '[a, a] Bool → List Term '[a, a] → [Pred] Source #

OrdLike a ⇒ Logic "<=." NumOrdW '[a, a] Bool Source # 
Instance details

Methods

infoNumOrdW "<=." '[a, a] Bool → String Source #

propagateContext "<=." NumOrdW '[a, a] Bool hole → Specification Bool → Specification hole Source #

rewriteRulesNumOrdW "<=." '[a, a] Bool → List Term '[a, a] → Evidence (AppRequires "<=." NumOrdW '[a, a] Bool) → Maybe (Term Bool) Source #

mapTypeSpec ∷ ('[a, a] ~ '[a0], Bool ~ b, HasSpec a0, HasSpec b) ⇒ NumOrdW "<=." '[a0] b → TypeSpec a0 → Specification b Source #

saturateNumOrdW "<=." '[a, a] Bool → List Term '[a, a] → [Pred] Source #

(HasSpec Bool, Eq a, Typeable a) ⇒ Logic "==." BaseW '[a, a] Bool Source # 
Instance details

Methods

infoBaseW "==." '[a, a] Bool → String Source #

propagateContext "==." BaseW '[a, a] Bool hole → Specification Bool → Specification hole Source #

rewriteRulesBaseW "==." '[a, a] Bool → List Term '[a, a] → Evidence (AppRequires "==." BaseW '[a, a] Bool) → Maybe (Term Bool) Source #

mapTypeSpec ∷ ('[a, a] ~ '[a0], Bool ~ b, HasSpec a0, HasSpec b) ⇒ BaseW "==." '[a0] b → TypeSpec a0 → Specification b Source #

saturateBaseW "==." '[a, a] Bool → List Term '[a, a] → [Pred] Source #

OrdLike a ⇒ Logic ">." NumOrdW '[a, a] Bool Source # 
Instance details

Methods

infoNumOrdW ">." '[a, a] Bool → String Source #

propagateContext ">." NumOrdW '[a, a] Bool hole → Specification Bool → Specification hole Source #

rewriteRulesNumOrdW ">." '[a, a] Bool → List Term '[a, a] → Evidence (AppRequires ">." NumOrdW '[a, a] Bool) → Maybe (Term Bool) Source #

mapTypeSpec ∷ ('[a, a] ~ '[a0], Bool ~ b, HasSpec a0, HasSpec b) ⇒ NumOrdW ">." '[a0] b → TypeSpec a0 → Specification b Source #

saturateNumOrdW ">." '[a, a] Bool → List Term '[a, a] → [Pred] Source #

OrdLike a ⇒ Logic ">=." NumOrdW '[a, a] Bool Source # 
Instance details

Methods

infoNumOrdW ">=." '[a, a] Bool → String Source #

propagateContext ">=." NumOrdW '[a, a] Bool hole → Specification Bool → Specification hole Source #

rewriteRulesNumOrdW ">=." '[a, a] Bool → List Term '[a, a] → Evidence (AppRequires ">=." NumOrdW '[a, a] Bool) → Maybe (Term Bool) Source #

mapTypeSpec ∷ ('[a, a] ~ '[a0], Bool ~ b, HasSpec a0, HasSpec b) ⇒ NumOrdW ">=." '[a0] b → TypeSpec a0 → Specification b Source #

saturateNumOrdW ">=." '[a, a] Bool → List Term '[a, a] → [Pred] Source #

(HasSpec Bool, TypeSpec Bool ~ SumSpec () ()) ⇒ Logic "not_" BoolW '[Bool] Bool Source # 
Instance details

Methods

infoBoolW "not_" '[Bool] Bool → String Source #

propagateContext "not_" BoolW '[Bool] Bool hole → Specification Bool → Specification hole Source #

rewriteRulesBoolW "not_" '[Bool] Bool → List Term '[Bool] → Evidence (AppRequires "not_" BoolW '[Bool] Bool) → Maybe (Term Bool) Source #

mapTypeSpec ∷ ('[Bool] ~ '[a], Bool ~ b, HasSpec a, HasSpec b) ⇒ BoolW "not_" '[a] b → TypeSpec a → Specification b Source #

saturateBoolW "not_" '[Bool] Bool → List Term '[Bool] → [Pred] Source #

HasSpec Bool ⇒ Logic "or_" BoolW '[Bool, Bool] Bool Source # 
Instance details

Methods

infoBoolW "or_" '[Bool, Bool] Bool → String Source #

propagateContext "or_" BoolW '[Bool, Bool] Bool hole → Specification Bool → Specification hole Source #

rewriteRulesBoolW "or_" '[Bool, Bool] Bool → List Term '[Bool, Bool] → Evidence (AppRequires "or_" BoolW '[Bool, Bool] Bool) → Maybe (Term Bool) Source #

mapTypeSpec ∷ ('[Bool, Bool] ~ '[a], Bool ~ b, HasSpec a, HasSpec b) ⇒ BoolW "or_" '[a] b → TypeSpec a → Specification b Source #

saturateBoolW "or_" '[Bool, Bool] Bool → List Term '[Bool, Bool] → [Pred] Source #

(HasSpec a, HasSpec b) ⇒ Logic "prodFst_" BaseW '[Prod a b] a Source # 
Instance details

Methods

infoBaseW "prodFst_" '[Prod a b] a → String Source #

propagateContext "prodFst_" BaseW '[Prod a b] a hole → Specification a → Specification hole Source #

rewriteRulesBaseW "prodFst_" '[Prod a b] a → List Term '[Prod a b] → Evidence (AppRequires "prodFst_" BaseW '[Prod a b] a) → Maybe (Term a) Source #

mapTypeSpec ∷ ('[Prod a b] ~ '[a0], a ~ b0, HasSpec a0, HasSpec b0) ⇒ BaseW "prodFst_" '[a0] b0 → TypeSpec a0 → Specification b0 Source #

saturateBaseW "prodFst_" '[Prod a b] Bool → List Term '[Prod a b] → [Pred] Source #

(HasSpec a, HasSpec b) ⇒ Logic "prodSnd_" BaseW '[Prod a b] b Source # 
Instance details

Methods

infoBaseW "prodSnd_" '[Prod a b] b → String Source #

propagateContext "prodSnd_" BaseW '[Prod a b] b hole → Specification b → Specification hole Source #

rewriteRulesBaseW "prodSnd_" '[Prod a b] b → List Term '[Prod a b] → Evidence (AppRequires "prodSnd_" BaseW '[Prod a b] b) → Maybe (Term b) Source #

mapTypeSpec ∷ ('[Prod a b] ~ '[a0], b ~ b0, HasSpec a0, HasSpec b0) ⇒ BaseW "prodSnd_" '[a0] b0 → TypeSpec a0 → Specification b0 Source #

saturateBaseW "prodSnd_" '[Prod a b] Bool → List Term '[Prod a b] → [Pred] Source #

(HasSpec a, HasSpec b) ⇒ Logic "prod_" BaseW '[a, b] (Prod a b) Source # 
Instance details

Methods

infoBaseW "prod_" '[a, b] (Prod a b) → String Source #

propagateContext "prod_" BaseW '[a, b] (Prod a b) hole → Specification (Prod a b) → Specification hole Source #

rewriteRulesBaseW "prod_" '[a, b] (Prod a b) → List Term '[a, b] → Evidence (AppRequires "prod_" BaseW '[a, b] (Prod a b)) → Maybe (Term (Prod a b)) Source #

mapTypeSpec ∷ ('[a, b] ~ '[a0], Prod a b ~ b0, HasSpec a0, HasSpec b0) ⇒ BaseW "prod_" '[a0] b0 → TypeSpec a0 → Specification b0 Source #

saturateBaseW "prod_" '[a, b] Bool → List Term '[a, b] → [Pred] Source #

(HasSpec a, Arbitrary (TypeSpec a)) ⇒ Arbitrary (Specification a) Source # 
Instance details

(HasSpec a, HasSpec b) ⇒ HasSpec (Prod a b) Source # 
Instance details

Associated Types

type TypeSpec (Prod a b) Source #

type Prerequisites (Prod a b) Source #

Methods

emptySpecTypeSpec (Prod a b) Source #

combineSpecTypeSpec (Prod a b) → TypeSpec (Prod a b) → Specification (Prod a b) Source #

genFromTypeSpec ∷ ∀ (m ∷ Type → Type). (HasCallStack, MonadGenError m) ⇒ TypeSpec (Prod a b) → GenT m (Prod a b) Source #

conformsToProd a b → TypeSpec (Prod a b) → Bool Source #

shrinkWithTypeSpecTypeSpec (Prod a b) → Prod a b → [Prod a b] Source #

toPredsTerm (Prod a b) → TypeSpec (Prod a b) → Pred Source #

cardinalTypeSpecTypeSpec (Prod a b) → Specification Integer Source #

cardinalTrueSpecSpecification Integer Source #

typeSpecHasErrorTypeSpec (Prod a b) → Maybe (NonEmpty String) Source #

alternateShowTypeSpec (Prod a b) → BinaryShow Source #

monadConformsToProd a b → TypeSpec (Prod a b) → Writer [String] Bool Source #

typeSpecOptTypeSpec (Prod a b) → [Prod a b] → Specification (Prod a b) Source #

guardTypeSpec ∷ [String] → TypeSpec (Prod a b) → Specification (Prod a b) Source #

prerequisitesEvidence (Prerequisites (Prod a b)) Source #

(HasSpec a, HasSpec b, KnownNat (CountCases b)) ⇒ HasSpec (Sum a b) Source #

The HasSpec Sum instance

Instance details

Associated Types

type TypeSpec (Sum a b) Source #

type Prerequisites (Sum a b) Source #

Methods

emptySpecTypeSpec (Sum a b) Source #

combineSpecTypeSpec (Sum a b) → TypeSpec (Sum a b) → Specification (Sum a b) Source #

genFromTypeSpec ∷ ∀ (m ∷ Type → Type). (HasCallStack, MonadGenError m) ⇒ TypeSpec (Sum a b) → GenT m (Sum a b) Source #

conformsToSum a b → TypeSpec (Sum a b) → Bool Source #

shrinkWithTypeSpecTypeSpec (Sum a b) → Sum a b → [Sum a b] Source #

toPredsTerm (Sum a b) → TypeSpec (Sum a b) → Pred Source #

cardinalTypeSpecTypeSpec (Sum a b) → Specification Integer Source #

cardinalTrueSpecSpecification Integer Source #

typeSpecHasErrorTypeSpec (Sum a b) → Maybe (NonEmpty String) Source #

alternateShowTypeSpec (Sum a b) → BinaryShow Source #

monadConformsToSum a b → TypeSpec (Sum a b) → Writer [String] Bool Source #

typeSpecOptTypeSpec (Sum a b) → [Sum a b] → Specification (Sum a b) Source #

guardTypeSpec ∷ [String] → TypeSpec (Sum a b) → Specification (Sum a b) Source #

prerequisitesEvidence (Prerequisites (Sum a b)) Source #