-
Notifications
You must be signed in to change notification settings - Fork 182
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
Add FnOnce trait, and provide impl for Function type #494
Conversation
70dd385
to
91653d0
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.
Like #475, this doesn't handle Output
? I'm mostly okay with waiting until later to add FnMut
and FnOnce
, but I feel like it would be simple enough to add here.
Btw I do have this and the output type implemented locally. But it's based on my closures branch, so I would have to split it out. |
fa10f9b
to
8ba097c
Compare
Works towards rust-lang#363 I've followed the approach taken by rustc, where `FnOnce` has single generic argument: the tupled function parameters (e.g. `fn(u8, bool): FnOnce<(u8, bool)>`). I also extended the grammar to allow functions to take more than one argument. I've left `Fn` and `FnMut` for a separate PR - without a representation of closures in Chalk, they are not very useful.
bf38c30
to
dbdcbdd
Compare
@jackh726: I've added |
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.
Couple small things. And I want @nikomatsakis to take a quick look. But looks pretty good to me.
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.
Looks good! One comment.
@nikomatsakis: I've added a |
Works towards #363
I've followed the approach taken by rustc, where
FnOnce
has singlegeneric argument: the tupled function parameters
(e.g.
fn(u8, bool): FnOnce<(u8, bool)>
).I also extended the grammar to allow functions to take more than one
argument.