-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Avoid unnecessary quotation in elaboration #462
Conversation
let test : Array16 2 () -> Array16 2 () = fun x => x; | ||
let test : Array32 2 () -> Array32 2 () = fun x => x; | ||
let test : Array64 2 () -> Array64 2 () = fun x => x; | ||
let test : Array8 ((1 : U8) + (2 : U8)) () -> Array8 3 () = fun x => x; |
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 think we want simple expressions like this to be reduced in the final output. Maybe allow marking items with #[opaque]
to prevent them reducing during quoting or something?
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 dunno - isn’t this reflecting the elaboration input more accurately though? i.e.
let test : Array8 (u8_add 1 2) {} -> Array8 3 {} = fun x => x; |
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.
If I write something like
let x : id Bool = false;
x
I would expect the type of x
to be displayed as Bool
, not id Bool
,
and similarly for
def x : id Bool = false;
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.
Yeah, agreed. I think id Bool
would still be displayed as Bool
in type errors, as we generally evaluate types before displaying them to the user. This is just the result of fathom elab
, which I would expect to be closer to what was originally provided by the user (unless inserted by the elaborator).
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.
Hmm, I need to think about it more. I do like how it makes the output in the other cases more readable!
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.
Another thing I’d like to look into at some stage is glued evaluation which is related to this stuff IIUC?
This reduces some bloat in the elaboration output
a9605e8
to
73d3f5a
Compare
This reduces some bloat in the elaboration output