3 ms·
With the caveat that I haven't tried it myself: > What about pattern matching? This is where the word “sealed” above comes in handy; we can do an exhaustive pa
by kcorbitt 11y ago
With the caveat that I haven't tried it myself:
> What about pattern matching? This is where the word “sealed” above comes in handy; we can do an exhaustive pattern match without an else/otherwise branch
from https://medium.com/@octskyward/kotlin-fp-3bf63a17d64a#.8dbwaz4yi https://medium.com/@octskyward/kotlin-fp-3bf63a17d64a#.8dbwa...
- commentzorro 11y agoThis looks to be single value matching only and no compile time exhaustion checks. This looks like really nice (i.e. sugary) alternative to switch but not quite pattern matching.