Skip to content

Comments

feat: saturated constructors#798

Merged
brprice merged 1 commit intomainfrom
brprice/saturated-constructors
May 17, 2023
Merged

feat: saturated constructors#798
brprice merged 1 commit intomainfrom
brprice/saturated-constructors

Conversation

@brprice
Copy link
Contributor

@brprice brprice commented Feb 28, 2023

This mostly involves simply bumping the primer pin to a version which
has saturated constructors. However there are some small changes for
compatibility: we remove references to no-longer existing 'MakeCon'
action and 'PatternApp' flavor, which used to be exposed in primer's
OpenAPI, but no longer exist.

@github-actions github-actions bot temporarily deployed to Preview: (brprice/saturated-constructors) February 28, 2023 16:01 Inactive
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 28, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 288fcfc
Status: ✅  Deploy successful!
Preview URL: https://4c5489b8.primer-app.pages.dev
Branch Preview URL: https://brprice-saturated-constructo.primer-app.pages.dev

View logs

@brprice brprice force-pushed the brprice/saturated-constructors branch 2 times, most recently from 0d082d1 to dc4464e Compare March 13, 2023 16:52
@brprice brprice force-pushed the brprice/saturated-constructors branch 2 times, most recently from ff63e5d to 93a1824 Compare March 29, 2023 18:15
@brprice brprice added the Deploy service Deploy the backend service for this PR label Mar 30, 2023
@brprice brprice force-pushed the brprice/saturated-constructors branch from 93a1824 to c76a1de Compare March 30, 2023 13:14
@brprice brprice removed the Deploy service Deploy the backend service for this PR label Mar 30, 2023
@brprice brprice added Deploy service Deploy the backend service for this PR and removed Deploy service Deploy the backend service for this PR labels Mar 30, 2023
@brprice brprice force-pushed the brprice/saturated-constructors branch from d504a35 to a2db976 Compare April 27, 2023 14:12
@brprice brprice added Deploy service Deploy the backend service for this PR and removed Deploy service Deploy the backend service for this PR labels Apr 27, 2023
@brprice brprice force-pushed the brprice/saturated-constructors branch from a2db976 to 66974ca Compare May 10, 2023 17:44
Comment on lines 461 to 476
fst: "Pattern",
snd: {
body: {
tag: "NoBody",
contents: "PatternApp",
},
childTrees: [
{
body: {
contents: {
fst: "PatternCon",
snd: {
baseName: "Succ",
qualifiedModule: ["Builtins"],
},
},
tag: "TextBody",
contents: {
fst: "PatternCon",
snd: {
baseName: "Succ",
qualifiedModule: ["Builtins"],
},
childTrees: [],
nodeId: "15P1B",
},
tag: "TextBody",
},
childTrees: [
{
body: {
contents: {
Copy link
Contributor Author

@brprice brprice May 10, 2023

Choose a reason for hiding this comment

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

@georgefst here and elsewhere I have manually hacked the example trees to remove mentions of PatternApp, but I have not carefully checked if they are sane. Is there a nice way to regenerate these?

(In fact, I think I've messed something up, as odd-even still shows a $ node in a pattern)

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a nice way to regenerate these?

There is not, unfortunately. In fact I think at least one of them is not a legitimate tree that the backend would ever create. We only really care that we can render something, though it is of course nice if the trees mostly look like real programs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(In fact, I think I've messed something up, as odd-even still shows a $ node in a pattern)

FTR, even still has a $ node in a pattern as it contains the code

contents: {
  fst: "Pattern",
  snd: {
    body: { tag: "NoBody", contents: "App" },
    childTrees: [...

This is (in @georgefst's sense) not a legitimate tree, but that is fine. I think I'll leave it as-is.

@brprice brprice force-pushed the brprice/saturated-constructors branch from 66974ca to 3b7f86e Compare May 11, 2023 09:32
@brprice brprice changed the title DNM: saturated constructors feat: saturated constructors May 11, 2023
@brprice brprice marked this pull request as ready for review May 11, 2023 09:32
@brprice brprice requested a review from a team May 11, 2023 09:33
Copy link
Member

@dhess dhess left a comment

Choose a reason for hiding this comment

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

Wow, this was much simpler than I anticipated. That's great, as I think it's a good sign we've achieved our goal of creating a frontend that's (intentionally) unaware of Primer-the-language's inner workings.

@brprice brprice removed the Deploy service Deploy the backend service for this PR label May 11, 2023
@brprice brprice added the Deploy service Deploy the backend service for this PR label May 11, 2023
Comment on lines 461 to 476
fst: "Pattern",
snd: {
body: {
tag: "NoBody",
contents: "PatternApp",
},
childTrees: [
{
body: {
contents: {
fst: "PatternCon",
snd: {
baseName: "Succ",
qualifiedModule: ["Builtins"],
},
},
tag: "TextBody",
contents: {
fst: "PatternCon",
snd: {
baseName: "Succ",
qualifiedModule: ["Builtins"],
},
childTrees: [],
nodeId: "15P1B",
},
tag: "TextBody",
},
childTrees: [
{
body: {
contents: {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a nice way to regenerate these?

There is not, unfortunately. In fact I think at least one of them is not a legitimate tree that the backend would ever create. We only really care that we can render something, though it is of course nice if the trees mostly look like real programs.

case "DeleteType":
return "Delete this type";
case "MakeCon":
return "Use a value constructor";
Copy link
Contributor

Choose a reason for hiding this comment

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

While we will revisit these wordings at some point, I would prefer that we kept this one, since we no longer really "apply" constructors as such.

It actually seems odd (and apologies, I should have caught this while reviewing the backend change), that our remaining action is called MakeConSat. Since there's only one way to insert constructors now, this should really just be MakeCon.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree. I have opened hackworthltd/primer#994 for the backend change, and changed this wording back.

I have also tweaked the short actionName from V $ ? to V ? ?.

@dhess
Copy link
Member

dhess commented May 15, 2023

What's holding this PR up? I'd like to get it merged and deployed ASAP.

@brprice
Copy link
Contributor Author

brprice commented May 16, 2023

This will need to be bumped again when hackworthltd/primer#994 merges. EDIT: done

This mostly involves simply bumping the primer pin to a version which
has saturated constructors. However there are some small changes for
compatibility: we remove references to no-longer existing 'MakeCon'
action and 'PatternApp' flavor, which used to be exposed in primer's
OpenAPI, but no longer exist.

Signed-off-by: Ben Price <ben@hackworthltd.com>
@brprice brprice force-pushed the brprice/saturated-constructors branch from e4f8e2e to 3cfd939 Compare May 16, 2023 16:12
@brprice brprice added Deploy service Deploy the backend service for this PR and removed Deploy service Deploy the backend service for this PR labels May 16, 2023
@brprice brprice requested a review from georgefst May 16, 2023 16:12
@georgefst georgefst added Deploy service Deploy the backend service for this PR and removed Deploy service Deploy the backend service for this PR labels May 16, 2023
@georgefst
Copy link
Contributor

Is anyone able to use the deployment for this branch? I'm unable to create sessions, and seeing CORS errors in the console, which in the past has always indicated that I've forgotten to set the "Deploy service" label.

@brprice
Copy link
Contributor Author

brprice commented May 17, 2023

Is anyone able to use the deployment for this branch? I'm unable to create sessions, and seeing CORS errors in the console, which in the past has always indicated that I've forgotten to set the "Deploy service" label.

I see the same, and don't know the reason.

@dhess
Copy link
Member

dhess commented May 17, 2023

It should work now — I deleted and recreated the container.

I'm not sure why you all are having issues with this new PR deployment scheme, as it's always worked for me. I'll need to debug a bit, but for now, we have a workaround, which is me recreating the container as I've done here.

@brprice brprice added this pull request to the merge queue May 17, 2023
Merged via the queue into main with commit 7b14925 May 17, 2023
@brprice brprice deleted the brprice/saturated-constructors branch May 17, 2023 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Deploy service Deploy the backend service for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants