Improved ReML pretty printing #197
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Get-regions
ReML allows for explicit region parameters to be dropped. For instance, in the program below,
r1has no put-effects:-Pcee):Here the bar (i.e.,
|) in the parameter list separates "get-only region parameters" (and explicit effect parameters) from region parameters withputeffects.Anti-aliasing
ReML has support for specifying "anti-aliasing":
Here we are specifying that
gcannot be applied to identical regions and it will be checked that this property is guaranteed for all calls.-Pcee -print_constraints) as:-print_control_abbrev_layout, explicit region variables and explicit effect variables are printed without unique ids...Improved case-handling
caseexpressions:Here is the pretty-printed version of
cp(-Pcee):Previously, a
decon_::expression was shown to extractv127fromxsthrough an addtional let-binding.Finally, this PR also pretty-prints many primitive using prettier qualified names (e.g.,
W64.>>andW63.andbinstead of__shift_right_unsigned_word64uband__andb_word63).Note on Constraints
ReML also allows for specifying a constraint saying that there are no put-effects on an effect (i.e.,
noput e) . However, ReML does not allow specifying that there are no put-effects on a region variable:Here the programmer has attempted to specify that there are no direct put-effects on
r1inside the body off. No attempts are made to restrictr2. The purpose of the specification is to guarantee that, at runtime, only the instantiated region forr2will be passed (there will be no need to pass the instantiated region forr1). Whereas such a constraint may be satisfied whenfis declared, it may likely not be satisfied at a particular instantiation site, which would suggest that there would be no put-effects in the region instantiated forr1!Instead, what would be ok for a programmer to suggest is that the type scheme for
fis as follows: