-
Notifications
You must be signed in to change notification settings - Fork 1
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 let type
to the language
#337
Comments
let type
part of the languagelet type
to the language
One implementation issue I am worried about is what to show as "the type of the currently selected node". If this is somewhere under a In particular, there are three scenarios I have in mind (and possibly more if I thought for longer)
One possibility may be to take advantage of the interactivity and display (say) the expanded type, but highlight portions that are equal to some locally-bound type and then if the student clicks on such a highlight we could switch to displaying the alias. Note however that aliases can overlap/clash (at least in a nested fashion: See also #5 (comment) and the #5 (comment) I'm sure there is prior work on this topic, but I am not familiar with it. |
I'd certainly ideally like us to explore something like this, where the student can view both the alias and the expansion. I guess it's quite a hard problem though. Witness GHC's unpredictable behaviour around whether type synonyms show up in error messages. |
Currently, we use
let type
in evaluation, but we don't make this binding available to the student. So far as we can tell, there seems to be no good pedagogical reason not to do this. There are some implementation issues to consider, however (e.g., good informational/error messages when a student-definedlet type
binding doesn't match the expected type of a hole), so we'll punt on this until post-Primer 1.0. Until then, this issue serves as a tracker.The text was updated successfully, but these errors were encountered: