-
Notifications
You must be signed in to change notification settings - Fork 38
[Lean Backend] Add basic support for traits #1679
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
Conversation
5e43012
to
987c49d
Compare
987c49d
to
acda59a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a first pass and have some comments. The resulting code looks nice, it's great to have support for traits!
General comment about the description:
The example that comes after is supposed to show what is not supported? I think what is also interesting here is to try to define instances for these traits. I tried to do so and check the result with the F* backend, but I run into #1046. Anyway from the output you show it seems that the Lean support is the roughly the same as F* in this case. |
The example was to show the supported part (access only associated types defined within the same trait). I've added more test (and the missing support for types fields in impls) in 937ec0d. |
937ec0d
to
02d8765
Compare
I've rebased on main. |
This PR adds support for traits and implementations, and makes the output style more uniform. In a nutshell, Rust traits are represented as Lean classes, while Rust impl are Lean instances. The Lean code relies on the typeclass inference of Lean.
Overview
Details
Rust
Lean
Rust
Lean