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

Constrained.Spec.Tree

Documentation

data BinTree a Source #

Constructors

BinTip 
BinNode (BinTree a) a (BinTree a) 

Instances

Instances details
Generic (BinTree a) Source # 
Instance details

Defined in Constrained.Spec.Tree

Associated Types

type Rep (BinTree a) ∷ Type → Type

Methods

fromBinTree a → Rep (BinTree a) x

to ∷ Rep (BinTree a) x → BinTree a

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

Defined in Constrained.Spec.Tree

Methods

showsPrec ∷ Int → BinTree a → ShowS

showBinTree a → String

showList ∷ [BinTree a] → ShowS

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

Defined in Constrained.Spec.Tree

Associated Types

type Hint (BinTree 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 #

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

Defined in Constrained.Spec.Tree

Methods

(==)BinTree a → BinTree a → Bool

(/=)BinTree a → BinTree a → Bool

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

Defined in Constrained.Spec.Tree

Methods

compareBinTree a → BinTree a → Ordering

(<)BinTree a → BinTree a → Bool

(<=)BinTree a → BinTree a → Bool

(>)BinTree a → BinTree a → Bool

(>=)BinTree a → BinTree a → Bool

maxBinTree a → BinTree a → BinTree a

minBinTree a → BinTree a → BinTree a

Forallable (BinTree a) (BinTree a, a, BinTree a) Source # 
Instance details

Defined in Constrained.Spec.Tree

type Rep (BinTree a) Source # 
Instance details

Defined in Constrained.Spec.Tree

type Rep (BinTree a) = D1 ('MetaData "BinTree" "Constrained.Spec.Tree" "constrained-generators-0.2.0.0-inplace" 'False) (C1 ('MetaCons "BinTip" 'PrefixI 'False) (U1 ∷ Type → Type) :+: C1 ('MetaCons "BinNode" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BinTree a)) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BinTree a)))))
type Hint (BinTree a) Source # 
Instance details

Defined in Constrained.Spec.Tree

type Hint (BinTree a) = Integer
type Prerequisites (BinTree a) Source # 
Instance details

Defined in Constrained.Spec.Tree

type Prerequisites (BinTree a) = ()
type TypeSpec (BinTree a) Source # 
Instance details

Defined in Constrained.Spec.Tree

type TypeSpec (BinTree a)

data TreeW (dom ∷ [Type]) (rng ∷ Type) where Source #

Constructors

RootLabelWHasSpec a ⇒ TreeW '[Tree a] a 

Instances

Instances details
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 Bool → List Term dom → [Pred] Source #

Semantics TreeW Source # 
Instance details

Defined in Constrained.Spec.Tree

Methods

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

Syntax TreeW Source # 
Instance details

Defined in Constrained.Spec.Tree

Methods

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

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

Show (TreeW d r) Source # 
Instance details

Defined in Constrained.Spec.Tree

Methods

showsPrec ∷ Int → TreeW d r → ShowS

showTreeW d r → String

showList ∷ [TreeW d r] → ShowS

Eq (TreeW d r) Source # 
Instance details

Defined in Constrained.Spec.Tree

Methods

(==)TreeW d r → TreeW d r → Bool

(/=)TreeW d r → TreeW d r → Bool

rootLabel_ ∷ ∀ a. HasSpec a ⇒ Term (Tree a) → Term a Source #

data TreeSpec a Source #

Constructors

TreeSpec 

Fields

Instances

Instances details
HasSpec a ⇒ Show (TreeSpec a) Source # 
Instance details

Defined in Constrained.Spec.Tree

Methods

showsPrec ∷ Int → TreeSpec a → ShowS

showTreeSpec a → String

showList ∷ [TreeSpec a] → ShowS

Orphan instances

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

Associated Types

type Hint (Tree a) Source #

Methods

giveHintHint (Tree a) → Specification (Tree a) Source #

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

Associated Types

type TypeSpec (Tree a) Source #

type Prerequisites (Tree a) Source #

Methods

emptySpecTypeSpec (Tree a) Source #

combineSpecTypeSpec (Tree a) → TypeSpec (Tree a) → Specification (Tree a) Source #

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

conformsTo ∷ Tree a → TypeSpec (Tree a) → Bool Source #

shrinkWithTypeSpecTypeSpec (Tree a) → Tree a → [Tree a] Source #

toPredsTerm (Tree a) → TypeSpec (Tree a) → Pred Source #

cardinalTypeSpecTypeSpec (Tree a) → Specification Integer Source #

cardinalTrueSpecSpecification Integer Source #

typeSpecHasErrorTypeSpec (Tree a) → Maybe (NonEmpty String) Source #

alternateShowTypeSpec (Tree a) → BinaryShow Source #

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

typeSpecOptTypeSpec (Tree a) → [Tree a] → Specification (Tree a) Source #

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

prerequisitesEvidence (Prerequisites (Tree a)) Source #

Forallable (Tree a) (a, [Tree a]) Source # 
Instance details

Methods

fromForAllSpecSpecification (a, [Tree a]) → Specification (Tree a) Source #

forAllToList ∷ Tree a → [(a, [Tree a])] Source #