Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support arbitrary order of arguments for derived generators #202

Open
buzden opened this issue Sep 23, 2024 · 1 comment
Open

Support arbitrary order of arguments for derived generators #202

buzden opened this issue Sep 23, 2024 · 1 comment
Labels
issue: compilation error When compilation error raises because of the library part: derivation Related to automated derivation of generators status: feature request Request for new functionality or improvement

Comments

@buzden
Copy link
Owner

buzden commented Sep 23, 2024

Say, I have a type

data X : Fin n -> Fin m -> Type where ...

and want to derive generator for it with all arguments given. I'd like to write something like

genX : {n : Nat} -> (f : Fin n) -> {m : Nat} -> (g : Fin m) -> Gen MaybeEmpty $ X f g
genX = deriveGen

but now I'm beaten with an error that the order of arguments must be the same as in type, i.e. to be the following:

genX : {m : Nat} -> {n : Nat} -> (f : Fin n) -> (g : Fin m) -> Gen MaybeEmpty $ X f g

which is not logical, nor convenient. The first type of signature should be supported too.

@buzden buzden added part: derivation Related to automated derivation of generators status: feature request Request for new functionality or improvement issue: compilation error When compilation error raises because of the library labels Sep 23, 2024
@buzden
Copy link
Owner Author

buzden commented Sep 23, 2024

Implementation detail: external generators, then, should be also allowed to have abritrary orders, thus we need to either store the signature of a generator, or permutation of its arguments in order to call them (including information of whether those arguments are explicit or implicit).

Additional advancement of being able to do this is that we would be able to use as externals arbitrary user %hint's, with any order of arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: compilation error When compilation error raises because of the library part: derivation Related to automated derivation of generators status: feature request Request for new functionality or improvement
Projects
None yet
Development

No branches or pull requests

1 participant