Chore: Collect magic constants #543
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.
Hacking on #540 I realized that the {Lin,STM}_{domain,thread,...} modes contain a number of hard-earned magic constants making these modes work reasonably well.
The constants are however
The PR therefore pulls them out as documented top-level definitions.
In
Lin
, it is a bit more messy than inSTM
, as the constants are spread across bothlin.ml
andlin_domain.ml
, ...In
lin_effect.ml
I also decided to remove the uselessUtil.repeat 1
.None of these changes should be user-visible however.