Skip to content

fix: letrec metadata#979

Merged
dhess merged 2 commits intobrprice/let-rename-offerfrom
brprice/letrec-typing
May 22, 2023
Merged

fix: letrec metadata#979
dhess merged 2 commits intobrprice/let-rename-offerfrom
brprice/letrec-typing

Conversation

@brprice
Copy link
Copy Markdown
Contributor

@brprice brprice commented May 11, 2023

Consider (some sort of) a let in a checkable position, whose body is
synthesisable, e.g. (λx. let y = ... in xor x y) : Bool -> Bool. Prior to
this commit, our treatment of metadata between let and letrec was
inconsistent:

  • they both treat the body xor x y the same: checking it against
    Bool, finding it is synthesises Bool and then giving it a TCEmb
    metadata.
  • a let node would then get the same metadata
  • a letrec node would only get TCChkedAt metadata

This is visible to a consumer of our API: what actions we offer differ,
see the added test.

@brprice brprice requested a review from a team May 11, 2023 14:46
brprice added 2 commits May 17, 2023 17:30
In a subsequent commit we will add a test that some actions are *not*
offered, which will use this refactoring.

Signed-off-by: Ben Price <ben@hackworthltd.com>
Consider (some sort of) a `let` in a checkable position, whose body is
synthesisable, e.g. `(λx. let y = ... in xor x y) : Bool -> Bool`. Prior to
this commit, our treatment of metadata between `let` and `letrec` was
inconsistent:
- they both treat the body `xor x y` the same: checking it against
  `Bool`, finding it is synthesises `Bool` and then giving it a `TCEmb`
  metadata.
- a `let` node would then get the same metadata
- a `letrec` node would only get `TCChkedAt` metadata

This is visible to a consumer of our API: what actions we offer differ,
see the added test.

Signed-off-by: Ben Price <ben@hackworthltd.com>
@brprice brprice force-pushed the brprice/letrec-typing branch from 7875e91 to 4009eeb Compare May 17, 2023 16:30
@dhess dhess merged commit 242534d into brprice/let-rename-offer May 22, 2023
@dhess dhess deleted the brprice/letrec-typing branch May 22, 2023 16:27
@dhess dhess restored the brprice/letrec-typing branch May 22, 2023 16:31
@brprice brprice mentioned this pull request May 22, 2023
@brprice
Copy link
Copy Markdown
Contributor Author

brprice commented May 22, 2023

Due to some confusion around target branches and merging, this was accidentally merged into the the wrong branch brprice/let-rename-offer, which closed this PR. That target branch has been reset, and #1029 has been opened to merge the changes in this PR into main.

@brprice brprice deleted the brprice/letrec-typing branch May 22, 2023 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants