Skip to content

Navigation Menu

Sign in
Sign up

Get rid of empty_list constant - #495

Open
giacomocavalieri wants to merge 2 commits into
lustre-labs:main from
giacomocavalieri:remove-empty-list
Open

Get rid of empty_list constant #495
giacomocavalieri wants to merge 2 commits into
lustre-labs:main from
giacomocavalieri:remove-empty-list

Conversation

@giacomocavalieri

@giacomocavalieri giacomocavalieri commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

In Gleam 1.18 the compiler started generating a singleton value for the empty list, so this optimisation won't be needed anymore

otp-version: "27.0"
rebar3-version: "3"
gleam-version: "1.17.0"
gleam-version: "1.18.0"

@hayleigh-dot-dev hayleigh-dot-dev Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

bumping this causes ci to fail as the formatter has changed, please format the entire codebase so the tests can run.

List$NonEmpty,
List$NonEmpty$rest,
List$NonEmpty$first,
List$Empty,

@hayleigh-dot-dev hayleigh-dot-dev Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why are we importing this and not List$Empty$const, it's the reason for the entire PR!

@giacomocavalieri giacomocavalieri Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's an internal detail that shouldn't be depended on I think

import {
Result$isOk,
Result$Ok0,ドル
List$Empty,

@hayleigh-dot-dev hayleigh-dot-dev Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

And here

@@ -1,10 +1,9 @@
import { List$NonEmpty } from "../../gleam.mjs";
import { List$NonEmpty, List$Empty } from "../../gleam.mjs";

@hayleigh-dot-dev hayleigh-dot-dev Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

And here (:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@hayleigh-dot-dev hayleigh-dot-dev hayleigh-dot-dev requested changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /