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

Use Union{Some{T}, Nothing} #93

Open
adkabo opened this issue Jan 6, 2022 · 1 comment
Open

Use Union{Some{T}, Nothing} #93

adkabo opened this issue Jan 6, 2022 · 1 comment

Comments

@adkabo
Copy link

adkabo commented Jan 6, 2022

Currently rewriters don't distinguish between failing to match and successfully returning a value of nothing.

I want to use this pattern:

y = r1(expr)::Union{Nothing, Some{Expr})
return isnothing(y) ? y : nothing : r2(something(y))

Rewriters could be Some-aware and unwrap these values internally with something(x).

References

@0x0f0f0f
Copy link
Member

cc @shashi

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

No branches or pull requests

2 participants