env: remove refinement types from default environment #464
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.
Commit message:
The difference is staggering in some cases.
Increasing the length of
xs
from 8 to 9 onmaster
results in the heap consuming all available memory on my computer. Ondavidchambers/env
increasing the length ofxs
from 8 to 1000 only adds about 200 milliseconds to the run time.Removing refinement types from the default environment will result in less informative error messages in some cases (but much clearer error messages in certain other cases). @Avaq has proposed that sanctuary-def should explicitly support refinement types (sanctuary-js/sanctuary-def#162). Were it to do so, refinement types could be ignored when resolving type variables, but could be considered when enumerating a value's types in an error message. The best of both worlds!
Many thanks to @mfidemraizer for providing a minimal test case which made it easy to diagnose this long-standing issue. 👏