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

add Result type #50

Merged
merged 2 commits into from
Nov 24, 2023
Merged

add Result type #50

merged 2 commits into from
Nov 24, 2023

Conversation

jan-ferdinand
Copy link
Member

  • add Result type
  • add Ok function
  • add Err function
  • support ? operator

fix #49

@Sword-Smith
Copy link
Contributor

I realized that if we represent a Result as a DataType::Enum internally, then get match support and correct stack-management for free. We even get the constructor logic Result::Ok(a) and Result::Error(b) for free as well!

This can be handled already in the grafter, resolving Result to the correct DataType::Enum instance.

@Sword-Smith Sword-Smith merged commit 90d9b76 into master Nov 24, 2023
@jan-ferdinand jan-ferdinand deleted the result branch January 15, 2024 09:48
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.

add a Result type
2 participants