Skip to content

Add Result type#2721

Open
plajjan wants to merge 2 commits intomainfrom
result
Open

Add Result type#2721
plajjan wants to merge 2 commits intomainfrom
result

Conversation

@plajjan
Copy link
Copy Markdown
Contributor

@plajjan plajjan commented Apr 10, 2026

No description provided.

Kristian Larsson added 2 commits April 10, 2026 16:52
Add a result module with Result[T,E] and the Ok and Err variants. The interface
provides variant checks, optional accessors, and unwrap helpers while keeping
the API in ordinary stdlib code.

Keeping Result in base/src/result.act instead of __builtin__.act because of
build issues. This is suboptimal but it'll have to do for now. I guess it also
means it is simpler to iterate on it. Users are expected to 'from result import
*' and then use.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 20075af383

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

$(MAKE) -C test

test-stdlib: dist/bin/acton
test-stdlib: distribution
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep test-stdlib from requiring full distribution build

Changing test-stdlib to depend on distribution makes this target pull in the full release graph (distribution1), including backend artifacts and $(DEPS) (via DIST_BACKEND_FILES/dist/bin/actondb), before running stdlib tests. That is a behavioral regression for developers/CI jobs that only expect stdlib tests and can now fail in offline/minimal environments or become much slower; a narrower prerequisite such as dist/base (plus dist/bin/acton) would preserve the test target’s scope.

Useful? React with 👍 / 👎.

@plajjan
Copy link
Copy Markdown
Contributor Author

plajjan commented Apr 10, 2026

@nordlander does this align with what you had in mind?

I got various build errors when I tried to place this in __builtin__.act so I did a separate module right now - that should be fixed obviously, but we can do that separately.

@nordlander
Copy link
Copy Markdown
Contributor

Looks good, but I'd much rather have abstract signatures instead of NotImplemented methods in the base class. That way no-one can be tempted to inherit them.

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.

2 participants