Use $app/no-return in cptypes [WIP] #1016
Draft
+35
−7
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.
There are a few things that I don't understand, so this is more a long question with a proof of concept than a finished PR.
When
cptypesdetects an error that is not obvious, use$app/no-returnso the other passes can notice it. Butcp0transform$app/no-returnto special flags inpreinfo, so let's add the flags directly instead.After this change, in the second leap
cp0can notice thatcptypesdetected an error and apply more reductions. See the example at the bottom of cptypes.ms Also, there is an old example incp0.msthat has type problems on purpose, and is broken with an explicit use of$app/no-return.I'm worry that this is wrong for some primitives that write/read the continuation attachment. Is there an obvious example? Is there a not obvious example?
Is it wrong with
lambdasinstead of primitives? I'm almost sure it is, but I'd like to see an example to be sure what to care about . (Anyway, probablylambdaswill be left for a PR in the future.)If this make sense and is (almost) correct, I'd like to take a look if the same change can be applied in more parts of
cptypes, and do some refactor and cleanup.