Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wingman: Tactical support for deep recursion #1944

Merged
merged 10 commits into from
Jun 19, 2021

Conversation

isovector
Copy link
Collaborator

@isovector isovector commented Jun 18, 2021

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 now nested 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 new Saturation parameter, letting you tweak how many unsaturated arguments they take, and there's a corresponding with_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 instantiate forall 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":

  intros f x
, homo x
; assumption      -- every term is either an assumption, or
| ( with_arg
  , assumption    -- some assumption that has been applied to
  , nested fmap   -- 0 or more nested fmaps
  , assume f      -- before calling f
  )

@isovector isovector requested review from Ailrun and jneira June 19, 2021 02:54
@isovector isovector added the merge me Label to trigger pull request merge label Jun 19, 2021
@mergify mergify bot merged commit 5c47360 into haskell:master Jun 19, 2021
@isovector isovector deleted the better-many-tactics branch July 19, 2021 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Label to trigger pull request merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants