We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We want to provide ways to safely cast between types similar to expect, but without crashing the entire program on failure.
expect
This could be introduced via a new syntax, to not overload expect from its current semantic. Something along the lines of:
if unknown is Foo { ... } else if unknown is Bar { ... } else { ... }
where Foo and Bar are type annotations. Within each branch, the type of unknown would be respectively Foo, Bar and Data.
Foo
Bar
unknown
Data
This is particularly useful for casting from an unknown type (i.e. Data) from within an iterator (e.g. foldr).
foldr
Alternative right now requires a lot of boilerplate and the explicit use of builtin functions such as choose_data.
choose_data
The text was updated successfully, but these errors were encountered:
if/is
rvcas
MicroProofs
Successfully merging a pull request may close this issue.
What is your idea? Provide a use case.
We want to provide ways to safely cast between types similar to
expect
, but without crashing the entire program on failure.This could be introduced via a new syntax, to not overload
expect
from its current semantic. Something along the lines of:where
Foo
andBar
are type annotations. Within each branch, the type ofunknown
would be respectivelyFoo
,Bar
andData
.Why is it a good idea?
This is particularly useful for casting from an unknown type (i.e.
Data
) from within an iterator (e.g.foldr
).What is the current alternative and why is it not good enough?
Alternative right now requires a lot of boilerplate and the explicit use of builtin functions such as
choose_data
.The text was updated successfully, but these errors were encountered: