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

Constrained.API

Synopsis

Documentation

data PredD deps where Source #

Constructors

ElemPred ∷ (HasSpecD deps a, Show a) ⇒ BoolTermD deps a → NonEmpty a → PredD deps 
Monitor ∷ ((∀ a. TermD deps a → a) → PropertyProperty) → PredD deps 
And ∷ [PredD deps] → PredD deps 
Exists 

Fields

  • ∷ ((∀ b. TermD deps b → b) → GE a)

    Constructive recovery function for checking existential quantification

  • BinderD deps a
     
  • PredD deps
     
Subst ∷ (HasSpecD deps a, Show a) ⇒ Var a → TermD deps a → PredD deps → PredD deps 
LetTermD deps a → BinderD deps a → PredD deps 
AssertTermD deps BoolPredD deps 
Reifies 

Fields

DependsOn ∷ (HasSpecD deps a, HasSpecD deps b, Show a, Show b) ⇒ TermD deps a → TermD deps b → PredD deps 
ForAll ∷ (ForallableD deps t e, HasSpecD deps t, HasSpecD deps e, Show t, Show e) ⇒ TermD deps t → BinderD deps e → PredD deps 
Case 

Fields

WhenTermD deps BoolPredD deps → PredD deps 
GenHint ∷ (HasGenHintD deps a, Show a, Show (HintD deps a)) ⇒ HintD deps a → TermD deps a → PredD deps 
TruePredPredD deps 
FalsePredNonEmpty StringPredD deps 
ExplainNonEmpty StringPredD deps → PredD deps 

Instances

Instances details
IsPred Pred Source # 
Instance details

Defined in Constrained.Base

Methods

toPredPredPred Source #

Rename Pred Source # 
Instance details

Defined in Constrained.Syntax

Methods

renameTypeable x ⇒ Var x → Var x → PredPred Source #

HasVariables Pred Source # 
Instance details

Defined in Constrained.Syntax

Monoid (PredD deps) Source # 
Instance details

Defined in Constrained.AbstractSyntax

Methods

memptyPredD deps #

mappendPredD deps → PredD deps → PredD deps #

mconcat ∷ [PredD deps] → PredD deps #

Semigroup (PredD deps) Source # 
Instance details

Defined in Constrained.AbstractSyntax

Methods

(<>)PredD deps → PredD deps → PredD deps #

sconcatNonEmpty (PredD deps) → PredD deps #

stimesIntegral b ⇒ b → PredD deps → PredD deps #

Show (PredD deps) Source # 
Instance details

Defined in Constrained.AbstractSyntax

Methods

showsPrecIntPredD deps → ShowS #

showPredD deps → String #

showList ∷ [PredD deps] → ShowS #

Pretty (PredD deps) Source # 
Instance details

Defined in Constrained.AbstractSyntax

Methods

prettyPredD deps → Doc ann Source #

prettyList ∷ [PredD deps] → Doc ann Source #

data TermD deps a where Source #

Constructors

AppAppRequiresD deps t dom rng ⇒ t dom rng → List (TermD deps) dom → TermD deps rng 
Lit ∷ (Typeable a, Eq a, Show a) ⇒ a → TermD deps a 
V ∷ (HasSpecD deps a, Typeable a) ⇒ Var a → TermD deps a 

Instances

Instances details
(Ord a, HasSpec a, HasSpec (Set a)) ⇒ Monoid (Term (Set a)) Source # 
Instance details

Defined in Constrained.Spec.Set

Methods

memptyTerm (Set a) #

mappendTerm (Set a) → Term (Set a) → Term (Set a) #

mconcat ∷ [Term (Set a)] → Term (Set a) #

(Ord a, HasSpec a, HasSpec (Set a)) ⇒ Semigroup (Term (Set a)) Source # 
Instance details

Defined in Constrained.Spec.Set

Methods

(<>)Term (Set a) → Term (Set a) → Term (Set a) #

sconcatNonEmpty (Term (Set a)) → Term (Set a) #

stimesIntegral b ⇒ b → Term (Set a) → Term (Set a) #

NumLike a ⇒ Num (Term a) Source # 
Instance details

Defined in Constrained.NumSpec

Methods

(+)Term a → Term a → Term a #

(-)Term a → Term a → Term a #

(*)Term a → Term a → Term a #

negateTerm a → Term a #

absTerm a → Term a #

signumTerm a → Term a #

fromIntegerIntegerTerm a #

IsPred (Term Bool) Source # 
Instance details

Defined in Constrained.Base

Methods

toPredTerm BoolPred Source #

Rename (Term a) Source # 
Instance details

Defined in Constrained.Syntax

Methods

renameTypeable x ⇒ Var x → Var x → Term a → Term a Source #

HasVariables (Term a) Source # 
Instance details

Defined in Constrained.Syntax

Methods

freeVarsTerm a → FreeVars Source #

freeVarSetTerm a → Set Name Source #

countOfNameTerm a → Int Source #

appearsInNameTerm a → Bool Source #

Show a ⇒ Pretty (WithPrec (TermD deps a)) Source # 
Instance details

Defined in Constrained.AbstractSyntax

Methods

prettyWithPrec (TermD deps a) → Doc ann Source #

prettyList ∷ [WithPrec (TermD deps a)] → Doc ann Source #

Show a ⇒ Show (TermD deps a) Source # 
Instance details

Defined in Constrained.AbstractSyntax

Methods

showsPrecIntTermD deps a → ShowS #

showTermD deps a → String #

showList ∷ [TermD deps a] → ShowS #

Eq (TermD deps a) Source # 
Instance details

Defined in Constrained.AbstractSyntax

Methods

(==)TermD deps a → TermD deps a → Bool #

(/=)TermD deps a → TermD deps a → Bool #

Show a ⇒ Pretty (TermD deps a) Source # 
Instance details

Defined in Constrained.AbstractSyntax

Methods

prettyTermD deps a → Doc ann Source #

prettyList ∷ [TermD deps a] → Doc ann Source #

HasVariables (List Term as) Source # 
Instance details

Defined in Constrained.Syntax

data SpecificationD deps a where Source #

A `Specification a` denotes a set of as

Constructors

ExplainSpec ∷ [String] → SpecificationD deps a → SpecificationD deps a

Explain a Specification

MemberSpec

Elements of a known set

Fields

  • NonEmpty a

    It must be an element of this OrdSet (List). Try hard not to put duplicates in the List.

  • SpecificationD deps a
     
ErrorSpecNonEmpty StringSpecificationD deps a

The empty set

SuspendedSpec

The set described by some predicates over the bound variable.

Fields

  • HasSpecD deps a
     
  • Var a

    This variable ranges over values denoted by the spec

  • PredD deps

    And the variable is subject to these constraints

  • SpecificationD deps a
     
TypeSpecD

A type-specific spec

Fields

TrueSpecSpecificationD deps a

Anything

Instances

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

Defined in Constrained.TheKnot

HasSpec a ⇒ Monoid (Specification a) Source # 
Instance details

Defined in Constrained.Conformance

HasSpec a ⇒ Semigroup (Specification a) Source # 
Instance details

Defined in Constrained.Conformance

Number IntegerNum (Specification Integer) Source #

This is very liberal, since in lots of cases it returns TrueSpec. for example all operations on SuspendedSpec, and certain operations between TypeSpec and MemberSpec. Perhaps we should remove it. Only the addSpec (+) and multSpec (*) methods are used. But, it is kind of cool ... In Fact we can use this to make Num(Specification n) instance for any n. But, only Integer is safe, because in all other types (+) and especially (-) can lead to overflow or underflow failures.

Instance details

Defined in Constrained.NumSpec

(Show a, Typeable a, Show (TypeSpecD deps a)) ⇒ Pretty (WithPrec (SpecificationD deps a)) Source # 
Instance details

Defined in Constrained.AbstractSyntax

Methods

prettyWithPrec (SpecificationD deps a) → Doc ann Source #

prettyList ∷ [WithPrec (SpecificationD deps a)] → Doc ann Source #

(Show a, Typeable a, Show (TypeSpecD deps a)) ⇒ Show (SpecificationD deps a) Source # 
Instance details

Defined in Constrained.AbstractSyntax

Methods

showsPrecIntSpecificationD deps a → ShowS #

showSpecificationD deps a → String #

showList ∷ [SpecificationD deps a] → ShowS #

(Show a, Typeable a, Show (TypeSpecD deps a)) ⇒ Pretty (SpecificationD deps a) Source # 
Instance details

Defined in Constrained.AbstractSyntax

Methods

prettySpecificationD deps a → Doc ann Source #

prettyList ∷ [SpecificationD deps a] → Doc ann Source #

type GenericallyInstantiated a = (AssertComputes (SimpleRep a) (((Text "Trying to use a generic instantiation of " :<>: ShowType a) :<>: Text ", likely in a HasSpec instance.") :$$: Text "However, the type has no definition of SimpleRep, likely because of a missing instance of HasSimpleRep."), HasSimpleRep a, HasSpec (SimpleRep a), TypeSpec a ~ TypeSpec (SimpleRep a)) Source #

class (Typeable t, Semantics t, Syntax t) ⇒ Logic t where Source #

A First-order typed logic has 4 components 1. Terms (Variables (x), Constants (5), and Applications (F x 5) Applications, apply a function symbol to a list of arguments: (FunctionSymbol term1 .. termN) 2. Predicates (Ordered, Odd, ...) 3. Connectives (And, Or, Not, =>, ...) 4. Quantifiers (Forall, Exists)

The Syntax, Semantics, and Logic classes implement new function symbols in the first order logic. Note that a function symbol is first order data, that uniquely identifies a higher order function. The three classes supply varying levels of functionality, relating to the Syntax, Semantics, and Logical operations of the function symbol.

Logical operations are one that support reasoning about how a function symbol relates to logical properties, that we call Specification's

Minimal complete definition

propagate | propagateTypeSpec, propagateMemberSpec

Methods

propagateTypeSpec ∷ (AppRequires t as b, HasSpec a) ⇒ t as b → ListCtx Value as (HOLE a) → TypeSpec b → [b] → Specification a Source #

propagateMemberSpec ∷ (AppRequires t as b, HasSpec a) ⇒ t as b → ListCtx Value as (HOLE a) → NonEmpty b → Specification a Source #

propagate ∷ (AppRequires t as b, HasSpec a) ⇒ t as b → ListCtx Value as (HOLE a) → Specification b → Specification a Source #

rewriteRules ∷ (TypeList dom, Typeable dom, HasSpec rng, All HasSpec dom) ⇒ t dom rng → List Term dom → Evidence (AppRequires t dom rng) → Maybe (Term rng) Source #

mapTypeSpec ∷ ∀ a b. (HasSpec a, HasSpec b) ⇒ t '[a] b → TypeSpec a → Specification b Source #

saturate ∷ t dom BoolList Term dom → [Pred] Source #

Instances

Instances details
Logic BaseW Source # 
Instance details

Defined in Constrained.Base

Methods

propagateTypeSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires BaseW as b, HasSpec a) ⇒ BaseW as b → ListCtx Value as (HOLE a) → TypeSpec b → [b] → Specification a Source #

propagateMemberSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires BaseW as b, HasSpec a) ⇒ BaseW as b → ListCtx Value as (HOLE a) → NonEmpty b → Specification a Source #

propagate ∷ ∀ (as ∷ [Type]) b a. (AppRequires BaseW as b, HasSpec a) ⇒ BaseW as b → ListCtx Value as (HOLE a) → Specification b → Specification a Source #

rewriteRules ∷ ∀ (dom ∷ [Type]) rng. (TypeList dom, Typeable dom, HasSpec rng, All HasSpec dom) ⇒ BaseW dom rng → List Term dom → Evidence (AppRequires BaseW dom rng) → Maybe (Term rng) Source #

mapTypeSpec ∷ (HasSpec a, HasSpec b) ⇒ BaseW '[a] b → TypeSpec a → Specification b Source #

saturate ∷ ∀ (dom ∷ [Type]). BaseW dom BoolList Term dom → [Pred] Source #

Logic IntW Source #

Just a note that these instances won't work until we are in a context where there is a HasSpec instance of a, which (NumLike a) demands. This happens in Constrained.Experiment.TheKnot

Instance details

Defined in Constrained.NumSpec

Methods

propagateTypeSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires IntW as b, HasSpec a) ⇒ IntW as b → ListCtx Value as (HOLE a) → TypeSpec b → [b] → Specification a Source #

propagateMemberSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires IntW as b, HasSpec a) ⇒ IntW as b → ListCtx Value as (HOLE a) → NonEmpty b → Specification a Source #

propagate ∷ ∀ (as ∷ [Type]) b a. (AppRequires IntW as b, HasSpec a) ⇒ IntW as b → ListCtx Value as (HOLE a) → Specification b → Specification a Source #

rewriteRules ∷ ∀ (dom ∷ [Type]) rng. (TypeList dom, Typeable dom, HasSpec rng, All HasSpec dom) ⇒ IntW dom rng → List Term dom → Evidence (AppRequires IntW dom rng) → Maybe (Term rng) Source #

mapTypeSpec ∷ (HasSpec a, HasSpec b) ⇒ IntW '[a] b → TypeSpec a → Specification b Source #

saturate ∷ ∀ (dom ∷ [Type]). IntW dom BoolList Term dom → [Pred] Source #

Logic NumOrdW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

propagateTypeSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires NumOrdW as b, HasSpec a) ⇒ NumOrdW as b → ListCtx Value as (HOLE a) → TypeSpec b → [b] → Specification a Source #

propagateMemberSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires NumOrdW as b, HasSpec a) ⇒ NumOrdW as b → ListCtx Value as (HOLE a) → NonEmpty b → Specification a Source #

propagate ∷ ∀ (as ∷ [Type]) b a. (AppRequires NumOrdW as b, HasSpec a) ⇒ NumOrdW as b → ListCtx Value as (HOLE a) → Specification b → Specification a Source #

rewriteRules ∷ ∀ (dom ∷ [Type]) rng. (TypeList dom, Typeable dom, HasSpec rng, All HasSpec dom) ⇒ NumOrdW dom rng → List Term dom → Evidence (AppRequires NumOrdW dom rng) → Maybe (Term rng) Source #

mapTypeSpec ∷ (HasSpec a, HasSpec b) ⇒ NumOrdW '[a] b → TypeSpec a → Specification b Source #

saturate ∷ ∀ (dom ∷ [Type]). NumOrdW dom BoolList Term dom → [Pred] Source #

Logic MapW Source # 
Instance details

Defined in Constrained.Spec.Map

Methods

propagateTypeSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires MapW as b, HasSpec a) ⇒ MapW as b → ListCtx Value as (HOLE a) → TypeSpec b → [b] → Specification a Source #

propagateMemberSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires MapW as b, HasSpec a) ⇒ MapW as b → ListCtx Value as (HOLE a) → NonEmpty b → Specification a Source #

propagate ∷ ∀ (as ∷ [Type]) b a. (AppRequires MapW as b, HasSpec a) ⇒ MapW as b → ListCtx Value as (HOLE a) → Specification b → Specification a Source #

rewriteRules ∷ ∀ (dom ∷ [Type]) rng. (TypeList dom, Typeable dom, HasSpec rng, All HasSpec dom) ⇒ MapW dom rng → List Term dom → Evidence (AppRequires MapW dom rng) → Maybe (Term rng) Source #

mapTypeSpec ∷ (HasSpec a, HasSpec b) ⇒ MapW '[a] b → TypeSpec a → Specification b Source #

saturate ∷ ∀ (dom ∷ [Type]). MapW dom BoolList Term dom → [Pred] Source #

Logic SetW Source # 
Instance details

Defined in Constrained.Spec.Set

Methods

propagateTypeSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires SetW as b, HasSpec a) ⇒ SetW as b → ListCtx Value as (HOLE a) → TypeSpec b → [b] → Specification a Source #

propagateMemberSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires SetW as b, HasSpec a) ⇒ SetW as b → ListCtx Value as (HOLE a) → NonEmpty b → Specification a Source #

propagate ∷ ∀ (as ∷ [Type]) b a. (AppRequires SetW as b, HasSpec a) ⇒ SetW as b → ListCtx Value as (HOLE a) → Specification b → Specification a Source #

rewriteRules ∷ ∀ (dom ∷ [Type]) rng. (TypeList dom, Typeable dom, HasSpec rng, All HasSpec dom) ⇒ SetW dom rng → List Term dom → Evidence (AppRequires SetW dom rng) → Maybe (Term rng) Source #

mapTypeSpec ∷ (HasSpec a, HasSpec b) ⇒ SetW '[a] b → TypeSpec a → Specification b Source #

saturate ∷ ∀ (dom ∷ [Type]). SetW dom BoolList Term dom → [Pred] Source #

Logic TreeW Source # 
Instance details

Defined in Constrained.Spec.Tree

Methods

propagateTypeSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires TreeW as b, HasSpec a) ⇒ TreeW as b → ListCtx Value as (HOLE a) → TypeSpec b → [b] → Specification a Source #

propagateMemberSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires TreeW as b, HasSpec a) ⇒ TreeW as b → ListCtx Value as (HOLE a) → NonEmpty b → Specification a Source #

propagate ∷ ∀ (as ∷ [Type]) b a. (AppRequires TreeW as b, HasSpec a) ⇒ TreeW as b → ListCtx Value as (HOLE a) → Specification b → Specification a Source #

rewriteRules ∷ ∀ (dom ∷ [Type]) rng. (TypeList dom, Typeable dom, HasSpec rng, All HasSpec dom) ⇒ TreeW dom rng → List Term dom → Evidence (AppRequires TreeW dom rng) → Maybe (Term rng) Source #

mapTypeSpec ∷ (HasSpec a, HasSpec b) ⇒ TreeW '[a] b → TypeSpec a → Specification b Source #

saturate ∷ ∀ (dom ∷ [Type]). TreeW dom BoolList Term dom → [Pred] Source #

Logic BoolW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

propagateTypeSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires BoolW as b, HasSpec a) ⇒ BoolW as b → ListCtx Value as (HOLE a) → TypeSpec b → [b] → Specification a Source #

propagateMemberSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires BoolW as b, HasSpec a) ⇒ BoolW as b → ListCtx Value as (HOLE a) → NonEmpty b → Specification a Source #

propagate ∷ ∀ (as ∷ [Type]) b a. (AppRequires BoolW as b, HasSpec a) ⇒ BoolW as b → ListCtx Value as (HOLE a) → Specification b → Specification a Source #

rewriteRules ∷ ∀ (dom ∷ [Type]) rng. (TypeList dom, Typeable dom, HasSpec rng, All HasSpec dom) ⇒ BoolW dom rng → List Term dom → Evidence (AppRequires BoolW dom rng) → Maybe (Term rng) Source #

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

saturate ∷ ∀ (dom ∷ [Type]). BoolW dom BoolList Term dom → [Pred] Source #

Logic ElemW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

propagateTypeSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires ElemW as b, HasSpec a) ⇒ ElemW as b → ListCtx Value as (HOLE a) → TypeSpec b → [b] → Specification a Source #

propagateMemberSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires ElemW as b, HasSpec a) ⇒ ElemW as b → ListCtx Value as (HOLE a) → NonEmpty b → Specification a Source #

propagate ∷ ∀ (as ∷ [Type]) b a. (AppRequires ElemW as b, HasSpec a) ⇒ ElemW as b → ListCtx Value as (HOLE a) → Specification b → Specification a Source #

rewriteRules ∷ ∀ (dom ∷ [Type]) rng. (TypeList dom, Typeable dom, HasSpec rng, All HasSpec dom) ⇒ ElemW dom rng → List Term dom → Evidence (AppRequires ElemW dom rng) → Maybe (Term rng) Source #

mapTypeSpec ∷ (HasSpec a, HasSpec b) ⇒ ElemW '[a] b → TypeSpec a → Specification b Source #

saturate ∷ ∀ (dom ∷ [Type]). ElemW dom BoolList Term dom → [Pred] Source #

Logic EqW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

propagateTypeSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires EqW as b, HasSpec a) ⇒ EqW as b → ListCtx Value as (HOLE a) → TypeSpec b → [b] → Specification a Source #

propagateMemberSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires EqW as b, HasSpec a) ⇒ EqW as b → ListCtx Value as (HOLE a) → NonEmpty b → Specification a Source #

propagate ∷ ∀ (as ∷ [Type]) b a. (AppRequires EqW as b, HasSpec a) ⇒ EqW as b → ListCtx Value as (HOLE a) → Specification b → Specification a Source #

rewriteRules ∷ ∀ (dom ∷ [Type]) rng. (TypeList dom, Typeable dom, HasSpec rng, All HasSpec dom) ⇒ EqW dom rng → List Term dom → Evidence (AppRequires EqW dom rng) → Maybe (Term rng) Source #

mapTypeSpec ∷ (HasSpec a, HasSpec b) ⇒ EqW '[a] b → TypeSpec a → Specification b Source #

saturate ∷ ∀ (dom ∷ [Type]). EqW dom BoolList Term dom → [Pred] Source #

Logic FunW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

propagateTypeSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires FunW as b, HasSpec a) ⇒ FunW as b → ListCtx Value as (HOLE a) → TypeSpec b → [b] → Specification a Source #

propagateMemberSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires FunW as b, HasSpec a) ⇒ FunW as b → ListCtx Value as (HOLE a) → NonEmpty b → Specification a Source #

propagate ∷ ∀ (as ∷ [Type]) b a. (AppRequires FunW as b, HasSpec a) ⇒ FunW as b → ListCtx Value as (HOLE a) → Specification b → Specification a Source #

rewriteRules ∷ ∀ (dom ∷ [Type]) rng. (TypeList dom, Typeable dom, HasSpec rng, All HasSpec dom) ⇒ FunW dom rng → List Term dom → Evidence (AppRequires FunW dom rng) → Maybe (Term rng) Source #

mapTypeSpec ∷ (HasSpec a, HasSpec b) ⇒ FunW '[a] b → TypeSpec a → Specification b Source #

saturate ∷ ∀ (dom ∷ [Type]). FunW dom BoolList Term dom → [Pred] Source #

Logic ListW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

propagateTypeSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires ListW as b, HasSpec a) ⇒ ListW as b → ListCtx Value as (HOLE a) → TypeSpec b → [b] → Specification a Source #

propagateMemberSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires ListW as b, HasSpec a) ⇒ ListW as b → ListCtx Value as (HOLE a) → NonEmpty b → Specification a Source #

propagate ∷ ∀ (as ∷ [Type]) b a. (AppRequires ListW as b, HasSpec a) ⇒ ListW as b → ListCtx Value as (HOLE a) → Specification b → Specification a Source #

rewriteRules ∷ ∀ (dom ∷ [Type]) rng. (TypeList dom, Typeable dom, HasSpec rng, All HasSpec dom) ⇒ ListW dom rng → List Term dom → Evidence (AppRequires ListW dom rng) → Maybe (Term rng) Source #

mapTypeSpec ∷ (HasSpec a, HasSpec b) ⇒ ListW '[a] b → TypeSpec a → Specification b Source #

saturate ∷ ∀ (dom ∷ [Type]). ListW dom BoolList Term dom → [Pred] Source #

Logic ProdW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

propagateTypeSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires ProdW as b, HasSpec a) ⇒ ProdW as b → ListCtx Value as (HOLE a) → TypeSpec b → [b] → Specification a Source #

propagateMemberSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires ProdW as b, HasSpec a) ⇒ ProdW as b → ListCtx Value as (HOLE a) → NonEmpty b → Specification a Source #

propagate ∷ ∀ (as ∷ [Type]) b a. (AppRequires ProdW as b, HasSpec a) ⇒ ProdW as b → ListCtx Value as (HOLE a) → Specification b → Specification a Source #

rewriteRules ∷ ∀ (dom ∷ [Type]) rng. (TypeList dom, Typeable dom, HasSpec rng, All HasSpec dom) ⇒ ProdW dom rng → List Term dom → Evidence (AppRequires ProdW dom rng) → Maybe (Term rng) Source #

mapTypeSpec ∷ (HasSpec a, HasSpec b) ⇒ ProdW '[a] b → TypeSpec a → Specification b Source #

saturate ∷ ∀ (dom ∷ [Type]). ProdW dom BoolList Term dom → [Pred] Source #

Logic SizeW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

propagateTypeSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires SizeW as b, HasSpec a) ⇒ SizeW as b → ListCtx Value as (HOLE a) → TypeSpec b → [b] → Specification a Source #

propagateMemberSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires SizeW as b, HasSpec a) ⇒ SizeW as b → ListCtx Value as (HOLE a) → NonEmpty b → Specification a Source #

propagate ∷ ∀ (as ∷ [Type]) b a. (AppRequires SizeW as b, HasSpec a) ⇒ SizeW as b → ListCtx Value as (HOLE a) → Specification b → Specification a Source #

rewriteRules ∷ ∀ (dom ∷ [Type]) rng. (TypeList dom, Typeable dom, HasSpec rng, All HasSpec dom) ⇒ SizeW dom rng → List Term dom → Evidence (AppRequires SizeW dom rng) → Maybe (Term rng) Source #

mapTypeSpec ∷ (HasSpec a, HasSpec b) ⇒ SizeW '[a] b → TypeSpec a → Specification b Source #

saturate ∷ ∀ (dom ∷ [Type]). SizeW dom BoolList Term dom → [Pred] Source #

Logic SumW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

propagateTypeSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires SumW as b, HasSpec a) ⇒ SumW as b → ListCtx Value as (HOLE a) → TypeSpec b → [b] → Specification a Source #

propagateMemberSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires SumW as b, HasSpec a) ⇒ SumW as b → ListCtx Value as (HOLE a) → NonEmpty b → Specification a Source #

propagate ∷ ∀ (as ∷ [Type]) b a. (AppRequires SumW as b, HasSpec a) ⇒ SumW as b → ListCtx Value as (HOLE a) → Specification b → Specification a Source #

rewriteRules ∷ ∀ (dom ∷ [Type]) rng. (TypeList dom, Typeable dom, HasSpec rng, All HasSpec dom) ⇒ SumW dom rng → List Term dom → Evidence (AppRequires SumW dom rng) → Maybe (Term rng) Source #

mapTypeSpec ∷ (HasSpec a, HasSpec b) ⇒ SumW '[a] b → TypeSpec a → Specification b Source #

saturate ∷ ∀ (dom ∷ [Type]). SumW dom BoolList Term dom → [Pred] Source #

class Semantics (t ∷ [Type] → TypeType) where Source #

Semantic operations are ones that give the function symbol, meaning as a function. I.e. how to apply the function to a list of arguments and return a value.

Methods

semantics ∷ t d r → FunTy d r Source #

Instances

Instances details
Semantics BaseW Source # 
Instance details

Defined in Constrained.Base

Methods

semantics ∷ ∀ (d ∷ [Type]) r. BaseW d r → FunTy d r Source #

Semantics IntW Source # 
Instance details

Defined in Constrained.NumSpec

Methods

semantics ∷ ∀ (d ∷ [Type]) r. IntW d r → FunTy d r Source #

Semantics NumOrdW Source # 
Instance details

Defined in Constrained.NumSpec

Methods

semantics ∷ ∀ (d ∷ [Type]) r. NumOrdW d r → FunTy d r Source #

Semantics MapW Source # 
Instance details

Defined in Constrained.Spec.Map

Methods

semantics ∷ ∀ (d ∷ [Type]) r. MapW d r → FunTy d r Source #

Semantics SetW Source # 
Instance details

Defined in Constrained.Spec.Set

Methods

semantics ∷ ∀ (d ∷ [Type]) r. SetW d r → FunTy d r Source #

Semantics TreeW Source # 
Instance details

Defined in Constrained.Spec.Tree

Methods

semantics ∷ ∀ (d ∷ [Type]) r. TreeW d r → FunTy d r Source #

Semantics BoolW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

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

Semantics ElemW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

semantics ∷ ∀ (d ∷ [Type]) r. ElemW d r → FunTy d r Source #

Semantics EqW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

semantics ∷ ∀ (d ∷ [Type]) r. EqW d r → FunTy d r Source #

Semantics FunW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

semantics ∷ ∀ (d ∷ [Type]) r. FunW d r → FunTy d r Source #

Semantics ListW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

semantics ∷ ∀ (d ∷ [Type]) r. ListW d r → FunTy d r Source #

Semantics ProdW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

semantics ∷ ∀ (d ∷ [Type]) r. ProdW d r → FunTy d r Source #

Semantics SizeW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

semantics ∷ ∀ (d ∷ [Type]) r. SizeW d r → FunTy d r Source #

Semantics SumW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

semantics ∷ ∀ (d ∷ [Type]) r. SumW d r → FunTy d r Source #

class Syntax (t ∷ [Type] → TypeType) where Source #

Syntactic operations are ones that have to do with the structure and appearence of the type. See DependencyInjection to better understand deps - it's a pointer to postpone having to define HasSpec and friends here.

Minimal complete definition

Nothing

Methods

isInfix ∷ t dom rng → Bool Source #

prettySymbol ∷ ∀ deps dom rng ann. t dom rng → List (TermD deps) dom → IntMaybe (Doc ann) Source #

Instances

Instances details
Syntax BaseW Source # 
Instance details

Defined in Constrained.Base

Methods

isInfix ∷ ∀ (dom ∷ [Type]) rng. BaseW dom rng → Bool Source #

prettySymbol ∷ ∀ deps (dom ∷ [Type]) rng ann. BaseW dom rng → List (TermD deps) dom → IntMaybe (Doc ann) Source #

Syntax IntW Source # 
Instance details

Defined in Constrained.NumSpec

Methods

isInfix ∷ ∀ (dom ∷ [Type]) rng. IntW dom rng → Bool Source #

prettySymbol ∷ ∀ deps (dom ∷ [Type]) rng ann. IntW dom rng → List (TermD deps) dom → IntMaybe (Doc ann) Source #

Syntax NumOrdW Source # 
Instance details

Defined in Constrained.NumSpec

Methods

isInfix ∷ ∀ (dom ∷ [Type]) rng. NumOrdW dom rng → Bool Source #

prettySymbol ∷ ∀ deps (dom ∷ [Type]) rng ann. NumOrdW dom rng → List (TermD deps) dom → IntMaybe (Doc ann) Source #

Syntax MapW Source # 
Instance details

Defined in Constrained.Spec.Map

Methods

isInfix ∷ ∀ (dom ∷ [Type]) rng. MapW dom rng → Bool Source #

prettySymbol ∷ ∀ deps (dom ∷ [Type]) rng ann. MapW dom rng → List (TermD deps) dom → IntMaybe (Doc ann) Source #

Syntax SetW Source # 
Instance details

Defined in Constrained.Spec.Set

Methods

isInfix ∷ ∀ (dom ∷ [Type]) rng. SetW dom rng → Bool Source #

prettySymbol ∷ ∀ deps (dom ∷ [Type]) rng ann. SetW dom rng → List (TermD deps) dom → IntMaybe (Doc ann) Source #

Syntax TreeW Source # 
Instance details

Defined in Constrained.Spec.Tree

Methods

isInfix ∷ ∀ (dom ∷ [Type]) rng. TreeW dom rng → Bool Source #

prettySymbol ∷ ∀ deps (dom ∷ [Type]) rng ann. TreeW dom rng → List (TermD deps) dom → IntMaybe (Doc ann) Source #

Syntax BoolW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

isInfix ∷ ∀ (dom ∷ [Type]) rng. BoolW dom rng → Bool Source #

prettySymbol ∷ ∀ deps (dom ∷ [Type]) rng ann. BoolW dom rng → List (TermD deps) dom → IntMaybe (Doc ann) Source #

Syntax ElemW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

isInfix ∷ ∀ (dom ∷ [Type]) rng. ElemW dom rng → Bool Source #

prettySymbol ∷ ∀ deps (dom ∷ [Type]) rng ann. ElemW dom rng → List (TermD deps) dom → IntMaybe (Doc ann) Source #

Syntax EqW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

isInfix ∷ ∀ (dom ∷ [Type]) rng. EqW dom rng → Bool Source #

prettySymbol ∷ ∀ deps (dom ∷ [Type]) rng ann. EqW dom rng → List (TermD deps) dom → IntMaybe (Doc ann) Source #

Syntax FunW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

isInfix ∷ ∀ (dom ∷ [Type]) rng. FunW dom rng → Bool Source #

prettySymbol ∷ ∀ deps (dom ∷ [Type]) rng ann. FunW dom rng → List (TermD deps) dom → IntMaybe (Doc ann) Source #

Syntax ListW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

isInfix ∷ ∀ (dom ∷ [Type]) rng. ListW dom rng → Bool Source #

prettySymbol ∷ ∀ deps (dom ∷ [Type]) rng ann. ListW dom rng → List (TermD deps) dom → IntMaybe (Doc ann) Source #

Syntax ProdW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

isInfix ∷ ∀ (dom ∷ [Type]) rng. ProdW dom rng → Bool Source #

prettySymbol ∷ ∀ deps (dom ∷ [Type]) rng ann. ProdW dom rng → List (TermD deps) dom → IntMaybe (Doc ann) Source #

Syntax SizeW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

isInfix ∷ ∀ (dom ∷ [Type]) rng. SizeW dom rng → Bool Source #

prettySymbol ∷ ∀ deps (dom ∷ [Type]) rng ann. SizeW dom rng → List (TermD deps) dom → IntMaybe (Doc ann) Source #

Syntax SumW Source # 
Instance details

Defined in Constrained.TheKnot

Methods

isInfix ∷ ∀ (dom ∷ [Type]) rng. SumW dom rng → Bool Source #

prettySymbol ∷ ∀ deps (dom ∷ [Type]) rng ann. SumW dom rng → List (TermD deps) dom → IntMaybe (Doc ann) Source #

class (HasSpec a, NumLike a, Logic IntW) ⇒ Foldy a where Source #

Minimal complete definition

genList, genSizedList, noNegativeValues

Instances

Instances details
Foldy Int16 Source # 
Instance details

Defined in Constrained.TheKnot

Foldy Int32 Source # 
Instance details

Defined in Constrained.TheKnot

Foldy Int64 Source # 
Instance details

Defined in Constrained.TheKnot

Foldy Int8 Source # 
Instance details

Defined in Constrained.TheKnot

Foldy Word16 Source # 
Instance details

Defined in Constrained.TheKnot

Foldy Word32 Source # 
Instance details

Defined in Constrained.TheKnot

Foldy Word64 Source # 
Instance details

Defined in Constrained.TheKnot

Foldy Word8 Source # 
Instance details

Defined in Constrained.TheKnot

Foldy Integer Source # 
Instance details

Defined in Constrained.TheKnot

Foldy Natural Source # 
Instance details

Defined in Constrained.TheKnot

Foldy Int Source # 
Instance details

Defined in Constrained.TheKnot

data NumSpec n Source #

Constructors

NumSpecInterval (Maybe n) (Maybe n) 

Instances

Instances details
(Arbitrary a, Ord a) ⇒ Arbitrary (NumSpec a) Source # 
Instance details

Defined in Constrained.NumSpec

Methods

arbitraryGen (NumSpec a) Source #

shrinkNumSpec a → [NumSpec a] Source #

Ord n ⇒ Monoid (NumSpec n) Source # 
Instance details

Defined in Constrained.NumSpec

Methods

memptyNumSpec n #

mappendNumSpec n → NumSpec n → NumSpec n #

mconcat ∷ [NumSpec n] → NumSpec n #

Ord n ⇒ Semigroup (NumSpec n) Source # 
Instance details

Defined in Constrained.NumSpec

Methods

(<>)NumSpec n → NumSpec n → NumSpec n #

sconcatNonEmpty (NumSpec n) → NumSpec n #

stimesIntegral b ⇒ b → NumSpec n → NumSpec n #

Num (NumSpec Integer) Source # 
Instance details

Defined in Constrained.NumSpec

Show n ⇒ Show (NumSpec n) Source # 
Instance details

Defined in Constrained.NumSpec

Methods

showsPrecIntNumSpec n → ShowS #

showNumSpec n → String #

showList ∷ [NumSpec n] → ShowS #

Ord n ⇒ Eq (NumSpec n) Source # 
Instance details

Defined in Constrained.NumSpec

Methods

(==)NumSpec n → NumSpec n → Bool #

(/=)NumSpec n → NumSpec n → Bool #

class MaybeBounded a where Source #

Minimal complete definition

Nothing

Methods

lowerBoundMaybe a Source #

default lowerBoundBounded a ⇒ Maybe a Source #

upperBoundMaybe a Source #

default upperBoundBounded a ⇒ Maybe a Source #

Instances

Instances details
MaybeBounded Int16 Source # 
Instance details

Defined in Constrained.NumSpec

MaybeBounded Int32 Source # 
Instance details

Defined in Constrained.NumSpec

MaybeBounded Int64 Source # 
Instance details

Defined in Constrained.NumSpec

MaybeBounded Int8 Source # 
Instance details

Defined in Constrained.NumSpec

MaybeBounded Word16 Source # 
Instance details

Defined in Constrained.NumSpec

MaybeBounded Word32 Source # 
Instance details

Defined in Constrained.NumSpec

MaybeBounded Word64 Source # 
Instance details

Defined in Constrained.NumSpec

MaybeBounded Word8 Source # 
Instance details

Defined in Constrained.NumSpec

MaybeBounded Integer Source # 
Instance details

Defined in Constrained.NumSpec

MaybeBounded Natural Source # 
Instance details

Defined in Constrained.NumSpec

MaybeBounded Float Source # 
Instance details

Defined in Constrained.NumSpec

MaybeBounded Int Source # 
Instance details

Defined in Constrained.NumSpec

MaybeBounded (Ratio Integer) Source # 
Instance details

Defined in Constrained.NumSpec

MaybeBounded (Unbounded a) Source # 
Instance details

Defined in Constrained.NumSpec

data NonEmpty a #

Non-empty (and non-strict) list type.

Since: base-4.9.0.0

Constructors

a :| [a] infixr 5 

Instances

Instances details
Foldable NonEmpty

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

foldMonoid m ⇒ NonEmpty m → m #

foldMapMonoid m ⇒ (a → m) → NonEmpty a → m #

foldMap'Monoid m ⇒ (a → m) → NonEmpty a → m #

foldr ∷ (a → b → b) → b → NonEmpty a → b #

foldr' ∷ (a → b → b) → b → NonEmpty a → b #

foldl ∷ (b → a → b) → b → NonEmpty a → b #

foldl' ∷ (b → a → b) → b → NonEmpty a → b #

foldr1 ∷ (a → a → a) → NonEmpty a → a #

foldl1 ∷ (a → a → a) → NonEmpty a → a #

toListNonEmpty a → [a] #

nullNonEmpty a → Bool #

lengthNonEmpty a → Int #

elemEq a ⇒ a → NonEmpty a → Bool #

maximumOrd a ⇒ NonEmpty a → a #

minimumOrd a ⇒ NonEmpty a → a #

sumNum a ⇒ NonEmpty a → a #

productNum a ⇒ NonEmpty a → a #

Traversable NonEmpty

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverseApplicative f ⇒ (a → f b) → NonEmpty a → f (NonEmpty b) #

sequenceAApplicative f ⇒ NonEmpty (f a) → f (NonEmpty a) #

mapMMonad m ⇒ (a → m b) → NonEmpty a → m (NonEmpty b) #

sequenceMonad m ⇒ NonEmpty (m a) → m (NonEmpty a) #

Applicative NonEmpty

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

pure ∷ a → NonEmpty a #

(<*>)NonEmpty (a → b) → NonEmpty a → NonEmpty b #

liftA2 ∷ (a → b → c) → NonEmpty a → NonEmpty b → NonEmpty c #

(*>)NonEmpty a → NonEmpty b → NonEmpty b #

(<*)NonEmpty a → NonEmpty b → NonEmpty a #

Functor NonEmpty

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

fmap ∷ (a → b) → NonEmpty a → NonEmpty b #

(<$) ∷ a → NonEmpty b → NonEmpty a #

Monad NonEmpty

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(>>=)NonEmpty a → (a → NonEmpty b) → NonEmpty b #

(>>)NonEmpty a → NonEmpty b → NonEmpty b #

return ∷ a → NonEmpty a #

NFData1 NonEmpty

Since: deepseq-1.4.3.0

Instance details

Defined in Control.DeepSeq

Methods

liftRnf ∷ (a → ()) → NonEmpty a → () #

Generic1 NonEmpty 
Instance details

Defined in GHC.Generics

Associated Types

type Rep1 NonEmpty ∷ k → Type #

Methods

from1 ∷ ∀ (a ∷ k). NonEmpty a → Rep1 NonEmpty a #

to1 ∷ ∀ (a ∷ k). Rep1 NonEmpty a → NonEmpty a #

Lift a ⇒ Lift (NonEmpty a ∷ Type)

Since: template-haskell-2.15.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

liftQuote m ⇒ NonEmpty a → m Exp #

liftTyped ∷ ∀ (m ∷ TypeType). Quote m ⇒ NonEmpty a → Code m (NonEmpty a) #

Arbitrary a ⇒ Arbitrary (NonEmpty a) Source # 
Instance details

Defined in Constrained.Core

Semigroup (NonEmpty a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(<>)NonEmpty a → NonEmpty a → NonEmpty a #

sconcatNonEmpty (NonEmpty a) → NonEmpty a #

stimesIntegral b ⇒ b → NonEmpty a → NonEmpty a #

Generic (NonEmpty a) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (NonEmpty a) ∷ TypeType #

Methods

fromNonEmpty a → Rep (NonEmpty a) x #

toRep (NonEmpty a) x → NonEmpty a #

IsList (NonEmpty a)

Since: base-4.9.0.0

Instance details

Defined in GHC.IsList

Associated Types

type Item (NonEmpty a) #

Methods

fromList ∷ [Item (NonEmpty a)] → NonEmpty a #

fromListNInt → [Item (NonEmpty a)] → NonEmpty a #

toListNonEmpty a → [Item (NonEmpty a)] #

Read a ⇒ Read (NonEmpty a)

Since: base-4.11.0.0

Instance details

Defined in GHC.Read

Show a ⇒ Show (NonEmpty a)

Since: base-4.11.0.0

Instance details

Defined in GHC.Show

Methods

showsPrecIntNonEmpty a → ShowS #

showNonEmpty a → String #

showList ∷ [NonEmpty a] → ShowS #

NFData a ⇒ NFData (NonEmpty a)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnfNonEmpty a → () #

Eq a ⇒ Eq (NonEmpty a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(==)NonEmpty a → NonEmpty a → Bool #

(/=)NonEmpty a → NonEmpty a → Bool #

Ord a ⇒ Ord (NonEmpty a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

compareNonEmpty a → NonEmpty a → Ordering #

(<)NonEmpty a → NonEmpty a → Bool #

(<=)NonEmpty a → NonEmpty a → Bool #

(>)NonEmpty a → NonEmpty a → Bool #

(>=)NonEmpty a → NonEmpty a → Bool #

maxNonEmpty a → NonEmpty a → NonEmpty a #

minNonEmpty a → NonEmpty a → NonEmpty a #

Pretty a ⇒ Pretty (NonEmpty a) 
Instance details

Defined in Prettyprinter.Internal

Methods

prettyNonEmpty a → Doc ann Source #

prettyList ∷ [NonEmpty a] → Doc ann Source #

type Rep1 NonEmpty

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

type Rep (NonEmpty a)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

type Item (NonEmpty a) 
Instance details

Defined in GHC.IsList

type Item (NonEmpty a) = a

pattern TypeSpec ∷ () ⇒ HasSpec a ⇒ TypeSpec a → [a] → Specification a Source #

data Fun dom rng where Source #

Constructors

Fun ∷ ∀ t dom rng. AppRequires t dom rng ⇒ t dom rng → Fun dom rng 

Instances

Instances details
Show (Fun dom r) Source # 
Instance details

Defined in Constrained.Base

Methods

showsPrecIntFun dom r → ShowS #

showFun dom r → String #

showList ∷ [Fun dom r] → ShowS #

Eq (Fun d r) Source # 
Instance details

Defined in Constrained.Base

Methods

(==)Fun d r → Fun d r → Bool #

(/=)Fun d r → Fun d r → Bool #

nameStringTerm a → Term a Source #

namedStringTerm a → Term a Source #

Give a Term a nameHint, if its a Var, and doesn't already have one, otherwise return the Term unchanged.

class (Typeable a, Eq a, Show a, TypeSpecEqShow a) ⇒ HasSpec a where Source #

Minimal complete definition

Nothing

Associated Types

type TypeSpec a Source #

The `TypeSpec a` is the type-specific `Specification a`.

type Prerequisites a ∷ Constraint Source #

Prerequisites for the instance that are sometimes necessary when working with e.g. Specifications or functions in the universe.

type Prerequisites a = ()

Methods

emptySpecTypeSpec a Source #

combineSpecTypeSpec a → TypeSpec a → Specification a Source #

genFromTypeSpec ∷ (HasCallStack, MonadGenError m) ⇒ TypeSpec a → GenT m a Source #

Generate a value that satisfies the HasSpec. The key property for this generator is soundness: ∀ a ∈ genFromTypeSpec spec. a conformsTo spec

conformsToHasCallStack ⇒ a → TypeSpec a → Bool Source #

Check conformance to the spec.

shrinkWithTypeSpecTypeSpec a → a → [a] Source #

Shrink an a with the aide of a HasSpec

default shrinkWithTypeSpecGenericallyInstantiated a ⇒ TypeSpec a → a → [a] Source #

toPredsTerm a → TypeSpec a → Pred Source #

Convert a spec to predicates: The key property here is: ∀ a. a conformsTo spec == a conformsTo constrained (t -> toPreds t spec)

default toPredsGenericallyInstantiated a ⇒ Term a → TypeSpec a → Pred Source #

cardinalTypeSpecTypeSpec a → Specification Integer Source #

Compute an upper and lower bound on the number of solutions genFromTypeSpec might return

cardinalTrueSpecSpecification Integer Source #

A bound on the number of solutions `genFromTypeSpec TrueSpec` can produce. For a type with finite elements, we can get a much more accurate answer than TrueSpec

typeSpecHasErrorTypeSpec a → Maybe (NonEmpty String) Source #

alternateShowTypeSpec a → BinaryShow Source #

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

typeSpecOptTypeSpec a → [a] → Specification a Source #

For some types (especially finite ones) there may be much better ways to construct a Specification than the default method of just adding a large bad list to TypSpec. This function allows each HasSpec instance to decide.

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

This can be used to detect self inconsistencies in a (TypeSpec t) Note this is similar to typeSpecHasError, and the default value for typeSpecHasError is written in terms of guardTypeSpec Both typeSpecHasError and guardTypeSpec can be set individually.

prerequisitesEvidence (Prerequisites a) Source #

Materialize the Prerequisites dictionary. It should not be necessary to implement this function manually.

Instances

Instances details
HasSpec Int16 Source # 
Instance details

Defined in Constrained.TheKnot

Associated Types

type TypeSpec Int16 Source #

type Prerequisites Int16 Source #

HasSpec Int32 Source # 
Instance details

Defined in Constrained.TheKnot

Associated Types

type TypeSpec Int32 Source #

type Prerequisites Int32 Source #

HasSpec Int64 Source # 
Instance details

Defined in Constrained.TheKnot

Associated Types

type TypeSpec Int64 Source #

type Prerequisites Int64 Source #

HasSpec Int8 Source # 
Instance details

Defined in Constrained.TheKnot

Associated Types

type TypeSpec Int8 Source #

type Prerequisites Int8 Source #

HasSpec Word16 Source # 
Instance details

Defined in Constrained.TheKnot

Associated Types

type TypeSpec Word16 Source #

type Prerequisites Word16 Source #

HasSpec Word32 Source # 
Instance details

Defined in Constrained.TheKnot

Associated Types

type TypeSpec Word32 Source #

type Prerequisites Word32 Source #

HasSpec Word64 Source # 
Instance details

Defined in Constrained.TheKnot

Associated Types

type TypeSpec Word64 Source #

type Prerequisites Word64 Source #

HasSpec Word8 Source # 
Instance details

Defined in Constrained.TheKnot

Associated Types

type TypeSpec Word8 Source #

type Prerequisites Word8 Source #

HasSpec Foo Source # 
Instance details

Defined in Constrained.Examples.Basic

Associated Types

type TypeSpec Foo Source #

type Prerequisites Foo Source #

HasSpec Three Source # 
Instance details

Defined in Constrained.Examples.Basic

Associated Types

type TypeSpec Three Source #

type Prerequisites Three Source #

HasSpec FooBarBaz Source # 
Instance details

Defined in Constrained.Examples.CheatSheet

HasSpec Integer Source # 
Instance details

Defined in Constrained.TheKnot

HasSpec Natural Source # 
Instance details

Defined in Constrained.TheKnot

HasSpec () Source # 
Instance details

Defined in Constrained.Base

Associated Types

type TypeSpec () Source #

type Prerequisites () Source #

HasSpec Bool Source # 
Instance details

Defined in Constrained.TheKnot

Associated Types

type TypeSpec Bool Source #

type Prerequisites Bool Source #

HasSpec Float Source # 
Instance details

Defined in Constrained.TheKnot

Associated Types

type TypeSpec Float Source #

type Prerequisites Float Source #

HasSpec Int Source # 
Instance details

Defined in Constrained.TheKnot

Associated Types

type TypeSpec Int Source #

type Prerequisites Int Source #

HasSpec (Ratio Integer) Source # 
Instance details

Defined in Constrained.TheKnot

(Ord a, HasSpec a) ⇒ HasSpec (NotASet a) Source # 
Instance details

Defined in Constrained.Examples.Set

Associated Types

type TypeSpec (NotASet a) Source #

type Prerequisites (NotASet a) Source #

HasSpec a ⇒ HasSpec (BinTree a) Source # 
Instance details

Defined in Constrained.Spec.Tree

Associated Types

type TypeSpec (BinTree a) Source #

type Prerequisites (BinTree a) Source #

(Ord a, HasSpec a) ⇒ HasSpec (Set a) Source # 
Instance details

Defined in Constrained.Spec.Set

Associated Types

type TypeSpec (Set a) Source #

type Prerequisites (Set a) Source #

HasSpec a ⇒ HasSpec (Tree a) Source # 
Instance details

Defined in Constrained.Spec.Tree

Associated Types

type TypeSpec (Tree a) Source #

type Prerequisites (Tree a) Source #

(IsNormalType a, HasSpec a) ⇒ HasSpec (Maybe a) Source # 
Instance details

Defined in Constrained.Spec.SumProd

Associated Types

type TypeSpec (Maybe a) Source #

type Prerequisites (Maybe a) Source #

(Sized [a], HasSpec a) ⇒ HasSpec [a] Source # 
Instance details

Defined in Constrained.TheKnot

Associated Types

type TypeSpec [a] Source #

type Prerequisites [a] Source #

(HasSpec a, IsNormalType a, HasSpec b, IsNormalType b) ⇒ HasSpec (Either a b) Source # 
Instance details

Defined in Constrained.Spec.SumProd

Associated Types

type TypeSpec (Either a b) Source #

type Prerequisites (Either a b) Source #

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

Defined in Constrained.TheKnot

Associated Types

type TypeSpec (Prod a b) Source #

type Prerequisites (Prod a b) Source #

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

The HasSpec Sum instance

Instance details

Defined in Constrained.TheKnot

Associated Types

type TypeSpec (Sum a b) Source #

type Prerequisites (Sum a b) Source #

(Ord k, HasSpec (Prod k v), HasSpec k, HasSpec v, HasSpec [v], IsNormalType k, IsNormalType v) ⇒ HasSpec (Map k v) Source # 
Instance details

Defined in Constrained.Spec.Map

Associated Types

type TypeSpec (Map k v) Source #

type Prerequisites (Map k v) Source #

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

Defined in Constrained.Spec.SumProd

Associated Types

type TypeSpec (a, b) Source #

type Prerequisites (a, b) Source #

Methods

emptySpecTypeSpec (a, b) Source #

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

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

conformsTo ∷ (a, b) → TypeSpec (a, b) → Bool Source #

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

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

cardinalTypeSpecTypeSpec (a, b) → Specification Integer Source #

cardinalTrueSpecSpecification Integer Source #

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

alternateShowTypeSpec (a, b) → BinaryShow Source #

monadConformsTo ∷ (a, b) → TypeSpec (a, b) → Writer [String] Bool Source #

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

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

prerequisitesEvidence (Prerequisites (a, b)) Source #

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

Defined in Constrained.Spec.SumProd

Associated Types

type TypeSpec (a, b, c) Source #

type Prerequisites (a, b, c) Source #

Methods

emptySpecTypeSpec (a, b, c) Source #

combineSpecTypeSpec (a, b, c) → TypeSpec (a, b, c) → Specification (a, b, c) Source #

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

conformsTo ∷ (a, b, c) → TypeSpec (a, b, c) → Bool Source #

shrinkWithTypeSpecTypeSpec (a, b, c) → (a, b, c) → [(a, b, c)] Source #

toPredsTerm (a, b, c) → TypeSpec (a, b, c) → Pred Source #

cardinalTypeSpecTypeSpec (a, b, c) → Specification Integer Source #

cardinalTrueSpecSpecification Integer Source #

typeSpecHasErrorTypeSpec (a, b, c) → Maybe (NonEmpty String) Source #

alternateShowTypeSpec (a, b, c) → BinaryShow Source #

monadConformsTo ∷ (a, b, c) → TypeSpec (a, b, c) → Writer [String] Bool Source #

typeSpecOptTypeSpec (a, b, c) → [(a, b, c)] → Specification (a, b, c) Source #

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

prerequisitesEvidence (Prerequisites (a, b, c)) Source #

(HasSpec a, HasSpec b, HasSpec c, HasSpec d) ⇒ HasSpec (a, b, c, d) Source # 
Instance details

Defined in Constrained.Spec.SumProd

Associated Types

type TypeSpec (a, b, c, d) Source #

type Prerequisites (a, b, c, d) Source #

Methods

emptySpecTypeSpec (a, b, c, d) Source #

combineSpecTypeSpec (a, b, c, d) → TypeSpec (a, b, c, d) → Specification (a, b, c, d) Source #

genFromTypeSpec ∷ ∀ (m ∷ TypeType). (HasCallStack, MonadGenError m) ⇒ TypeSpec (a, b, c, d) → GenT m (a, b, c, d) Source #

conformsTo ∷ (a, b, c, d) → TypeSpec (a, b, c, d) → Bool Source #

shrinkWithTypeSpecTypeSpec (a, b, c, d) → (a, b, c, d) → [(a, b, c, d)] Source #

toPredsTerm (a, b, c, d) → TypeSpec (a, b, c, d) → Pred Source #

cardinalTypeSpecTypeSpec (a, b, c, d) → Specification Integer Source #

cardinalTrueSpecSpecification Integer Source #

typeSpecHasErrorTypeSpec (a, b, c, d) → Maybe (NonEmpty String) Source #

alternateShowTypeSpec (a, b, c, d) → BinaryShow Source #

monadConformsTo ∷ (a, b, c, d) → TypeSpec (a, b, c, d) → Writer [String] Bool Source #

typeSpecOptTypeSpec (a, b, c, d) → [(a, b, c, d)] → Specification (a, b, c, d) Source #

guardTypeSpec ∷ [String] → TypeSpec (a, b, c, d) → Specification (a, b, c, d) Source #

prerequisitesEvidence (Prerequisites (a, b, c, d)) Source #

(HasSpec a, HasSpec b, HasSpec c, HasSpec d, HasSpec e) ⇒ HasSpec (a, b, c, d, e) Source # 
Instance details

Defined in Constrained.Spec.SumProd

Associated Types

type TypeSpec (a, b, c, d, e) Source #

type Prerequisites (a, b, c, d, e) Source #

Methods

emptySpecTypeSpec (a, b, c, d, e) Source #

combineSpecTypeSpec (a, b, c, d, e) → TypeSpec (a, b, c, d, e) → Specification (a, b, c, d, e) Source #

genFromTypeSpec ∷ ∀ (m ∷ TypeType). (HasCallStack, MonadGenError m) ⇒ TypeSpec (a, b, c, d, e) → GenT m (a, b, c, d, e) Source #

conformsTo ∷ (a, b, c, d, e) → TypeSpec (a, b, c, d, e) → Bool Source #

shrinkWithTypeSpecTypeSpec (a, b, c, d, e) → (a, b, c, d, e) → [(a, b, c, d, e)] Source #

toPredsTerm (a, b, c, d, e) → TypeSpec (a, b, c, d, e) → Pred Source #

cardinalTypeSpecTypeSpec (a, b, c, d, e) → Specification Integer Source #

cardinalTrueSpecSpecification Integer Source #

typeSpecHasErrorTypeSpec (a, b, c, d, e) → Maybe (NonEmpty String) Source #

alternateShowTypeSpec (a, b, c, d, e) → BinaryShow Source #

monadConformsTo ∷ (a, b, c, d, e) → TypeSpec (a, b, c, d, e) → Writer [String] Bool Source #

typeSpecOptTypeSpec (a, b, c, d, e) → [(a, b, c, d, e)] → Specification (a, b, c, d, e) Source #

guardTypeSpec ∷ [String] → TypeSpec (a, b, c, d, e) → Specification (a, b, c, d, e) Source #

prerequisitesEvidence (Prerequisites (a, b, c, d, e)) Source #

(HasSpec a, HasSpec b, HasSpec c, HasSpec d, HasSpec e, HasSpec g) ⇒ HasSpec (a, b, c, d, e, g) Source # 
Instance details

Defined in Constrained.Spec.SumProd

Associated Types

type TypeSpec (a, b, c, d, e, g) Source #

type Prerequisites (a, b, c, d, e, g) Source #

Methods

emptySpecTypeSpec (a, b, c, d, e, g) Source #

combineSpecTypeSpec (a, b, c, d, e, g) → TypeSpec (a, b, c, d, e, g) → Specification (a, b, c, d, e, g) Source #

genFromTypeSpec ∷ ∀ (m ∷ TypeType). (HasCallStack, MonadGenError m) ⇒ TypeSpec (a, b, c, d, e, g) → GenT m (a, b, c, d, e, g) Source #

conformsTo ∷ (a, b, c, d, e, g) → TypeSpec (a, b, c, d, e, g) → Bool Source #

shrinkWithTypeSpecTypeSpec (a, b, c, d, e, g) → (a, b, c, d, e, g) → [(a, b, c, d, e, g)] Source #

toPredsTerm (a, b, c, d, e, g) → TypeSpec (a, b, c, d, e, g) → Pred Source #

cardinalTypeSpecTypeSpec (a, b, c, d, e, g) → Specification Integer Source #

cardinalTrueSpecSpecification Integer Source #

typeSpecHasErrorTypeSpec (a, b, c, d, e, g) → Maybe (NonEmpty String) Source #

alternateShowTypeSpec (a, b, c, d, e, g) → BinaryShow Source #

monadConformsTo ∷ (a, b, c, d, e, g) → TypeSpec (a, b, c, d, e, g) → Writer [String] Bool Source #

typeSpecOptTypeSpec (a, b, c, d, e, g) → [(a, b, c, d, e, g)] → Specification (a, b, c, d, e, g) Source #

guardTypeSpec ∷ [String] → TypeSpec (a, b, c, d, e, g) → Specification (a, b, c, d, e, g) Source #

prerequisitesEvidence (Prerequisites (a, b, c, d, e, g)) Source #

(HasSpec a, HasSpec b, HasSpec c, HasSpec d, HasSpec e, HasSpec g, HasSpec h) ⇒ HasSpec (a, b, c, d, e, g, h) Source # 
Instance details

Defined in Constrained.Spec.SumProd

Associated Types

type TypeSpec (a, b, c, d, e, g, h) Source #

type Prerequisites (a, b, c, d, e, g, h) Source #

Methods

emptySpecTypeSpec (a, b, c, d, e, g, h) Source #

combineSpecTypeSpec (a, b, c, d, e, g, h) → TypeSpec (a, b, c, d, e, g, h) → Specification (a, b, c, d, e, g, h) Source #

genFromTypeSpec ∷ ∀ (m ∷ TypeType). (HasCallStack, MonadGenError m) ⇒ TypeSpec (a, b, c, d, e, g, h) → GenT m (a, b, c, d, e, g, h) Source #

conformsTo ∷ (a, b, c, d, e, g, h) → TypeSpec (a, b, c, d, e, g, h) → Bool Source #

shrinkWithTypeSpecTypeSpec (a, b, c, d, e, g, h) → (a, b, c, d, e, g, h) → [(a, b, c, d, e, g, h)] Source #

toPredsTerm (a, b, c, d, e, g, h) → TypeSpec (a, b, c, d, e, g, h) → Pred Source #

cardinalTypeSpecTypeSpec (a, b, c, d, e, g, h) → Specification Integer Source #

cardinalTrueSpecSpecification Integer Source #

typeSpecHasErrorTypeSpec (a, b, c, d, e, g, h) → Maybe (NonEmpty String) Source #

alternateShowTypeSpec (a, b, c, d, e, g, h) → BinaryShow Source #

monadConformsTo ∷ (a, b, c, d, e, g, h) → TypeSpec (a, b, c, d, e, g, h) → Writer [String] Bool Source #

typeSpecOptTypeSpec (a, b, c, d, e, g, h) → [(a, b, c, d, e, g, h)] → Specification (a, b, c, d, e, g, h) Source #

guardTypeSpec ∷ [String] → TypeSpec (a, b, c, d, e, g, h) → Specification (a, b, c, d, e, g, h) Source #

prerequisitesEvidence (Prerequisites (a, b, c, d, e, g, h)) Source #

class Typeable (SimpleRep a) ⇒ HasSimpleRep a where Source #

Minimal complete definition

Nothing

Associated Types

type SimpleRep a Source #

type SimpleRep a = SOP (TheSop a)

type TheSop a ∷ [Type] Source #

type TheSop a = SOPOf (Rep a)

Methods

toSimpleRep ∷ a → SimpleRep a Source #

default toSimpleRep ∷ (Generic a, SimpleGeneric (Rep a), SimpleRep a ~ SimplifyRep (Rep a)) ⇒ a → SimpleRep a Source #

fromSimpleRepSimpleRep a → a Source #

Instances

Instances details
HasSimpleRep Foo Source # 
Instance details

Defined in Constrained.Examples.Basic

Associated Types

type SimpleRep Foo Source #

type TheSop Foo ∷ [Type] Source #

HasSimpleRep Three Source # 
Instance details

Defined in Constrained.Examples.Basic

Associated Types

type SimpleRep Three Source #

type TheSop Three ∷ [Type] Source #

HasSimpleRep FooBarBaz Source # 
Instance details

Defined in Constrained.Examples.CheatSheet

Associated Types

type SimpleRep FooBarBaz Source #

type TheSop FooBarBaz ∷ [Type] Source #

HasSimpleRep () Source # 
Instance details

Defined in Constrained.Generic

Associated Types

type SimpleRep () Source #

type TheSop () ∷ [Type] Source #

Methods

toSimpleRep ∷ () → SimpleRep () Source #

fromSimpleRepSimpleRep () → () Source #

HasSimpleRep Bool Source # 
Instance details

Defined in Constrained.Generic

Associated Types

type SimpleRep Bool Source #

type TheSop Bool ∷ [Type] Source #

(Typeable a, Ord a) ⇒ HasSimpleRep (NotASet a) Source # 
Instance details

Defined in Constrained.Examples.Set

Associated Types

type SimpleRep (NotASet a) Source #

type TheSop (NotASet a) ∷ [Type] Source #

Typeable a ⇒ HasSimpleRep (Maybe a) Source # 
Instance details

Defined in Constrained.Spec.SumProd

Associated Types

type SimpleRep (Maybe a) Source #

type TheSop (Maybe a) ∷ [Type] Source #

(Typeable a, Typeable b) ⇒ HasSimpleRep (Either a b) Source # 
Instance details

Defined in Constrained.Spec.SumProd

Associated Types

type SimpleRep (Either a b) Source #

type TheSop (Either a b) ∷ [Type] Source #

(Typeable a, Typeable b) ⇒ HasSimpleRep (a, b) Source # 
Instance details

Defined in Constrained.Spec.SumProd

Associated Types

type SimpleRep (a, b) Source #

type TheSop (a, b) ∷ [Type] Source #

Methods

toSimpleRep ∷ (a, b) → SimpleRep (a, b) Source #

fromSimpleRepSimpleRep (a, b) → (a, b) Source #

(Typeable a, Typeable b, Typeable c) ⇒ HasSimpleRep (a, b, c) Source # 
Instance details

Defined in Constrained.Spec.SumProd

Associated Types

type SimpleRep (a, b, c) Source #

type TheSop (a, b, c) ∷ [Type] Source #

Methods

toSimpleRep ∷ (a, b, c) → SimpleRep (a, b, c) Source #

fromSimpleRepSimpleRep (a, b, c) → (a, b, c) Source #

(Typeable a, Typeable b, Typeable c, Typeable d) ⇒ HasSimpleRep (a, b, c, d) Source # 
Instance details

Defined in Constrained.Spec.SumProd

Associated Types

type SimpleRep (a, b, c, d) Source #

type TheSop (a, b, c, d) ∷ [Type] Source #

Methods

toSimpleRep ∷ (a, b, c, d) → SimpleRep (a, b, c, d) Source #

fromSimpleRepSimpleRep (a, b, c, d) → (a, b, c, d) Source #

(Typeable a, Typeable b, Typeable c, Typeable d, Typeable e) ⇒ HasSimpleRep (a, b, c, d, e) Source # 
Instance details

Defined in Constrained.Spec.SumProd

Associated Types

type SimpleRep (a, b, c, d, e) Source #

type TheSop (a, b, c, d, e) ∷ [Type] Source #

Methods

toSimpleRep ∷ (a, b, c, d, e) → SimpleRep (a, b, c, d, e) Source #

fromSimpleRepSimpleRep (a, b, c, d, e) → (a, b, c, d, e) Source #

(Typeable a, Typeable b, Typeable c, Typeable d, Typeable e, Typeable g) ⇒ HasSimpleRep (a, b, c, d, e, g) Source # 
Instance details

Defined in Constrained.Spec.SumProd

Associated Types

type SimpleRep (a, b, c, d, e, g) Source #

type TheSop (a, b, c, d, e, g) ∷ [Type] Source #

Methods

toSimpleRep ∷ (a, b, c, d, e, g) → SimpleRep (a, b, c, d, e, g) Source #

fromSimpleRepSimpleRep (a, b, c, d, e, g) → (a, b, c, d, e, g) Source #

(Typeable a, Typeable b, Typeable c, Typeable d, Typeable e, Typeable g, Typeable h) ⇒ HasSimpleRep (a, b, c, d, e, g, h) Source # 
Instance details

Defined in Constrained.Spec.SumProd

Associated Types

type SimpleRep (a, b, c, d, e, g, h) Source #

type TheSop (a, b, c, d, e, g, h) ∷ [Type] Source #

Methods

toSimpleRep ∷ (a, b, c, d, e, g, h) → SimpleRep (a, b, c, d, e, g, h) Source #

fromSimpleRepSimpleRep (a, b, c, d, e, g, h) → (a, b, c, d, e, g, h) Source #

class (Ord a, HasSpec a) ⇒ OrdLike a where Source #

Minimal complete definition

Nothing

Methods

leqSpec ∷ a → Specification a Source #

default leqSpec ∷ (GenericRequires a, OrdLike (SimpleRep a)) ⇒ a → Specification a Source #

ltSpec ∷ a → Specification a Source #

default ltSpec ∷ (OrdLike (SimpleRep a), GenericRequires a) ⇒ a → Specification a Source #

geqSpec ∷ a → Specification a Source #

default geqSpec ∷ (OrdLike (SimpleRep a), GenericRequires a) ⇒ a → Specification a Source #

gtSpec ∷ a → Specification a Source #

default gtSpec ∷ (OrdLike (SimpleRep a), GenericRequires a) ⇒ a → Specification a Source #

Instances

Instances details
(Ord a, HasSpec a, MaybeBounded a, Num a, TypeSpec a ~ NumSpec a) ⇒ OrdLike a Source #

This instance should be general enough for every type of Number that has a NumSpec as its TypeSpec

Instance details

Defined in Constrained.NumSpec

conformsToSpecE ∷ ∀ a. HasSpec a ⇒ a → Specification a → NonEmpty StringMaybe (NonEmpty String) Source #

conformsToSpec with explanation. Nothing if (conformsToSpec a spec), but (Just explanations) if not(conformsToSpec a spec).

satisfies ∷ ∀ a. HasSpec a ⇒ Term a → Specification a → Pred Source #

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

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

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

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

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

cardinality ∷ ∀ a. (Number Integer, HasSpec a) ⇒ Specification a → Specification Integer Source #

Put some (admittedly loose bounds) on the number of solutions that genFromTypeSpec might return. For lots of types, there is no way to be very accurate. Here we lift the HasSpec methods cardinalTrueSpec and cardinalTypeSpec from (TypeSpec Integer) to (Specification Integer)

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 #

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

constrained ∷ ∀ a p. (IsPred p, HasSpec a) ⇒ (Term a → p) → Specification a Source #

assertIsPred p ⇒ p → Pred Source #

forAll ∷ (Forallable t a, HasSpec t, HasSpec a, IsPred p) ⇒ Term t → (Term a → p) → Pred Source #

exists ∷ ∀ a p. (HasSpec a, IsPred p) ⇒ ((∀ b. Term b → b) → GE a) → (Term a → p) → Pred Source #

unsafeExists ∷ ∀ a p. (HasSpec a, IsPred p) ⇒ (Term a → p) → Pred Source #

letBind ∷ (HasSpec a, IsPred p) ⇒ Term a → (Term a → p) → Pred Source #

reify ∷ (HasSpec a, HasSpec b, IsPred p) ⇒ Term a → (a → b) → (Term b → p) → Pred Source #

assertReified ∷ (HasSpec Bool, HasSpec a) ⇒ Term a → (a → Bool) → Pred Source #

requires (HasSpec Bool)

explanationNonEmpty StringPredPred Source #

Wrap an Explain around a Pred, unless there is a simpler form.

monitor ∷ ((∀ a. Term a → a) → PropertyProperty) → Pred Source #

Add QuickCheck monitoring (e.g. collect or counterexample) to a predicate. To use the monitoring in a property call monitorSpec on the Specification containing the monitoring and a value generated from the specification.

reifies ∷ (HasSpec a, HasSpec b) ⇒ Term b → Term a → (a → b) → Pred Source #

dependsOn ∷ (HasSpec a, HasSpec b) ⇒ Term a → Term b → Pred Source #

litHasSpec a ⇒ a → Term a Source #

genHint ∷ ∀ t. HasGenHint t ⇒ Hint t → Term t → Pred 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 #

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

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

(||.)Term BoolTerm BoolTerm Bool infixr 2 Source #

toGeneric_ ∷ ∀ a. GenericRequires a ⇒ Term a → Term (SimpleRep a) Source #

(+.)NumLike a ⇒ Term a → Term a → Term a infix 4 Source #

(-.)Numeric n ⇒ Term n → Term n → Term n infix 4 Source #

negate_NumLike a ⇒ Term a → Term a Source #

addFn ∷ ∀ a. NumLike a ⇒ Term a → Term a → Term a Source #

negateFn ∷ ∀ a. NumLike a ⇒ Term a → Term a Source #

pair_ ∷ (HasSpec a, HasSpec b, IsNormalType a, IsNormalType b) ⇒ Term a → Term b → Term (a, b) Source #

fst_ ∷ (HasSpec x, HasSpec y) ⇒ Term (x, y) → Term x Source #

snd_ ∷ (HasSpec x, HasSpec y) ⇒ Term (x, y) → Term y Source #

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

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

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

type IsNormalType a = (AssertComputes (Cases a) (Text "Failed to compute Cases in a use of IsNormalType for " :$$: (ShowType a :<>: Text ", are you missing an IsNormalType constraint?")), Cases a ~ '[a], AssertComputes (Args a) ((Text "Failed to compute Args in a use of IsNormalType for " :<>: ShowType a) :<>: Text ", are you missing an IsNormalType constraint?"), Args a ~ '[a], IsProd a, CountCases a ~ 1) Source #

injLeft_ ∷ (HasSpec a, HasSpec b, KnownNat (CountCases b)) ⇒ Term a → Term (Sum a b) Source #

injRight_ ∷ (HasSpec a, HasSpec b, KnownNat (CountCases b)) ⇒ Term b → Term (Sum a b) Source #

cJust_ ∷ (HasSpec a, IsNormalType a) ⇒ Term a → Term (Maybe a) Source #

caseOn ∷ ∀ a. (GenericRequires a, SimpleRep a ~ SumOver (Cases (SimpleRep a)), TypeList (Cases (SimpleRep a))) ⇒ Term a → FunTy (MapList (Weighted Binder) (Cases (SimpleRep a))) Pred Source #

branch ∷ ∀ p a. (HasSpec a, All HasSpec (Args a), IsPred p, IsProd a) ⇒ FunTy (MapList Term (Args a)) p → Weighted Binder a Source #

branchW ∷ ∀ p a. (HasSpec a, All HasSpec (Args a), IsPred p, IsProd a) ⇒ IntFunTy (MapList Term (Args a)) p → Weighted Binder a Source #

forAll' ∷ ∀ t a p. (Forallable t a, Cases (SimpleRep a) ~ '[SimpleRep a], TypeSpec a ~ TypeSpec (SimpleRep a), HasSpec t, HasSpec (SimpleRep a), HasSimpleRep a, All HasSpec (Args (SimpleRep a)), IsPred p, IsProd (SimpleRep a), IsProductType a, HasSpec a, GenericRequires a, ProdAsListComputes a) ⇒ Term t → FunTy (MapList Term (ProductAsList a)) p → Pred Source #

Like forAll but pattern matches on the `Term a`

constrained' ∷ ∀ a p. (Cases (SimpleRep a) ~ '[SimpleRep a], TypeSpec a ~ TypeSpec (SimpleRep a), HasSpec (SimpleRep a), HasSimpleRep a, All HasSpec (Args (SimpleRep a)), IsProd (SimpleRep a), HasSpec a, IsProductType a, IsPred p, GenericRequires a, ProdAsListComputes a) ⇒ FunTy (MapList Term (ProductAsList a)) p → Specification a Source #

Like constrained but pattern matches on the bound `Term a`

reify' ∷ ∀ a b p. (Cases (SimpleRep b) ~ '[SimpleRep b], TypeSpec b ~ TypeSpec (SimpleRep b), HasSpec (SimpleRep b), HasSimpleRep b, All HasSpec (Args (SimpleRep b)), IsProd (SimpleRep b), HasSpec a, HasSpec b, IsProductType b, IsProd a, IsPred p, GenericRequires b, ProdAsListComputes b) ⇒ Term a → (a → b) → FunTy (MapList Term (ProductAsList b)) p → Pred Source #

Like reify but pattern matches on the bound `Term b`

con ∷ ∀ c a r. (SimpleRep a ~ SOP (TheSop a), TypeSpec a ~ TypeSpec (SOP (TheSop a)), TypeList (ConstrOf c (TheSop a)), r ~ FunTy (MapList Term (ConstrOf c (TheSop a))) (Term a), ResultType r ~ Term a, SOPTerm c (TheSop a), ConstrTerm (ConstrOf c (TheSop a)), GenericRequires a) ⇒ r Source #

onCon ∷ ∀ c a p. (IsConstrOf c (ProdOver (ConstrOf c (TheSop a))) (TheSop a), GenericRequires a, SumOver (Cases (SOP (TheSop a))) ~ SimpleRep a, All HasSpec (Cases (SOP (TheSop a))), HasSpec (ProdOver (ConstrOf c (TheSop a))), IsPred p, Args (ProdOver (ConstrOf c (TheSop a))) ~ ConstrOf c (TheSop a), All HasSpec (ConstrOf c (TheSop a)), IsProd (ProdOver (ConstrOf c (TheSop a)))) ⇒ Term a → FunTy (MapList Term (ConstrOf c (TheSop a))) p → Pred Source #

isCon ∷ ∀ c a. (IsConstrOf c (ProdOver (ConstrOf c (TheSop a))) (TheSop a), SumOver (Cases (SOP (TheSop a))) ~ SimpleRep a, All HasSpec (Cases (SOP (TheSop a))), HasSpec (ProdOver (ConstrOf c (TheSop a))), GenericRequires a) ⇒ Term a → Pred Source #

sel ∷ ∀ n a c as. (SimpleRep a ~ ProdOver as, TheSop a ~ '[c ::: as], TypeSpec a ~ TypeSpec (ProdOver as), Select n as, HasSpec a, HasSpec (ProdOver as), HasSimpleRep a, GenericRequires a) ⇒ Term a → Term (At n as) Source #

match ∷ ∀ p a. (IsProductType a, IsPred p, GenericRequires a, ProdAsListComputes a) ⇒ Term a → FunTy (MapList Term (ProductAsList a)) p → Pred Source #

onJust ∷ ∀ a p. (HasSpec a, IsNormalType a, IsPred p) ⇒ Term (Maybe a) → (Term a → p) → Pred Source #

isJust ∷ ∀ a. (HasSpec a, IsNormalType a) ⇒ Term (Maybe a) → Pred Source #

chooseSpecHasSpec a ⇒ (Int, Specification a) → (Int, Specification a) → Specification a Source #

ChooseSpec is one of the ways we can Or two Specs together This works for any kind of type that has a HasSpec instance. If your type is a Sum type. One can use CaseOn which is much easier.

notEqualSpec ∷ ∀ a. HasSpec a ⇒ a → Specification a Source #

notMemberSpec ∷ ∀ a f. (HasSpec a, Foldable f) ⇒ f a → Specification a Source #

id_ ∷ ∀ a. HasSpec a ⇒ Term a → Term a Source #

flip_ ∷ ∀ (t ∷ [Type] → TypeType) a b r. (HasSpec b, HasSpec a, AppRequires t '[a, b] r) ⇒ t '[a, b] r → Term b → Term a → Term r Source #

compose_ ∷ ∀ b t1 t2 a r. (AppRequires t1 '[b] r, AppRequires t2 '[a] b) ⇒ t1 '[b] r → t2 '[a] b → Term a → Term r Source #

foldMap_ ∷ ∀ a b. (Foldy b, HasSpec a) ⇒ (Term a → Term b) → Term [a] → Term b Source #

sum_Foldy a ⇒ Term [a] → Term a Source #

elem_ ∷ (Sized [a], HasSpec a) ⇒ Term a → Term [a] → Term Bool infix 4 Source #

singletonList_ ∷ (Sized [a], HasSpec a) ⇒ Term a → Term [a] Source #

append_ ∷ (Sized [a], HasSpec a) ⇒ Term [a] → Term [a] → Term [a] Source #

(++.)HasSpec a ⇒ Term [a] → Term [a] → Term [a] infixr 5 Source #

sizeOfSized t ⇒ t → Integer Source #

sizeOf_ ∷ (HasSpec a, Sized a) ⇒ Term a → Term Integer Source #

null_ ∷ (HasSpec a, Sized a) ⇒ Term a → Term Bool Source #

length_HasSpec a ⇒ Term [a] → Term Integer Source #

genFromSizeSpecMonadGenError m ⇒ Specification IntegerGenT m Integer Source #

Because Sizes should always be >= 0, We provide this alternate generator that can be used to replace (genFromSpecT @Integer), to ensure this important property

between ∷ (HasSpec a, TypeSpec a ~ NumSpec a) ⇒ a → a → Specification a Source #

maxSpecSpecification IntegerSpecification Integer Source #

The widest interval whose largest element is admitted by the original spec

data SetW (d ∷ [Type]) (r ∷ Type) where Source #

Constructors

SingletonW ∷ (HasSpec a, Ord a) ⇒ SetW '[a] (Set a) 
UnionW ∷ (HasSpec a, Ord a) ⇒ SetW '[Set a, Set a] (Set a) 
SubsetW ∷ (HasSpec a, Ord a, HasSpec a) ⇒ SetW '[Set a, Set a] Bool 
MemberW ∷ (HasSpec a, Ord a) ⇒ SetW '[a, Set a] Bool 
DisjointW ∷ (HasSpec a, Ord a) ⇒ SetW '[Set a, Set a] Bool 
FromListW ∷ (HasSpec a, Ord a) ⇒ SetW '[[a]] (Set a) 

Instances

Instances details
Syntax SetW Source # 
Instance details

Defined in Constrained.Spec.Set

Methods

isInfix ∷ ∀ (dom ∷ [Type]) rng. SetW dom rng → Bool Source #

prettySymbol ∷ ∀ deps (dom ∷ [Type]) rng ann. SetW dom rng → List (TermD deps) dom → IntMaybe (Doc ann) Source #

Logic SetW Source # 
Instance details

Defined in Constrained.Spec.Set

Methods

propagateTypeSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires SetW as b, HasSpec a) ⇒ SetW as b → ListCtx Value as (HOLE a) → TypeSpec b → [b] → Specification a Source #

propagateMemberSpec ∷ ∀ (as ∷ [Type]) b a. (AppRequires SetW as b, HasSpec a) ⇒ SetW as b → ListCtx Value as (HOLE a) → NonEmpty b → Specification a Source #

propagate ∷ ∀ (as ∷ [Type]) b a. (AppRequires SetW as b, HasSpec a) ⇒ SetW as b → ListCtx Value as (HOLE a) → Specification b → Specification a Source #

rewriteRules ∷ ∀ (dom ∷ [Type]) rng. (TypeList dom, Typeable dom, HasSpec rng, All HasSpec dom) ⇒ SetW dom rng → List Term dom → Evidence (AppRequires SetW dom rng) → Maybe (Term rng) Source #

mapTypeSpec ∷ (HasSpec a, HasSpec b) ⇒ SetW '[a] b → TypeSpec a → Specification b Source #

saturate ∷ ∀ (dom ∷ [Type]). SetW dom BoolList Term dom → [Pred] Source #

Semantics SetW Source # 
Instance details

Defined in Constrained.Spec.Set

Methods

semantics ∷ ∀ (d ∷ [Type]) r. SetW d r → FunTy d r Source #

Show (SetW ds r) Source # 
Instance details

Defined in Constrained.Spec.Set

Methods

showsPrecIntSetW ds r → ShowS #

showSetW ds r → String #

showList ∷ [SetW ds r] → ShowS #

Eq (SetW dom rng) Source # 
Instance details

Defined in Constrained.Spec.Set

Methods

(==)SetW dom rng → SetW dom rng → Bool #

(/=)SetW dom rng → SetW dom rng → Bool #

data SetSpec a Source #

Instances

Instances details
(Ord a, Arbitrary (Specification a), Arbitrary a) ⇒ Arbitrary (SetSpec a) Source # 
Instance details

Defined in Constrained.Spec.Set

Methods

arbitraryGen (SetSpec a) Source #

shrinkSetSpec a → [SetSpec a] Source #

(Ord a, HasSpec a) ⇒ Monoid (SetSpec a) Source # 
Instance details

Defined in Constrained.Spec.Set

Methods

memptySetSpec a #

mappendSetSpec a → SetSpec a → SetSpec a #

mconcat ∷ [SetSpec a] → SetSpec a #

(Ord a, HasSpec a) ⇒ Semigroup (SetSpec a) Source # 
Instance details

Defined in Constrained.Spec.Set

Methods

(<>)SetSpec a → SetSpec a → SetSpec a #

sconcatNonEmpty (SetSpec a) → SetSpec a #

stimesIntegral b ⇒ b → SetSpec a → SetSpec a #

HasSpec a ⇒ Show (SetSpec a) Source # 
Instance details

Defined in Constrained.Spec.Set

Methods

showsPrecIntSetSpec a → ShowS #

showSetSpec a → String #

showList ∷ [SetSpec a] → ShowS #

singleton_ ∷ (Ord a, HasSpec a) ⇒ Term a → Term (Set a) Source #

member_ ∷ (Ord a, HasSpec a) ⇒ Term a → Term (Set a) → Term Bool Source #

union_ ∷ (Ord a, HasSpec a) ⇒ Term (Set a) → Term (Set a) → Term (Set a) Source #

subset_ ∷ (Ord a, HasSpec a) ⇒ Term (Set a) → Term (Set a) → Term Bool Source #

disjoint_ ∷ (Ord a, HasSpec a) ⇒ Term (Set a) → Term (Set a) → Term Bool Source #

fromList_ ∷ ∀ a. (Ord a, HasSpec a) ⇒ Term [a] → Term (Set a) Source #

pattern Elem ∷ ∀ b. () ⇒ ∀ a. (b ~ Bool, Eq a, HasSpec a) ⇒ Term a → Term [a] → Term b Source #

pattern ToGeneric ∷ ∀ rng. () ⇒ ∀ a. (rng ~ SimpleRep a, GenericRequires a, HasSpec a, AppRequires BaseW '[a] rng) ⇒ Term a → Term rng Source #

pattern FromGeneric ∷ ∀ rng. () ⇒ ∀ a. (rng ~ a, GenericRequires a, HasSpec a, AppRequires BaseW '[SimpleRep a] rng) ⇒ Term (SimpleRep a) → Term rng Source #

pattern UnaryHOLE a' a → ListCtx f '[a] (HOLE a') Source #

A Convenient pattern for singleton contexts

pattern (:<:) ∷ (Typeable b, Show b) ⇒ HOLE c a → b → ListCtx Value '[a, b] (HOLE c) Source #

Convenient patterns for binary contexts (the arrow :<: points towards the hole)

pattern (:>:) ∷ (Typeable a, Show a) ⇒ a → HOLE c b → ListCtx Value '[a, b] (HOLE c) Source #

Convenient patterns for binary contexts (the arrow :>: points towards the hole)

class (Num a, HasSpec a) ⇒ NumLike a Source #

Instances

Instances details
Numeric a ⇒ NumLike a Source # 
Instance details

Defined in Constrained.NumSpec

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

showsPrecIntPairSpec a b → ShowS #

showPairSpec a b → String #

showList ∷ [PairSpec a b] → ShowS #

data MapSpec k v Source #

Instances

Instances details
(HasSpec (k, v), HasSpec k, HasSpec v, HasSpec [v]) ⇒ Pretty (WithPrec (MapSpec k v)) Source # 
Instance details

Defined in Constrained.Spec.Map

Methods

prettyWithPrec (MapSpec k v) → Doc ann Source #

prettyList ∷ [WithPrec (MapSpec k v)] → Doc ann Source #

(Arbitrary k, Arbitrary v, Arbitrary (TypeSpec k), Arbitrary (TypeSpec v), Ord k, HasSpec k, Foldy v) ⇒ Arbitrary (MapSpec k v) Source # 
Instance details

Defined in Constrained.Spec.Map

Methods

arbitraryGen (MapSpec k v) Source #

shrinkMapSpec k v → [MapSpec k v] Source #

Generic (MapSpec k v) Source # 
Instance details

Defined in Constrained.Spec.Map

Associated Types

type Rep (MapSpec k v) ∷ TypeType #

Methods

fromMapSpec k v → Rep (MapSpec k v) x #

toRep (MapSpec k v) x → MapSpec k v #

(HasSpec (k, v), HasSpec k, HasSpec v, HasSpec [v]) ⇒ Show (MapSpec k v) Source # 
Instance details

Defined in Constrained.Spec.Map

Methods

showsPrecIntMapSpec k v → ShowS #

showMapSpec k v → String #

showList ∷ [MapSpec k v] → ShowS #

type Rep (MapSpec k v) Source # 
Instance details

Defined in Constrained.Spec.Map

type Rep (MapSpec k v) = D1 ('MetaData "MapSpec" "Constrained.Spec.Map" "constrained-generators-0.2.0.0-inplace" 'False) (C1 ('MetaCons "MapSpec" 'PrefixI 'True) ((S1 ('MetaSel ('Just "mapSpecHint") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Integer)) :*: (S1 ('MetaSel ('Just "mapSpecMustKeys") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set k)) :*: S1 ('MetaSel ('Just "mapSpecMustValues") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [v]))) :*: (S1 ('MetaSel ('Just "mapSpecSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Specification Integer)) :*: (S1 ('MetaSel ('Just "mapSpecElem") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Specification (k, v))) :*: S1 ('MetaSel ('Just "mapSpecFold") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (FoldSpec v))))))

dom_ ∷ (HasSpec (Map k v), HasSpec v, HasSpec k, Ord k, IsNormalType k, IsNormalType v) ⇒ Term (Map k v) → Term (Set k) Source #

rng_ ∷ (HasSpec k, HasSpec v, Ord k, IsNormalType k, IsNormalType v) ⇒ Term (Map k v) → Term [v] Source #

lookup_ ∷ (HasSpec k, HasSpec v, Ord k, IsNormalType k, IsNormalType v) ⇒ Term k → Term (Map k v) → Term (Maybe v) Source #

fstSpec ∷ ∀ k v. (HasSpec k, HasSpec v) ⇒ Specification (k, v) → Specification k Source #

sndSpec ∷ ∀ k v. (HasSpec k, HasSpec v) ⇒ Specification (k, v) → Specification v Source #

data Prod a b Source #

Constructors

Prod 

Fields

Instances

Instances details
(Show a, Show b) ⇒ Show (Prod a b) Source # 
Instance details

Defined in Constrained.Generic

Methods

showsPrecIntProd a b → ShowS #

showProd a b → String #

showList ∷ [Prod a b] → ShowS #

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

Defined in Constrained.TheKnot

Associated Types

type TypeSpec (Prod a b) Source #

type Prerequisites (Prod a b) Source #

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

Defined in Constrained.Generic

Methods

(==)Prod a b → Prod a b → Bool #

(/=)Prod a b → Prod a b → Bool #

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

Defined in Constrained.Generic

Methods

compareProd a b → Prod a b → Ordering #

(<)Prod a b → Prod a b → Bool #

(<=)Prod a b → Prod a b → Bool #

(>)Prod a b → Prod a b → Bool #

(>=)Prod a b → Prod a b → Bool #

maxProd a b → Prod a b → Prod a b #

minProd a b → Prod a b → Prod a b #

type Prerequisites (Prod a b) Source # 
Instance details

Defined in Constrained.TheKnot

type Prerequisites (Prod a b) = (HasSpec a, HasSpec b)
type TypeSpec (Prod a b) Source # 
Instance details

Defined in Constrained.TheKnot

type TypeSpec (Prod a b) = PairSpec a b