Idris2Doc : Test.DepTyCheck.Gen

Test.DepTyCheck.Gen

(source)

Reexports

importpublic Control.Monad.Error.Interface
importpublic Control.Monad.Random.Interface
importpublic Data.CheckedEmpty.List.Lazy
importpublic Data.Nat1
importpublic Language.Implicits.IfUnsolved
importpublic Test.DepTyCheck.Gen.Emptiness
importpublic Test.DepTyCheck.Gen.Labels

Definitions

wrapLazy : (a->b) -> Lazy a-> Lazy b
Totality: total
Visibility: public export
dataGen : Emptiness->Type->Type
Totality: total
Visibility: export
Constructors:
Empty : GenMaybeEmptya
Pure : a->Genema
Raw : RawGena->Genema
OneOf : (gs : GenAlternativesTruealema) -> {auto0_ : AllIsNonEmptygs} -> {auto0_ : alem `NoWeaker` em} ->Genema
Bind : {auto0_ : biem `NoWeaker` em} ->RawGenc-> (c->Genbiema) ->Genema
Labelled : Label-> (g : Genema) -> {auto0_ : IsNonEmptyg} ->Genema

Hints:
Applicative (Genem)
Functor (Genem)
Monad (Genem)
recordGenAlternatives : (0_ : Bool) -> (0_ : Emptiness) ->Type->Type
Totality: total
Visibility: export
Constructor: 
MkGenAlts : LazyLstmustBeNotEmpty (Nat1, Lazy (Genema)) ->GenAlternativesmustBeNotEmptyema

Projection: 
.unGenAlts : GenAlternativesmustBeNotEmptyema->LazyLstmustBeNotEmpty (Nat1, Lazy (Genema))

Hints:
Alternative (GenAlternativesFalseem)
Applicative (GenAlternativesneem)
Cast (LazyLstnea) (GenAlternativesneema)
Functor (GenAlternativesneem)
Monad (GenAlternativesTrueem)
Gen1 : Type->Type
Totality: total
Visibility: public export
Gen0 : Type->Type
  Generator with least guarantees on emptiness.

This type should not be used as an input argument unless it is strictly required.
You should prefer to be polymorphic on emptiness instead.

Totality: total
Visibility: public export
chooseAny : Randoma=> {auto0_ : IfUnsolvedneNonEmpty} ->Gennea
Totality: total
Visibility: export
chooseAnyOf : (0a : Type) ->Randoma=> {auto0_ : IfUnsolvedneNonEmpty} ->Gennea
Totality: total
Visibility: public export
choose : Randoma=> {auto0_ : IfUnsolvedneNonEmpty} -> (a, a) ->Gennea
Totality: total
Visibility: export
empty : Gen0a
Totality: total
Visibility: export
label : Label->Genema->Genema
Totality: total
Visibility: export
relax : {auto0_ : iem `NoWeaker` em} ->Geniema->Genema
Totality: total
Visibility: export
dataAltsNonEmpty : Bool->Emptiness->Type
Totality: total
Visibility: public export
Constructors:
NT : AltsNonEmptyTrueNonEmpty
Sx : AltsNonEmptyaltsNeMaybeEmpty
altsNonEmptyTrue : AltsNonEmptyTrueem
Totality: total
Visibility: export
unGen1 : MonadRandomm=>CanManageLabelsm=>Gen1a->ma
Totality: total
Visibility: export
unGenAll' : RandomGeng=>g->Gen1a->Stream (g, a)
Totality: total
Visibility: export
unGenAll : RandomGeng=>g->Gen1a->Streama
Totality: total
Visibility: export
pick1 : CanInitSeedgm=>Functorm=>Gen1a->ma
  Picks one random value from a generator

Totality: total
Visibility: export
unGen : MonadRandomm=>MonadError () m=>CanManageLabelsm=>Genema->ma
Totality: total
Visibility: export
unGen' : MonadRandomm=>CanManageLabelsm=>Genema->m (Maybea)
Totality: total
Visibility: export
unGenTryAll' : RandomGeng=>g->Genema->Stream (g, Maybea)
Totality: total
Visibility: export
unGenTryAll : RandomGeng=>g->Genema->Stream (Maybea)
Totality: total
Visibility: export
unGenTryN : RandomGeng=>Nat->g->Genema->LazyLista
Totality: total
Visibility: export
pick : CanInitSeedgm=>Functorm=>Genema->m (Maybea)
  Tries once to pick a random value from a generator

Totality: total
Visibility: export
pickTryN : CanInitSeedgm=>Functorm=> (n : Nat) ->Genema->m (Maybe (Finn, a))
  Tries to pick a random value from a generator, returning the number of unsuccessful attempts, if generated successfully

Totality: total
Visibility: export
Nil : GenAlternativesFalseema
Totality: total
Visibility: export
(::) : {auto0_ : lem `NoWeaker` em} -> {auto0_ : rem `NoWeaker` em} -> {auto0_ : IfUnsolvedeTrue} -> {auto0_ : IfUnsolvedemNonEmpty} -> {auto0_ : IfUnsolvedlemem} -> {auto0_ : IfUnsolvedremem} -> Lazy (Genlema) -> Lazy (GenAlternativeserema) ->GenAlternativesneema
Totality: total
Visibility: export
Fixity Declaration: infixr operator, level 7
(++) : {auto0_ : lem `NoWeaker` em} -> {auto0_ : rem `NoWeaker` em} -> {auto0_ : IfUnsolvedlemem} -> {auto0_ : IfUnsolvedremem} -> {auto0_ : IfUnsolvednelFalse} -> {auto0_ : IfUnsolvednerFalse} ->GenAlternativesnellema-> Lazy (GenAlternativesnerrema) ->GenAlternatives (nel|| Delay ner) ema
Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 7
length : GenAlternativesneema->Nat
Totality: total
Visibility: public export
processAlternatives : (Genema->Genemb) ->GenAlternativesneema->GenAlternativesneemb
Totality: total
Visibility: export
processAlternativesMaybe : (Genema->Maybe (Lazy (Genemb))) ->GenAlternativesneema->GenAlternativesFalseemb
Totality: total
Visibility: export
processAlternatives'' : (Genema->GenAlternativesnebemb) ->GenAlternativesneaema->GenAlternatives (nea&& Delay neb) emb
Totality: total
Visibility: export
processAlternatives' : (Genema->GenAlternativesneemb) ->GenAlternativesneema->GenAlternativesneemb
Totality: total
Visibility: export
relax : GenAlternativesTrueema->GenAlternativesneema
Totality: total
Visibility: export
strengthen : GenAlternativesneema->Maybe (GenAlternativesTrueema)
Totality: total
Visibility: export
altsFromList : LazyLstnea->GenAlternativesneema
Totality: total
Visibility: public export
oneOf : {auto0_ : alem `NoWeaker` em} -> {auto0_ : AltsNonEmptyaltsNeem} -> {auto0_ : IfUnsolvedalemem} -> {auto0_ : IfUnsolvedaltsNe (em/=MaybeEmpty)} ->GenAlternativesaltsNealema->Genema
  Choose one of the given generators uniformly.

All the given generators are treated as independent, i.e. `oneOf [oneOf [a, b], c]` is not the same as `oneOf [a, b, c]`.
In this example case, generator `oneOf [a, b]` and generator `c` will have the same probability in the resulting generator.

Totality: total
Visibility: export
frequency : {auto0_ : alem `NoWeaker` em} -> {auto0_ : AltsNonEmptyaltsNeem} -> {auto0_ : IfUnsolvedalemem} -> {auto0_ : IfUnsolvedaltsNe (em/=MaybeEmpty)} ->LazyLstaltsNe (Nat1, Lazy (Genalema)) ->Genema
  Choose one of the given generators with probability proportional to the given value, treating all source generators independently.

This function treats given generators in the same way as `oneOf` do, but the resulting generator uses generator
from the given list the more frequently, the higher number is has.
If generator `g1` has the frequency `n1` and generator `g2` has the frequency `n2`, than `g1` will be used `n1/n2` times
more frequently than `g2` in the resulting generator (in case when `g1` and `g2` always generate some value).

Totality: total
Visibility: export
elements : {auto0_ : AltsNonEmptyaltsNeem} -> {auto0_ : IfUnsolvedemNonEmpty} -> {auto0_ : IfUnsolvedaltsNe (em/=MaybeEmpty)} ->LazyLstaltsNea->Genema
  Choose one of the given values uniformly.

This function is equivalent to `oneOf` applied to list of `pure` generators per each value.

Totality: total
Visibility: export
elements' : Foldablef=> {auto0_ : IfUnsolvedfList} ->fa->Gen0a
Totality: total
Visibility: export
alternativesOf : Genema->GenAlternativesTrueema
  Shallow alternatives of a generator.

If the given generator is made by one of `oneOf`, `frequency` or `elements`,
this function returns alternatives which this generators contains.
Otherwise it returns a single-element alternative list containing given generator.

In a sense, this function is a reverse function of `oneOf`, i.g.
`oneOf $ alternativesOf g` must be equivalent to `g` and
`alternativesof $ oneOf gs` must be equivalent to `gs`.

Totality: total
Visibility: export
deepAlternativesOf : Nat->Genema->GenAlternativesTrueema
  Any depth alternatives fetching.

Alternatives of depth `0` are meant to be a single-item alternatives list with the original generator,
alternatives of depth `1` are those returned by the `alternativesOf` function,
alternatives of depth `n+1` are alternatives of all alternatives of depth `n` being flattened into a single alternatives list.

Totality: total
Visibility: export
forgetAlternatives : Genema->Genema
  Returns generator with internal structure hidden for `alternativesOf`,
except for an empty generator, which would still be returned as an empty generator.

This function must not change distribution when the resulting generator used with usual `Gen` combinators.

Please notice that this function does NOT influence to the result of `deepAlternativesOf`, if depth is increased by 1.

Totality: total
Visibility: export
forgetStructure : Genema->Genema
  Returns generator with internal structure hidden to anything, including combinators,
except for an empty generator, which would still be returned as an empty generator.

Apply with care! Don't use until you understand what you are doing!
Most probably, you need the lighter version of this function called `forgetAlternatives`.
The difference is that `forgetAlternatives` do not influence on the resulting distribution,
when this function may ruin it unexpectedly.

But despite `forgetAlternatives`, this function acts on `deepAlternativesOf`
like `forgetAlternatives` acts on `alternativesOf`,
i.e. `deepAlternativesOf` would give a single alternative for any depth
being applied to the result of this function.

Totality: total
Visibility: export
processAlternatives : (Genema->Genemb) ->Genema->GenAlternativesTrueemb
Totality: total
Visibility: public export
mapAlternativesOf : (a->b) ->Genema->GenAlternativesTrueemb
Totality: total
Visibility: public export
Fixity Declaration: infix operator, level 8
mapAlternativesWith : Genema-> (a->b) ->GenAlternativesTrueemb
Totality: total
Visibility: public export
Fixity Declaration: infix operator, level 8
withAlts : Genema->Genema->Genema
  Associative composition of two generators, merging shallow alternatives of given two generators

This operation being applied to arguments `a` and `b` is *not* the same as `oneOf [a, b]`.
Generator ``a `withAlts` b`` has equal probabilities of all shallow alternatives of generators `a` and `b`.
For example, when there are generators
```idris
g1 = oneOf [elems [0, 1, 2, 3], elems [4, 5]]
g2 = oneOf elemts [10, 11, 12, 13, 14, 15]
```
generator ``g1 `withAlts` g2`` would be equivalent to
`oneOf [elems [0, 1, 2, 3], elems [4, 5], pure 10, pure 11, pure 12, pure 13, pure 14, pure 15]`.

In other words, ``a `withAlts` b`` must be equivalent to `oneOf $ alternativesOf a ++ alternativesOf b`.

Totality: total
Visibility: export
Fixity Declaration: infixr operator, level 2
withDeepAlts : Nat->Genema->Genema->Genema
  Associative composition of two generators, merging deep alternatives of given two generators

This operation being applied to arguments `a` and `b` is *not* the same as `oneOf [a, b]`.
Generator ``a `withDeepAlts` b`` has equal probabilities of all deep alternatives of generators `a` and `b`.
For example, when there are generators
```idris
g1 = oneOf [elems [0, 1, 2, 3], elems [4, 5]]
g2 = oneOf elemts [10, 11, 12, 13, 14, 15]
```
generator ``withDeepAlts n g1 g2`` with `n >= 2` would be equivalent to
`oneOf elements [0, 1, 2, 3, 4, 5, 10, 11, 12, 13, 14, 15]`.

In other words, ``withDeepAlts d a b`` must be equivalent to `oneOf $ deepAlternativesOf d a ++ deepAlternativesOf d b`.

Totality: total
Visibility: export
mapMaybe : (a->Maybeb) ->Genema->Gen0b
Totality: total
Visibility: export
suchThat_withPrf : Genema-> (p : (a->Bool)) ->Gen0 (Subseta (So.p))
Totality: total
Visibility: export
suchThat : Genema-> (a->Bool) ->Gen0a
Totality: total
Visibility: public export
Fixity Declaration: infixl operator, level 4
suchThat_dec : Genema-> ((x : a) ->Dec (propx)) ->Gen0 (Subsetaprop)
Totality: total
Visibility: export
suchThat_invertedEq : DecEqb=>Genema-> (y : b) -> (f : (a->b)) ->Gen0 (Subseta (\x=>y=fx))
  Filters the given generator so, that resulting values `x` are solutions of equation `y = f x` for given `f` and `y`.

Totality: total
Visibility: export
retryUntil_withPrf : (p : (a->Bool)) -> (Fuel->Genema) ->Fuel->Gen0 (Subseta (So.p))
  More elegant version of `suchThat_withPrf` for fuelled generators.

Tries to repeat generation until there is some fuel, and fallback to `suchThat_withPrf` in case there isn't.

Totality: total
Visibility: export
retryUntil : (a->Bool) -> (Fuel->Genema) ->Fuel->Gen0a
  More elegant version of `suchThat` for fuelled generators.

Tries to repeat generation until there is some fuel, and fallback to `suchThat` in case there isn't.

Totality: total
Visibility: public export
retryUntil_dec : ((x : a) ->Dec (propx)) -> (Fuel->Genema) ->Fuel->Gen0 (Subsetaprop)
  More elegant version of `suchThat_dec` for fuelled generators.

Tries to repeat generation until there is some fuel, and fallback to `suchThat_dec` in case there isn't.

Totality: total
Visibility: export
variant : Nat->Genema->Genema
Totality: total
Visibility: export
listOf : {default (choose (0, 10)) _ : GenemNat} ->Genema->Genem (Lista)
Totality: total
Visibility: export
vectOf : Genema->Genem (Vectna)
Totality: total
Visibility: export