Skip to content
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

Merged
merged 1 commit into from
Jan 17, 2023

Conversation

brendanzab
Copy link
Member

This reduces some bloat in the elaboration output

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;
Copy link
Contributor

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?

Copy link
Member Author

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;

Copy link
Contributor

@Kmeakin Kmeakin Jan 17, 2023

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;

Copy link
Member Author

@brendanzab brendanzab Jan 17, 2023

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).

Copy link
Contributor

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!

Copy link
Member Author

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
@brendanzab brendanzab merged commit c2aa1d7 into yeslogic:main Jan 17, 2023
@brendanzab brendanzab deleted the avoid-quotation branch January 17, 2023 06:26
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants