Skip to content

fix: letrec metadata#1029

Merged
brprice merged 2 commits intomainfrom
brprice/letrec-typing
May 22, 2023
Merged

fix: letrec metadata#1029
brprice merged 2 commits intomainfrom
brprice/letrec-typing

Conversation

@brprice
Copy link
Copy Markdown
Contributor

@brprice brprice commented May 22, 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 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
Copy link
Copy Markdown
Contributor Author

brprice commented May 22, 2023

This is a clone of #979, which was accidentally closed.

@brprice brprice mentioned this pull request May 22, 2023
@brprice brprice changed the base branch from main to brprice/api-generate May 22, 2023 17:05
@brprice brprice changed the base branch from brprice/api-generate to main May 22, 2023 17:05
@brprice brprice added this pull request to the merge queue May 22, 2023
Merged via the queue into main with commit 5459621 May 22, 2023
@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.

1 participant