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

New inspection: redundant explicit argument #294

Open
marat-rkh opened this issue Aug 28, 2021 · 0 comments
Open

New inspection: redundant explicit argument #294

marat-rkh opened this issue Aug 28, 2021 · 0 comments

Comments

@marat-rkh
Copy link
Member

Consider the following code:

\func foldr-append {A B : \Type} (** : A -> B -> B) (e : B) (xs ys : List A)
  : foldr ** e (xs ++ ys) = foldr ** (foldr ** e ys) xs \elim xs
  | [] => idp
  | :: x xs => pmap (x `**`) (foldr-append ** e xs ys)

Here, recursive call foldr-append ** e xs ys can be rewritten to foldr-append _ _ _ _. We could have an inspection that detects such cases and suggests a replacement.

I am not sure if it is cheap enough to run such inspection on the fly, so it could be

  • disabled by default
  • executed only before commit
  • a separate action that you run explicitly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants