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 propagating operator ? #61

Open
marad opened this issue Sep 19, 2022 · 0 comments
Open

Error propagating operator ? #61

marad opened this issue Sep 19, 2022 · 0 comments
Labels
core Requires changes in core compiler code enhancement New feature or request
Milestone

Comments

@marad
Copy link
Owner

marad commented Sep 19, 2022

dla x : Result[int,string] wyrażenie:

val foo = x ? "błąd"

w przypadku gdy x is Just powinno deklarować foo z wartością 5, a w przypadku gdy x is Err powinno zwracać z całej funkcji Err("błąd").

Możliwe jest pominięcie wartości błędu "błąd" i wówczas zwrócony zostanie bład z Err:

val foo = x?

Wymagania:

  • typ rzucanego błędu musi się zgadzać z typem błędu funkcji
  • powinno działać zarówno dla Option jak i Result. Dla Option podanie błędu jest wymagane
@marad marad added this to the 0.0.1-alpha milestone Sep 19, 2022
@marad marad added enhancement New feature or request core Requires changes in core compiler code labels Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Requires changes in core compiler code enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant