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

Calculator field default can accept numbers #2342

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

OAGr
Copy link
Contributor

@OAGr OAGr commented Oct 18, 2023

Make sure that Calculator default fields can accept numbers.

It just uses the Javascript toString() method for converting numbers. This probably isn't optimal for Squiggle, but it works okay enough.

I think we can improve this more later if we want.

image

Basically closes #2340

@OAGr OAGr requested a review from berekuk as a code owner October 18, 2023 18:58
@changeset-bot
Copy link

changeset-bot bot commented Oct 18, 2023

⚠️ No Changeset found

Latest commit: 674d3f5

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

@vercel
Copy link

vercel bot commented Oct 18, 2023

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

Name Status Preview Comments Updated (UTC)
quri-hub ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 18, 2023 7:01pm
quri-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 18, 2023 7:01pm
squiggle-components ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 18, 2023 7:01pm
squiggle-website ✅ Ready (Inspect) Visit Preview Oct 18, 2023 7:01pm

Copy link
Collaborator

@berekuk berekuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I'm slightly worried that union types (A|B) are out of scope of a classic Hindley-Milner types, so assuming our type system grows out of frTypes, we'll need something more powerful than HM, but we'd probably need them for other purposes too, so it's unavoidable.

@OAGr OAGr merged commit 0c3efb1 into main Oct 18, 2023
4 checks passed
@OAGr OAGr deleted the calculator-default-can-be-number branch October 18, 2023 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Float to Squiggle String Function, for Calculator
2 participants