Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data family ExistentialFor (e :: Effect)
- class GArbitraryK (e :: Effect) (f :: LoT Effect -> Type) (r :: EffectRow) (a :: Type) where
- garbitraryk :: [Gen (f (LoT2 (Sem r) a))]
- genEff :: forall e r a. (GenericK e, GArbitraryK e (RepK e) r a) => Gen (e (Sem r) a)
- arbitraryAction :: forall e r. ArbitraryAction (TypesOf e) e r => Gen (SomeAction e r)
- arbitraryActionOfType :: forall e a r. (GenericK e, GArbitraryK e (RepK e) r a) => Gen (e (Sem r) a)
- arbitraryActionFromRow :: forall (effs :: EffectRow) r. ArbitraryEff effs r => Gen (SomeEff r)
- arbitraryActionFromRowOfType :: forall (effs :: EffectRow) r a. ArbitraryEffOfType a effs r => Gen (SomeEffOfType r a)
- type family GTypesOf (f :: LoT Effect -> Type) :: [Type] where ...
- type TypesOf (e :: Effect) = GTypesOf (RepK e)
- data SomeAction e (r :: EffectRow) where
- SomeAction :: (Member e r, Eq a, Show a, CoArbitrary a, Show (e (Sem r) a)) => e (Sem r) a -> SomeAction e r
- data SomeEff (r :: EffectRow) where
- data SomeEffOfType (r :: EffectRow) a where
- SomeEffOfType :: (Member e r, Eq a, Show a, CoArbitrary a, Show (e (Sem r) a)) => e (Sem r) a -> SomeEffOfType r a
- class ArbitraryEff (es :: EffectRow) (r :: EffectRow) where
- genSomeEff :: [Gen (SomeEff r)]
- class ArbitraryEffOfType (a :: Type) (es :: EffectRow) (r :: EffectRow) where
- genSomeEffOfType :: [Gen (SomeEffOfType r a)]
- class ArbitraryAction (as :: [Type]) (e :: Effect) (r :: EffectRow) where
- genSomeAction :: [Gen (SomeAction e r)]
Documentation
data family ExistentialFor (e :: Effect) Source #
Data family for the instantiation of existential variables. If you want to
check properties for an effect e
that contains an existential type, the
synthesized Arbitrary
instance will instantiate all of e
's existential
types at
.ExistentialFor
e
must have instances for every dictionary required by
ExistentialFor
ee
, and will likely require an Arbitrary
instance.
class GArbitraryK (e :: Effect) (f :: LoT Effect -> Type) (r :: EffectRow) (a :: Type) where Source #
Given
, this typeclass computes
generators for every well-typed constructor of GArbitraryK
e (RepK
e) r ae (Sem r) a
. It is capable
of building generators for GADTs.
Instances
genEff :: forall e r a. (GenericK e, GArbitraryK e (RepK e) r a) => Gen (e (Sem r) a) Source #
genEff @e @r @a
gets a generator capable of producing every
well-typed GADT constructor of e (Sem r) a
.
:: forall e r. ArbitraryAction (TypesOf e) e r | |
=> Gen (SomeAction e r) |
Generate any action for effect e
.
arbitraryActionOfType Source #
:: forall e a r. (GenericK e, GArbitraryK e (RepK e) r a) | |
=> Gen (e (Sem r) a) |
Generate any action for effect e
that produces type a
.
arbitraryActionFromRow Source #
:: forall (effs :: EffectRow) r. ArbitraryEff effs r | |
=> Gen (SomeEff r) |
Generate any action from any effect in effs
.
arbitraryActionFromRowOfType Source #
:: forall (effs :: EffectRow) r a. ArbitraryEffOfType a effs r | |
=> Gen (SomeEffOfType r a) |
Generate any action from any effect in effs
that produces type a
.
type family GTypesOf (f :: LoT Effect -> Type) :: [Type] where ... Source #
Helper function for implementing GTypesOf
data SomeAction e (r :: EffectRow) where Source #
is some action for effect SomeAction
e re
in effect row r
.
SomeAction | |
|
Instances
Show (SomeAction e r) Source # | |
Defined in Polysemy.Check.Arbitrary showsPrec :: Int -> SomeAction e r -> ShowS # show :: SomeAction e r -> String # showList :: [SomeAction e r] -> ShowS # |
data SomeEff (r :: EffectRow) where Source #
is some action for some effect in the effect row SomeEff
rr
.
data SomeEffOfType (r :: EffectRow) a where Source #
is some action for some effect in the effect row SomeEff
rr
.
SomeEffOfType | |
|
Instances
Show (SomeEffOfType r a) Source # | |
Defined in Polysemy.Check.Arbitrary showsPrec :: Int -> SomeEffOfType r a -> ShowS # show :: SomeEffOfType r a -> String # showList :: [SomeEffOfType r a] -> ShowS # |
class ArbitraryEff (es :: EffectRow) (r :: EffectRow) where Source #
lets you randomly generate an action in any of
the effects ArbitraryEff
es res
.
genSomeEff :: [Gen (SomeEff r)] Source #
Instances
ArbitraryEff ('[] :: [Effect]) r Source # | |
Defined in Polysemy.Check.Arbitrary genSomeEff :: [Gen (SomeEff r)] Source # | |
(ArbitraryEff es r, ArbitraryAction (TypesOf e) e r) => ArbitraryEff (e ': es) r Source # | |
Defined in Polysemy.Check.Arbitrary genSomeEff :: [Gen (SomeEff r)] Source # |
class ArbitraryEffOfType (a :: Type) (es :: EffectRow) (r :: EffectRow) where Source #
lets you randomly generate an action in any of
the effects ArbitraryEffOfType
a es res
that produces type a
.
genSomeEffOfType :: [Gen (SomeEffOfType r a)] Source #
Instances
ArbitraryEffOfType a ('[] :: [Effect]) r Source # | |
Defined in Polysemy.Check.Arbitrary genSomeEffOfType :: [Gen (SomeEffOfType r a)] Source # | |
(Eq a, Show a, Show (e (Sem r) a), ArbitraryEffOfType a es r, GenericK e, GArbitraryK e (RepK e) r a, CoArbitrary a, Member e r) => ArbitraryEffOfType a (e ': es) r Source # | |
Defined in Polysemy.Check.Arbitrary genSomeEffOfType :: [Gen (SomeEffOfType r a)] Source # |
class ArbitraryAction (as :: [Type]) (e :: Effect) (r :: EffectRow) where Source #
lets you randomly generate an action
producing any type in ArbitraryAction
as e ras
from the effect e
.
genSomeAction :: [Gen (SomeAction e r)] Source #
Instances
ArbitraryAction ('[] :: [Type]) e r Source # | |
Defined in Polysemy.Check.Arbitrary genSomeAction :: [Gen (SomeAction e r)] Source # | |
(ArbitraryAction as e r, Eq a, Show a, Member e r, Show (e (Sem r) a), GenericK e, CoArbitrary a, GArbitraryK e (RepK e) r a) => ArbitraryAction (a ': as) e r Source # | |
Defined in Polysemy.Check.Arbitrary genSomeAction :: [Gen (SomeAction e r)] Source # |