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

Move basic function type inference to squiggle-lang #2767

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

OAGr
Copy link
Contributor

@OAGr OAGr commented Dec 19, 2023

We used to do basic user function type inference in the Components. This tries to move most of that work to squiggle-lang. The downside is that this does add substantial complexity to squiggle-lang. The upside is that this seems like stuff we likely want there anyway, and after this, the functionality works a bit better (it's better thought through).

I think this general direction is good, but am sure this implementation can be improved a lot.

Some thoughts:

  • The frType work here would help in this PR.
  • This is clearly fairly messy.
  • This is reusing frTypes for some things frTypes isn't fully meant for. If we go in this direction, I imagine we should add the type frUnknown, and likely frWithDomain. After we do this, we might be able to remove Domain from SqLambdaParameter - exporting the types instead. We'd also want some more helpers like getDomain(FrType<any>), if the domain is nested.
  • A different direction is to make a different type that's almost exactly like frTypes, but without the packing / unpacking. I think it would likely still need the other attributes.

This closes #2761, among other things.

Copy link

changeset-bot bot commented Dec 19, 2023

⚠️ No Changeset found

Latest commit: 0c0d119

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Dec 19, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
quri-hub ✅ Ready (Inspect) Visit Preview Dec 19, 2023 4:46am
squiggle-components ✅ Ready (Inspect) Visit Preview Dec 19, 2023 4:46am
squiggle-website ✅ Ready (Inspect) Visit Preview Dec 19, 2023 4:46am
1 Ignored Deployment
Name Status Preview Updated (UTC)
quri-ui ⬜️ Ignored (Inspect) Visit Preview Dec 19, 2023 4:46am

Copy link
Contributor

sweep-ai bot commented Dec 19, 2023

Apply Sweep Rules to your PR?

  • Apply: All docstrings and comments should be up to date.
  • Apply: Ensure that all variables and functions have descriptive names.
  • Apply: Avoid using magic numbers or hard-coded values in the code.

Copy link

codecov bot commented Dec 19, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e681c2e) 71.56% compared to head (0c0d119) 71.75%.
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2767      +/-   ##
==========================================
+ Coverage   71.56%   71.75%   +0.18%     
==========================================
  Files         118      118              
  Lines        6465     6574     +109     
  Branches     1318     1360      +42     
==========================================
+ Hits         4627     4717      +90     
- Misses       1830     1849      +19     
  Partials        8        8              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@OAGr OAGr changed the title Toggle fixes Move basic function inference to squiggle-lang Dec 19, 2023
@OAGr OAGr changed the title Move basic function inference to squiggle-lang Move basic function type inference to squiggle-lang Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 To prioritize
Development

Successfully merging this pull request may close these issues.

Hide functions that aren't displayed
1 participant