Idris2Doc : Deriving.DepTyCheck.Gen.Tuning

Deriving.DepTyCheck.Gen.Tuning

(source)

Reexports

importpublic Data.Nat1
importpublic Language.Reflection.Compat.Constr
importpublic Syntax.IHateParens.List

Definitions

interfaceGenOrderTuning : Name->Type
  A magic interface for tuning the order of generation in derived generators

This interface defines a function `isConstructor` which can be implemented only by calling a macro `itIsConstructor`.
If the argument of the implementation is not a name of a constructor, you will get a compilation error at this point.

`deriveFirst` function gets some information about given arguments in the current derivation task,
and returns constructor's arguments that must be generated first in the derived generator, in order.
If given arguments require some other arguments to be derived before them, these arguments would be generated appropriately.
Any repetitions, mentions of already given arguments and mentions of arguments that will be generated by arguments earlier in the list
will be simply ignored.

Constructor arguments can be given by their number or their name (using name literals).

Typical usage is the following:

```idris
data X : Nat -> Nat -> Type where
X1 : (n, m : Nat) -> n `LT` m => X n m
X2 : X n n

GenOrderTuning "X".dataCon where
isConstructor = itIsConstructor
deriveFirst gt gc = [`{m}, 2] -- 2 is the `LT` argument
```

Parameters: n
Methods:
isConstructor : (con : IsConstructorn**GenuineProofcon)
deriveFirst : List (Fin ((((isConstructor.fst) .typeInfo) .args) .length)) ->List (Fin ((((isConstructor.fst) .conInfo) .args) .length)) ->List (ConArg ((isConstructor.fst) .conInfo))
isConstructor : GenOrderTuningn=> (con : IsConstructorn**GenuineProofcon)
Totality: total
Visibility: public export
deriveFirst : {auto__con : GenOrderTuningn} ->List (Fin ((((isConstructor.fst) .typeInfo) .args) .length)) ->List (Fin ((((isConstructor.fst) .conInfo) .args) .length)) ->List (ConArg ((isConstructor.fst) .conInfo))
Totality: total
Visibility: public export
interfaceProbabilityTuning : Name->Type
Parameters: n
Methods:
0isConstructor : (con : IsConstructorn**GenuineProofcon)
tuneWeight : Nat1->Nat1
0isConstructor : ProbabilityTuningn=> (con : IsConstructorn**GenuineProofcon)
Totality: total
Visibility: public export
tuneWeight : ProbabilityTuningn=>Nat1->Nat1
Totality: total
Visibility: public export