-
Notifications
You must be signed in to change notification settings - Fork 8
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
default in @cases
when unpacking is not necessary
#55
Comments
Is it enough to just write something like @sum_type Fruit begin
apple
banana
orange
kiwi
pear
mango
end
is_apple(f::Fruit) = @cases f begin
apple => true
[banana, orange, kiwi, pear, mango] => false
end ? |
The list of possible variants is much too long for the situation I am dealing with. Admittedly, maybe that is code smell and I should use a different approach. Independently of that though, is that a feature that makes sense to be added? |
Should now work with #56! Will be released as version 0.5.1 and available on the General registry once this finishes: JuliaRegistries/General#95659 |
Wow, that was amazingly quick! Thank you, it is much appreciated! |
Happy to help! |
I have a situation in which a sumtype instance will be passing through "filters", where they are either "consumed" if they are a specific particular variant or passed on to the next "filter".
Is an additional "default" option possible, as discussed in #31 ?
Opening a new issue, because I have the impression the conversation in 31 was focused on default with unpacking
The text was updated successfully, but these errors were encountered: