Wingman: Tactical support for deep recursion #1944
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.
This PR is a bit of a hodge-podge, sorry! It primarily removes the
try
and*
tactic operators, replacing them with better functionality.try
has become a regular tactic, while*
deserves to rot away. Instead, there is nownested
which nests a function call into itself as many times as necessary to typecheck. This is the original motivation for*
, but it never actually succeeded at that.In order to get
nested
working, I needed to be able to work with unsaturated function applications (Wingman tries really hard to saturate everything, and then eta reduce everything before presenting it.) The application tactics now take a newSaturation
parameter, letting you tweak how many unsaturated arguments they take, and there's a correspondingwith_arg
tactic to shift into an unsaturated context.Finally, while playing with this stuff, I learned that
freshTyvars
didn't do what it said on the tin; it claims to instantiateforall
tys, but instead it would just alpha rename them. So that's fixed now too!The result of all this is that the metaprogramming language is now powerful enough to express "generically write
fmap
":