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.Map

Synopsis

Documentation

data MapSpec fn k v Source #

Instances

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

Defined in Constrained.Spec.Map

Methods

prettyWithPrec (MapSpec fn k v) → Doc ann Source #

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

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

Defined in Constrained.Spec.Map

Methods

arbitraryGen (MapSpec fn k v) Source #

shrinkMapSpec fn k v → [MapSpec fn k v] Source #

Generic (MapSpec fn k v) Source # 
Instance details

Defined in Constrained.Spec.Map

Associated Types

type Rep (MapSpec fn k v) ∷ TypeType Source #

Methods

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

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

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

Defined in Constrained.Spec.Map

Methods

showsPrecIntMapSpec fn k v → ShowS Source #

showMapSpec fn k v → String Source #

showList ∷ [MapSpec fn k v] → ShowS Source #

type Rep (MapSpec fn k v) Source # 
Instance details

Defined in Constrained.Spec.Map

type Rep (MapSpec fn 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 fn Integer)) :*: (S1 ('MetaSel ('Just "mapSpecElem") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Specification fn (k, v))) :*: S1 ('MetaSel ('Just "mapSpecFold") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (FoldSpec fn v))))))

defaultMapSpecOrd k ⇒ MapSpec fn k v Source #

emptySpec without all the constraints

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

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

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

Orphan instances

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

Associated Types

type Hint (Map k v) Source #

Methods

giveHintHint (Map k v) → Specification fn (Map k v) Source #

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

Associated Types

type TypeSpec fn (Map k v) Source #

type Prerequisites fn (Map k v) Source #

Methods

emptySpecTypeSpec fn (Map k v) Source #

combineSpecTypeSpec fn (Map k v) → TypeSpec fn (Map k v) → Specification fn (Map k v) Source #

genFromTypeSpec ∷ ∀ (m ∷ TypeType). (HasCallStack, MonadGenError m) ⇒ TypeSpec fn (Map k v) → GenT m (Map k v) Source #

conformsToMap k v → TypeSpec fn (Map k v) → Bool Source #

shrinkWithTypeSpecTypeSpec fn (Map k v) → Map k v → [Map k v] Source #

toPredsTerm fn (Map k v) → TypeSpec fn (Map k v) → Pred fn Source #

cardinalTypeSpecTypeSpec fn (Map k v) → Specification fn Integer Source #

cardinalTrueSpecSpecification fn Integer Source #

typeSpecHasErrorTypeSpec fn (Map k v) → Maybe (NonEmpty String) Source #

alternateShowTypeSpec fn (Map k v) → BinaryShow Source #

monadConformsToMap k v → TypeSpec fn (Map k v) → Writer [String] Bool Source #

typeSpecOptTypeSpec fn (Map k v) → [Map k v] → Specification fn (Map k v) Source #

prerequisitesEvidence (Prerequisites fn (Map k v)) Source #

BaseUniverse fn ⇒ Functions (MapFn fn) fn Source # 
Instance details

Methods

propagateSpecFun ∷ ∀ (as ∷ [Type]) a b. (TypeList as, Typeable as, HasSpec fn a, HasSpec fn b, All (HasSpec fn) as) ⇒ MapFn 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) ⇒ MapFn fn as b → List (Term fn) as → Maybe (Term fn b) Source #

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

Arbitrary (FoldSpec fn (Map k v)) Source # 
Instance details

Methods

arbitraryGen (FoldSpec fn (Map k v)) Source #

shrinkFoldSpec fn (Map k v) → [FoldSpec fn (Map k v)] Source #

Ord a ⇒ Sized (Map a b) Source # 
Instance details

Methods

sizeOfMap a b → Integer Source #

liftSizeSpec ∷ ∀ (fn ∷ [Type] → TypeType). HasSpec fn (Map a b) ⇒ SizeSpec fn → [Integer] → Specification fn (Map a b) Source #

liftMemberSpec ∷ ∀ (fn ∷ [Type] → TypeType). HasSpec fn (Map a b) ⇒ OrdSet IntegerSpecification fn (Map a b) Source #

sizeOfTypeSpec ∷ ∀ (fn ∷ [Type] → TypeType). HasSpec fn (Map a b) ⇒ TypeSpec fn (Map a b) → Specification fn Integer Source #

Ord k ⇒ Forallable (Map k v) (k, v) Source # 
Instance details

Methods

fromForAllSpec ∷ ∀ (fn ∷ [Type] → TypeType). (HasSpec fn (Map k v), HasSpec fn (k, v), BaseUniverse fn) ⇒ Specification fn (k, v) → Specification fn (Map k v) Source #

forAllToListMap k v → [(k, v)] Source #