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

documenting check/synth of forms #3

Open
pnwamk opened this issue Jan 10, 2018 · 6 comments
Open

documenting check/synth of forms #3

pnwamk opened this issue Jan 10, 2018 · 6 comments

Comments

@pnwamk
Copy link

pnwamk commented Jan 10, 2018

In a previous discussion with @david-christiansen and @dfried00 there was a desire to have the documentation indicate which positions are visited in check-mode and which are visited in synthesis-mode by the type checker.

Would superscript "c" (for check) and "s" (for synthesis) on identifier names (with a comment at the top of the docs indicating their meaning) be a reasonable solution? e.g.:

image

@david-christiansen
Copy link
Member

That could work.

What about, alternatively, replacing the :s below the description with for check or for synth? This matches notations used elsewhere, at least, but that might require more Scribble hacking.

@david-christiansen
Copy link
Member

Also, how would you propose documenting check/synth for the resulting type? A superscript on the whole eliminator expression, or alternately the type after the arrow up top?

@pnwamk
Copy link
Author

pnwamk commented Jan 10, 2018

So, part of the reason I liked the initial solution I suggested is because I'm lazy and it was easy.

However, I really like your suggestion of (hopefully a little) hacking and making a scribble-like form that uses the double arrows, e.g.:

(iter-Nat target base step) ⇒ X
  target ⇐ Nat
  base ⇒ X
  step ⇐ (→ Nat X)

I wonder how difficult it would be...

@david-christiansen
Copy link
Member

I imagine that something starting with a copy-paste of defform wouldn't be too hard, but that code is pretty abstracted and engineered...

@xieyuheng
Copy link
Contributor

Why use the word synth or synthesis instead of infer ?

Does this choice have a reason ? If it does, I wish to learn :)

@david-christiansen
Copy link
Member

I've seen both in the literature.

The reason I've come to prefer the term "synthesis" over "inference" in bidirectional type checking is to distinguish it from the more global type inference in Hindley-Milner-style systems. It seems to confuse somewhat fewer people, which makes me prefer it.

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

3 participants