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

Error effects for lambdas #329

Open
gavr123456789 opened this issue Dec 24, 2024 · 0 comments
Open

Error effects for lambdas #329

gavr123456789 opened this issue Dec 24, 2024 · 0 comments

Comments

@gavr123456789
Copy link
Owner

now .sas here adds error effect for sus, but its wrong

type Knight

Knight sas -> Unit! = [
  Error throwWithMessage: "qwf"
]

Knight sus -> Unit = [
  x = [
    .sas
  ]
  x do
]

Problem: what if we will call something with error inside map or forEach?
Have 2 different functions with and without errors for each STD lambda is bad!

Maybe just correctly infer all the error effects for lambdas the same way we do for usual variables?
x = .sas // x has type Unit!{Error}

x = [ .sas ] // x has type [ -> Unit!Error ]

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

No branches or pull requests

1 participant