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
HasSpec fn a ⇒ HasGenHint fn (BinTree a) Source # 
Instance details

Defined in Constrained.Spec.Tree

Associated Types

type Hint (BinTree a) Source #

Methods

giveHintHint (BinTree a) → Specification fn (BinTree a) Source #

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

Defined in Constrained.Spec.Tree

Associated Types

type TypeSpec fn (BinTree a) Source #

type Prerequisites fn (BinTree a) Source #

Methods

emptySpecTypeSpec fn (BinTree a) Source #

combineSpecTypeSpec fn (BinTree a) → TypeSpec fn (BinTree a) → Specification fn (BinTree a) Source #

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

conformsToBinTree a → TypeSpec fn (BinTree a) → Bool Source #

shrinkWithTypeSpecTypeSpec fn (BinTree a) → BinTree a → [BinTree a] Source #

toPredsTerm fn (BinTree a) → TypeSpec fn (BinTree a) → Pred fn Source #

cardinalTypeSpecTypeSpec fn (BinTree a) → Specification fn Integer Source #

cardinalTrueSpecSpecification fn Integer Source #

typeSpecHasErrorTypeSpec fn (BinTree a) → Maybe (NonEmpty String) Source #

alternateShowTypeSpec fn (BinTree a) → BinaryShow Source #

monadConformsToBinTree a → TypeSpec fn (BinTree a) → Writer [String] Bool Source #

typeSpecOptTypeSpec fn (BinTree a) → [BinTree a] → Specification fn (BinTree a) Source #

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

prerequisitesEvidence (Prerequisites fn (BinTree a)) Source #

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

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

Methods

fromForAllSpec ∷ ∀ (fn ∷ [Type] → Type → Type). (HasSpec fn (BinTree a), HasSpec fn (BinTree a, a, BinTree a), BaseUniverse fn) ⇒ Specification fn (BinTree a, a, BinTree a) → Specification fn (BinTree a) Source #

forAllToListBinTree a → [(BinTree a, a, BinTree a)] Source #

type Prerequisites fn (BinTree a) Source # 
Instance details

Defined in Constrained.Spec.Tree

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

Defined in Constrained.Spec.Tree

type TypeSpec fn (BinTree a)
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

data TreeFn (fn ∷ [Type] → Type → Type) args res Source #

Instances

Instances details
FunctionLike (TreeFn fn) Source # 
Instance details

Defined in Constrained.Spec.Tree

Methods

sem ∷ ∀ (as ∷ [Type]) b. TreeFn fn as b → FunTy as b Source #

(Member (TreeFn fn) fn, BaseUniverse fn) ⇒ Functions (TreeFn fn) fn Source # 
Instance details

Defined in Constrained.Spec.Tree

Methods

propagateSpecFun ∷ ∀ (as ∷ [Type]) a b. (TypeList as, Typeable as, HasSpec fn a, HasSpec fn b, All (HasSpec fn) as) ⇒ TreeFn fn as b → ListCtx Value as (HOLE a) → Specification fn b → Specification fn a Source #

rewriteRules ∷ ∀ (as ∷ [Type]) b. (TypeList as, Typeable as, HasSpec fn b, All (HasSpec fn) as) ⇒ TreeFn fn as b → List (Term fn) as → Maybe (Term fn b) Source #

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

Show (TreeFn fn args res) Source # 
Instance details

Defined in Constrained.Spec.Tree

Methods

showsPrec ∷ Int → TreeFn fn args res → ShowS

showTreeFn fn args res → String

showList ∷ [TreeFn fn args res] → ShowS

Eq (TreeFn fn args res) Source # 
Instance details

Defined in Constrained.Spec.Tree

Methods

(==)TreeFn fn args res → TreeFn fn args res → Bool

(/=)TreeFn fn args res → TreeFn fn args res → Bool

rootLabel_ ∷ ∀ fn a. (Member (TreeFn fn) fn, HasSpec fn a) ⇒ Term fn (Tree a) → Term fn a Source #

data TreeSpec fn a Source #

Constructors

TreeSpec 

Fields

Instances

Instances details
(HasSpec fn a, Member (TreeFn fn) fn) ⇒ Show (TreeSpec fn a) Source # 
Instance details

Defined in Constrained.Spec.Tree

Methods

showsPrec ∷ Int → TreeSpec fn a → ShowS

showTreeSpec fn a → String

showList ∷ [TreeSpec fn a] → ShowS

Orphan instances

(Member (TreeFn fn) fn, HasSpec fn a) ⇒ HasGenHint fn (Tree a) Source # 
Instance details

Associated Types

type Hint (Tree a) Source #

Methods

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

(HasSpec fn a, Member (TreeFn fn) fn) ⇒ HasSpec fn (Tree a) Source # 
Instance details

Associated Types

type TypeSpec fn (Tree a) Source #

type Prerequisites fn (Tree a) Source #

Methods

emptySpecTypeSpec fn (Tree a) Source #

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

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

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

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

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

cardinalTypeSpecTypeSpec fn (Tree a) → Specification fn Integer Source #

cardinalTrueSpecSpecification fn Integer Source #

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

alternateShowTypeSpec fn (Tree a) → BinaryShow Source #

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

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

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

prerequisitesEvidence (Prerequisites fn (Tree a)) Source #

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

Methods

fromForAllSpec ∷ ∀ (fn ∷ [Type] → Type → Type). (HasSpec fn (Tree a), HasSpec fn (a, [Tree a]), BaseUniverse fn) ⇒ Specification fn (a, [Tree a]) → Specification fn (Tree a) Source #

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