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

lens combinator? #20

Open
quinn-dougherty opened this issue Nov 9, 2021 · 1 comment
Open

lens combinator? #20

quinn-dougherty opened this issue Nov 9, 2021 · 1 comment

Comments

@quinn-dougherty
Copy link

Does it make sense to provide this combinator or does the MetaCoq aspect give us equivalent functionality?

Should be

Definition lens {a b c d : Type} (ac : a -> c) (adb : a -> d -> b) : Lens a b c d :=
  {| view := ac; over := fun (f : c -> d) (x : a) => adb x (f (ac x)) |}.
@gmalecha
Copy link
Collaborator

gmalecha commented May 14, 2024

This combinator makes sense, but it isn't the best implementation in a lot of cases because you will destruct x multiple times. For inductive types and such, what coq-elpi generates should be more efficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants