generic-random-1.5.0.1: Generic random generators for QuickCheck

Safe Haskell | None
Language | Haskell2010

Generic.Random.Internal.BaseCase

Description

Base case discovery.

### Warning

This is an internal module: it is not subject to any versioning policy, breaking changes can happen at any time.

If something here seems useful, please report it or create a pull request to export it from an external module.

Synopsis

- genericArbitrary' :: (GArbitrary SizedOptsDef a, BaseCase a) => Weights a -> Gen a
- genericArbitraryU' :: (GArbitrary SizedOptsDef a, BaseCase a, GUniformWeight a) => Gen a
- withBaseCase :: Gen a -> Gen a -> Gen a
- class BaseCaseSearch a (z :: Nat) (y :: Maybe Nat) e where
  - baseCaseSearch :: prox y -> proxy '(z, e) -> IfM y Gen (Proxy :: Type -> Type) a
- class BaseCaseSearching_ a (z :: k) (y :: Maybe t) where
  - baseCaseSearching_ :: proxy y -> proxy2 '(z, a) -> IfM y Gen (Proxy :: Type -> Type) a -> Gen a
- class BaseCaseSearching a (z :: k) where
  - baseCaseSearching :: proxy '(z, a) -> Gen a
- class BaseCase a where
  - baseCase :: Gen a
- type family IfM (b :: Maybe t) (c :: k) (d :: k) :: k
- type (==) (m :: Natural) (n :: Natural) = IsEQ (CmpNat m n)
- type family IsEQ (e :: Ordering) :: Bool
- type family (b :: Maybe Nat) ||? (c :: Maybe Nat) :: Maybe Nat
- type family (b :: Maybe Nat) &&? (c :: Maybe Nat) :: Maybe Nat
- type Max (m :: Natural) (n :: Natural) = MaxOf (CmpNat m n) m n
- type family MaxOf (e :: Ordering) (m :: k) (n :: k) :: k
- type Min (m :: Natural) (n :: Natural) = MinOf (CmpNat m n) m n
- type family MinOf (e :: Ordering) (m :: k) (n :: k) :: k
- class Alternative (IfM y Weighted (Proxy :: Type -> Type)) => GBCS (f :: k -> Type) (z :: Nat) (y :: Maybe Nat) e where
  - gbcs :: forall prox proxy (p :: k). prox y -> proxy '(z, e) -> IfM y Weighted (Proxy :: Type -> Type) (f p)
- class Alternative (IfM (yf ||? yg) Weighted (Proxy :: Type -> Type)) => GBCSSum (f :: k -> Type) (g :: k -> Type) (z :: k1) (e :: k2) (yf :: Maybe Nat) (yg :: Maybe Nat) where
  - gbcsSum :: forall prox proxy (p :: k). prox '(yf, yg) -> proxy '(z, e) -> IfM yf Weighted (Proxy :: Type -> Type) (f p) -> IfM yg Weighted (Proxy :: Type -> Type) (g p) -> IfM (yf ||? yg) Weighted (Proxy :: Type -> Type) ((f :+: g) p)
- class GBCSSumCompare (f :: k -> Type) (g :: k -> Type) (z :: k1) (e :: k2) (o :: k3) where
  - gbcsSumCompare :: forall proxy0 proxy (p :: k). proxy0 o -> proxy '(z, e) -> Weighted (f p) -> Weighted (g p) -> Weighted ((f :+: g) p)
- class Alternative (IfM (yf &&? yg) Weighted (Proxy :: Type -> Type)) => GBCSProduct (f :: k -> Type) (g :: k -> Type) (z :: k1) (e :: k2) (yf :: Maybe Nat) (yg :: Maybe Nat) where
  - gbcsProduct :: forall prox proxy (p :: k). prox '(yf, yg) -> proxy '(z, e) -> IfM yf Weighted (Proxy :: Type -> Type) (f p) -> IfM yg Weighted (Proxy :: Type -> Type) (g p) -> IfM (yf &&? yg) Weighted (Proxy :: Type -> Type) ((f :*: g) p)
- class IsMaybe (b :: Maybe t) where
  - ifMmap :: forall {k1} {k2} proxy c (a :: k1) c' (a' :: k2) d d'. proxy b -> (c a -> c' a') -> (d a -> d' a') -> IfM b c d a -> IfM b c' d' a'
  - ifM :: forall {k} proxy c (a :: k) d. proxy b -> c a -> d a -> IfM b c d a
- class GBaseCaseSearch a (z :: k) (y :: Maybe t) (e :: k1) where
  - gBaseCaseSearch :: prox y -> proxy '(z, e) -> IfM y Gen (Proxy :: Type -> Type) a

# Documentation

genericArbitrary' Source #

Arguments

:: (GArbitrary SizedOptsDef a, BaseCase a) |
=> Weights a | List of weights for every constructor
-> Gen a |

Decrease size to ensure termination for recursive types, looking for base cases once the size reaches 0.

    genericArbitrary' (17 % 19 % 23 % ()) :: Gen a

N.B.: This replaces the generator for fields of type `[t]` with ``listOf'` arbitrary` instead of ``listOf` arbitrary` (i.e., `arbitrary` for lists).

genericArbitraryU' :: (GArbitrary SizedOptsDef a, BaseCase a, GUniformWeight a) => Gen a Source #

Equivalent to ``genericArbitrary'` `uniform``.

    genericArbitraryU' :: Gen a

N.B.: This replaces the generator for fields of type `[t]` with ``listOf'` arbitrary` instead of ``listOf` arbitrary` (i.e., `arbitrary` for lists).

withBaseCase :: Gen a -> Gen a -> Gen a Source #

Run the first generator if the size is positive. Run the second if the size is zero.

    defaultGen `withBaseCase` baseCaseGen

class BaseCaseSearch a (z :: Nat) (y :: Maybe Nat) e where Source #

Find a base case of type `a` with maximum depth `z`, recursively using `BaseCaseSearch` instances to search deeper levels.

`y` is the depth of a base case, if found.

`e` is the original type the search started with, that `a` appears in. It is used for error reporting.

Methods

baseCaseSearch :: prox y -> proxy '(z, e) -> IfM y Gen (Proxy :: Type -> Type) a Source #

#### Instances

Instances details

y ~ 'Just 0 => BaseCaseSearch Ordering z y e Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods baseCaseSearch :: prox y -> proxy '(z, e) -> IfM y Gen (Proxy :: Type -> Type) Ordering Source #
y ~ 'Just 0 => BaseCaseSearch Integer z y e Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods baseCaseSearch :: prox y -> proxy '(z, e) -> IfM y Gen (Proxy :: Type -> Type) Integer Source #
y ~ 'Just 0 => BaseCaseSearch () z y e Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods baseCaseSearch :: prox y -> proxy '(z, e) -> IfM y Gen (Proxy :: Type -> Type) () Source #
y ~ 'Just 0 => BaseCaseSearch Bool z y e Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods baseCaseSearch :: prox y -> proxy '(z, e) -> IfM y Gen (Proxy :: Type -> Type) Bool Source #
y ~ 'Just 0 => BaseCaseSearch Char z y e Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods baseCaseSearch :: prox y -> proxy '(z, e) -> IfM y Gen (Proxy :: Type -> Type) Char Source #
y ~ 'Just 0 => BaseCaseSearch Double z y e Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods baseCaseSearch :: prox y -> proxy '(z, e) -> IfM y Gen (Proxy :: Type -> Type) Double Source #
y ~ 'Just 0 => BaseCaseSearch Float z y e Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods baseCaseSearch :: prox y -> proxy '(z, e) -> IfM y Gen (Proxy :: Type -> Type) Float Source #
y ~ 'Just 0 => BaseCaseSearch Int z y e Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods baseCaseSearch :: prox y -> proxy '(z, e) -> IfM y Gen (Proxy :: Type -> Type) Int Source #
y ~ 'Just 0 => BaseCaseSearch Word z y e Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods baseCaseSearch :: prox y -> proxy '(z, e) -> IfM y Gen (Proxy :: Type -> Type) Word Source #
GBaseCaseSearch a z y e => BaseCaseSearch a z y e Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods baseCaseSearch :: prox y -> proxy '(z, e) -> IfM y Gen (Proxy :: Type -> Type) a Source #
y ~ 'Just 0 => BaseCaseSearch [a] z y e Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods baseCaseSearch :: prox y -> proxy '(z, e) -> IfM y Gen (Proxy :: Type -> Type) [a] Source #

class BaseCaseSearching_ a (z :: k) (y :: Maybe t) where Source #

Methods

baseCaseSearching_ :: proxy y -> proxy2 '(z, a) -> IfM y Gen (Proxy :: Type -> Type) a -> Gen a Source #

#### Instances

Instances details

BaseCaseSearching a (z + 1) => BaseCaseSearching_ a (z :: Natural) ('Nothing :: Maybe t) Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods baseCaseSearching_ :: proxy ('Nothing :: Maybe t) -> proxy2 '(z, a) -> IfM ('Nothing :: Maybe t) Gen (Proxy :: Type -> Type) a -> Gen a Source #
BaseCaseSearching_ a (z :: k) ('Just m :: Maybe t) Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods baseCaseSearching_ :: proxy ('Just m) -> proxy2 '(z, a) -> IfM ('Just m) Gen (Proxy :: Type -> Type) a -> Gen a Source #

class BaseCaseSearching a (z :: k) where Source #

Progressively increase the depth bound for `BaseCaseSearch`.

Methods

baseCaseSearching :: proxy '(z, a) -> Gen a Source #

#### Instances

Instances details

(BaseCaseSearch a z y a, BaseCaseSearching_ a z y) => BaseCaseSearching a (z :: Nat) Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods baseCaseSearching :: proxy '(z, a) -> Gen a Source #

class BaseCase a where Source #

Custom instances can override the default behavior.

Methods

baseCase :: Gen a Source #

Generator of base cases.

#### Instances

Instances details

BaseCaseSearching a 0 => BaseCase a Source # | Overlappable
Instance details Defined in Generic.Random.Internal.BaseCase Methods baseCase :: Gen a Source #

type family IfM (b :: Maybe t) (c :: k) (d :: k) :: k Source #

#### Instances

Instances details

type IfM ('Nothing :: Maybe t) (c :: k) (d :: k) Source # |
Instance details Defined in Generic.Random.Internal.BaseCase type IfM ('Nothing :: Maybe t) (c :: k) (d :: k) = d
type IfM ('Just t2 :: Maybe t1) (c :: k) (d :: k) Source # |
Instance details Defined in Generic.Random.Internal.BaseCase type IfM ('Just t2 :: Maybe t1) (c :: k) (d :: k) = c

type (==) (m :: Natural) (n :: Natural) = IsEQ (CmpNat m n) Source #

type family IsEQ (e :: Ordering) :: Bool Source #

#### Instances

Instances details

type IsEQ 'EQ Source # |
Instance details Defined in Generic.Random.Internal.BaseCase type IsEQ 'EQ = 'True
type IsEQ 'GT Source # |
Instance details Defined in Generic.Random.Internal.BaseCase type IsEQ 'GT = 'False
type IsEQ 'LT Source # |
Instance details Defined in Generic.Random.Internal.BaseCase type IsEQ 'LT = 'False

type family (b :: Maybe Nat) ||? (c :: Maybe Nat) :: Maybe Nat Source #

#### Instances

Instances details

type m ||? ('Nothing :: Maybe Nat) Source # |
Instance details Defined in Generic.Random.Internal.BaseCase type m ||? ('Nothing :: Maybe Nat) = m
type ('Nothing :: Maybe Nat) ||? n Source # |
Instance details Defined in Generic.Random.Internal.BaseCase type ('Nothing :: Maybe Nat) ||? n = n
type ('Just m) ||? ('Just n) Source # |
Instance details Defined in Generic.Random.Internal.BaseCase type ('Just m) ||? ('Just n) = 'Just (Min m n)

type family (b :: Maybe Nat) &&? (c :: Maybe Nat) :: Maybe Nat Source #

#### Instances

Instances details

type m &&? ('Nothing :: Maybe Nat) Source # |
Instance details Defined in Generic.Random.Internal.BaseCase type m &&? ('Nothing :: Maybe Nat) = 'Nothing :: Maybe Nat
type ('Nothing :: Maybe Nat) &&? n Source # |
Instance details Defined in Generic.Random.Internal.BaseCase type ('Nothing :: Maybe Nat) &&? n = 'Nothing :: Maybe Nat
type ('Just m) &&? ('Just n) Source # |
Instance details Defined in Generic.Random.Internal.BaseCase type ('Just m) &&? ('Just n) = 'Just (Max m n)

type Max (m :: Natural) (n :: Natural) = MaxOf (CmpNat m n) m n Source #

type family MaxOf (e :: Ordering) (m :: k) (n :: k) :: k Source #

#### Instances

Instances details

type MaxOf 'EQ (m :: k) (n :: k) Source # |
Instance details Defined in Generic.Random.Internal.BaseCase type MaxOf 'EQ (m :: k) (n :: k) = m
type MaxOf 'GT (m :: k) (n :: k) Source # |
Instance details Defined in Generic.Random.Internal.BaseCase type MaxOf 'GT (m :: k) (n :: k) = m
type MaxOf 'LT (m :: k) (n :: k) Source # |
Instance details Defined in Generic.Random.Internal.BaseCase type MaxOf 'LT (m :: k) (n :: k) = n

type Min (m :: Natural) (n :: Natural) = MinOf (CmpNat m n) m n Source #

type family MinOf (e :: Ordering) (m :: k) (n :: k) :: k Source #

#### Instances

Instances details

type MinOf 'EQ (m :: k) (n :: k) Source # |
Instance details Defined in Generic.Random.Internal.BaseCase type MinOf 'EQ (m :: k) (n :: k) = n
type MinOf 'GT (m :: k) (n :: k) Source # |
Instance details Defined in Generic.Random.Internal.BaseCase type MinOf 'GT (m :: k) (n :: k) = n
type MinOf 'LT (m :: k) (n :: k) Source # |
Instance details Defined in Generic.Random.Internal.BaseCase type MinOf 'LT (m :: k) (n :: k) = m

class Alternative (IfM y Weighted (Proxy :: Type -> Type)) => GBCS (f :: k -> Type) (z :: Nat) (y :: Maybe Nat) e where Source #

Methods

gbcs :: forall prox proxy (p :: k). prox y -> proxy '(z, e) -> IfM y Weighted (Proxy :: Type -> Type) (f p) Source #

#### Instances

Instances details

(TypeError (((('Text "Unrecognized Rep: " ':<>: 'ShowType f) ':$$: 'Text "Possible causes:") ':$$: (('Text " Missing (" ':<>: 'ShowType (BaseCase e)) ':<>: 'Text ") constraint")) ':$$: 'Text " Missing Generic instance") :: Constraint, Alternative (IfM y Weighted (Proxy :: Type -> Type))) => GBCS (f :: k -> Type) z y e Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods gbcs :: forall prox proxy (p :: k). prox y -> proxy '(z, e) -> IfM y Weighted (Proxy :: Type -> Type) (f p) Source #
y ~ 'Just 0 => GBCS (U1 :: k -> Type) z y e Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods gbcs :: forall prox proxy (p :: k). prox y -> proxy '(z, e) -> IfM y Weighted (Proxy :: Type -> Type) (U1 p) Source #
(Alternative (IfM y Weighted (Proxy :: Type -> Type)), GBCSProduct f g z e yf yg, GBCS f z yf e, GBCS g z yg e, y ~ (yf &&? yg)) => GBCS (f :*: g :: k -> Type) z y e Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods gbcs :: forall prox proxy (p :: k). prox y -> proxy '(z, e) -> IfM y Weighted (Proxy :: Type -> Type) ((f :*: g) p) Source #
(Alternative (IfM y Weighted (Proxy :: Type -> Type)), GBCSSum f g z e yf yg, GBCS f z yf e, GBCS g z yg e, y ~ (yf ||? yg)) => GBCS (f :+: g :: k -> Type) z y e Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods gbcs :: forall prox proxy (p :: k). prox y -> proxy '(z, e) -> IfM y Weighted (Proxy :: Type -> Type) ((f :+: g) p) Source #
(BaseCaseSearch c (z - 1) y e, (z == 0) ~ 'False, Alternative (IfM y Weighted (Proxy :: Type -> Type)), IsMaybe y) => GBCS (K1 i c :: k -> Type) z y e Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods gbcs :: forall prox proxy (p :: k). prox y -> proxy '(z, e) -> IfM y Weighted (Proxy :: Type -> Type) (K1 i c p) Source #
y ~ ('Nothing :: Maybe Nat) => GBCS (K1 i c :: k -> Type) 0 y e Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods gbcs :: forall prox proxy (p :: k). prox y -> proxy '(0, e) -> IfM y Weighted (Proxy :: Type -> Type) (K1 i c p) Source #
GBCS f z y e => GBCS (M1 i c f :: k -> Type) z y e Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods gbcs :: forall prox proxy (p :: k). prox y -> proxy '(z, e) -> IfM y Weighted (Proxy :: Type -> Type) (M1 i c f p) Source #

class Alternative (IfM (yf ||? yg) Weighted (Proxy :: Type -> Type)) => GBCSSum (f :: k -> Type) (g :: k -> Type) (z :: k1) (e :: k2) (yf :: Maybe Nat) (yg :: Maybe Nat) where Source #

Methods

gbcsSum :: forall prox proxy (p :: k). prox '(yf, yg) -> proxy '(z, e) -> IfM yf Weighted (Proxy :: Type -> Type) (f p) -> IfM yg Weighted (Proxy :: Type -> Type) (g p) -> IfM (yf ||? yg) Weighted (Proxy :: Type -> Type) ((f :+: g) p) Source #

#### Instances

Instances details

GBCSSum (f :: k1 -> Type) (g :: k1 -> Type) (z :: k2) (e :: k3) ('Nothing :: Maybe Nat) ('Nothing :: Maybe Nat) Source # |

Instance details

Defined in Generic.Random.Internal.BaseCase

Methods

gbcsSum :: forall prox proxy (p :: k1). prox '('Nothing :: Maybe Nat, 'Nothing :: Maybe Nat) -> proxy '(z, e) -> IfM ('Nothing :: Maybe Nat) Weighted (Proxy :: Type -> Type) (f p) -> IfM ('Nothing :: Maybe Nat) Weighted (Proxy :: Type -> Type) (g p) -> IfM (('Nothing :: Maybe Nat) ||? ('Nothing :: Maybe Nat)) Weighted (Proxy :: Type -> Type) ((f :+: g) p) Source #

GBCSSum (f :: k1 -> Type) (g :: k1 -> Type) (z :: k2) (e :: k3) ('Nothing :: Maybe Nat) ('Just n) Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods gbcsSum :: forall prox proxy (p :: k1). prox '('Nothing :: Maybe Nat, 'Just n) -> proxy '(z, e) -> IfM ('Nothing :: Maybe Nat) Weighted (Proxy :: Type -> Type) (f p) -> IfM ('Just n) Weighted (Proxy :: Type -> Type) (g p) -> IfM (('Nothing :: Maybe Nat) ||? 'Just n) Weighted (Proxy :: Type -> Type) ((f :+: g) p) Source #
GBCSSum (f :: k1 -> Type) (g :: k1 -> Type) (z :: k2) (e :: k3) ('Just m) ('Nothing :: Maybe Nat) Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods gbcsSum :: forall prox proxy (p :: k1). prox '('Just m, 'Nothing :: Maybe Nat) -> proxy '(z, e) -> IfM ('Just m) Weighted (Proxy :: Type -> Type) (f p) -> IfM ('Nothing :: Maybe Nat) Weighted (Proxy :: Type -> Type) (g p) -> IfM ('Just m ||? ('Nothing :: Maybe Nat)) Weighted (Proxy :: Type -> Type) ((f :+: g) p) Source #
GBCSSumCompare f g z e (CmpNat m n) => GBCSSum (f :: k1 -> Type) (g :: k1 -> Type) (z :: k2) (e :: k3) ('Just m) ('Just n) Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods gbcsSum :: forall prox proxy (p :: k1). prox '('Just m, 'Just n) -> proxy '(z, e) -> IfM ('Just m) Weighted (Proxy :: Type -> Type) (f p) -> IfM ('Just n) Weighted (Proxy :: Type -> Type) (g p) -> IfM ('Just m ||? 'Just n) Weighted (Proxy :: Type -> Type) ((f :+: g) p) Source #

class GBCSSumCompare (f :: k -> Type) (g :: k -> Type) (z :: k1) (e :: k2) (o :: k3) where Source #

Methods

gbcsSumCompare :: forall proxy0 proxy (p :: k). proxy0 o -> proxy '(z, e) -> Weighted (f p) -> Weighted (g p) -> Weighted ((f :+: g) p) Source #

#### Instances

Instances details

GBCSSumCompare (f :: k1 -> Type) (g :: k1 -> Type) (z :: k2) (e :: k3) 'EQ Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods gbcsSumCompare :: forall proxy0 proxy (p :: k1). proxy0 'EQ -> proxy '(z, e) -> Weighted (f p) -> Weighted (g p) -> Weighted ((f :+: g) p) Source #
GBCSSumCompare (f :: k1 -> Type) (g :: k1 -> Type) (z :: k2) (e :: k3) 'GT Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods gbcsSumCompare :: forall proxy0 proxy (p :: k1). proxy0 'GT -> proxy '(z, e) -> Weighted (f p) -> Weighted (g p) -> Weighted ((f :+: g) p) Source #
GBCSSumCompare (f :: k1 -> Type) (g :: k1 -> Type) (z :: k2) (e :: k3) 'LT Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods gbcsSumCompare :: forall proxy0 proxy (p :: k1). proxy0 'LT -> proxy '(z, e) -> Weighted (f p) -> Weighted (g p) -> Weighted ((f :+: g) p) Source #

class Alternative (IfM (yf &&? yg) Weighted (Proxy :: Type -> Type)) => GBCSProduct (f :: k -> Type) (g :: k -> Type) (z :: k1) (e :: k2) (yf :: Maybe Nat) (yg :: Maybe Nat) where Source #

Methods

gbcsProduct :: forall prox proxy (p :: k). prox '(yf, yg) -> proxy '(z, e) -> IfM yf Weighted (Proxy :: Type -> Type) (f p) -> IfM yg Weighted (Proxy :: Type -> Type) (g p) -> IfM (yf &&? yg) Weighted (Proxy :: Type -> Type) ((f :*: g) p) Source #

#### Instances

Instances details

(yf &&? yg) ~ ('Nothing :: Maybe Nat) => GBCSProduct (f :: k1 -> Type) (g :: k1 -> Type) (z :: k2) (e :: k3) yf yg Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods gbcsProduct :: forall prox proxy (p :: k1). prox '(yf, yg) -> proxy '(z, e) -> IfM yf Weighted (Proxy :: Type -> Type) (f p) -> IfM yg Weighted (Proxy :: Type -> Type) (g p) -> IfM (yf &&? yg) Weighted (Proxy :: Type -> Type) ((f :*: g) p) Source #
GBCSProduct (f :: k1 -> Type) (g :: k1 -> Type) (z :: k2) (e :: k3) ('Just m) ('Just n) Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods gbcsProduct :: forall prox proxy (p :: k1). prox '('Just m, 'Just n) -> proxy '(z, e) -> IfM ('Just m) Weighted (Proxy :: Type -> Type) (f p) -> IfM ('Just n) Weighted (Proxy :: Type -> Type) (g p) -> IfM ('Just m &&? 'Just n) Weighted (Proxy :: Type -> Type) ((f :*: g) p) Source #

class IsMaybe (b :: Maybe t) where Source #

Methods

ifMmap :: forall {k1} {k2} proxy c (a :: k1) c' (a' :: k2) d d'. proxy b -> (c a -> c' a') -> (d a -> d' a') -> IfM b c d a -> IfM b c' d' a' Source #

ifM :: forall {k} proxy c (a :: k) d. proxy b -> c a -> d a -> IfM b c d a Source #

#### Instances

Instances details

IsMaybe ('Nothing :: Maybe t) Source # |

Instance details

Defined in Generic.Random.Internal.BaseCase

Methods

ifMmap :: forall {k1} {k2} proxy c (a :: k1) c' (a' :: k2) d d'. proxy ('Nothing :: Maybe t) -> (c a -> c' a') -> (d a -> d' a') -> IfM ('Nothing :: Maybe t) c d a -> IfM ('Nothing :: Maybe t) c' d' a' Source #

ifM :: forall {k} proxy c (a :: k) d. proxy ('Nothing :: Maybe t) -> c a -> d a -> IfM ('Nothing :: Maybe t) c d a Source #

IsMaybe ('Just t2 :: Maybe t1) Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods ifMmap :: forall {k1} {k2} proxy c (a :: k1) c' (a' :: k2) d d'. proxy ('Just t2) -> (c a -> c' a') -> (d a -> d' a') -> IfM ('Just t2) c d a -> IfM ('Just t2) c' d' a' Source # ifM :: forall {k} proxy c (a :: k) d. proxy ('Just t2) -> c a -> d a -> IfM ('Just t2) c d a Source #

class GBaseCaseSearch a (z :: k) (y :: Maybe t) (e :: k1) where Source #

Methods

gBaseCaseSearch :: prox y -> proxy '(z, e) -> IfM y Gen (Proxy :: Type -> Type) a Source #

#### Instances

Instances details

(Generic a, GBCS (Rep a) z y e, IsMaybe y) => GBaseCaseSearch a (z :: Nat) (y :: Maybe Nat) (e :: Type) Source # |
Instance details Defined in Generic.Random.Internal.BaseCase Methods gBaseCaseSearch :: prox y -> proxy '(z, e) -> IfM y Gen (Proxy :: Type -> Type) a Source #