> Just remember to always add the required catch-all cases, lest you write a partial function.
When just unpacking lists, or other types whose structure absolutely will not change, this is fine.
When pattern matching on alternatives that might be added to, I find if I'm inspecting the values of existing cases I will probably want to also give consideration to how to handle future cases, so I avoid a catch-all (and make sure my tooling calls out inexhaustive matches) so these spots are surfaced when the type changes.
1 comment
[ 2.7 ms ] story [ 28.7 ms ] threadWhen just unpacking lists, or other types whose structure absolutely will not change, this is fine.
When pattern matching on alternatives that might be added to, I find if I'm inspecting the values of existing cases I will probably want to also give consideration to how to handle future cases, so I avoid a catch-all (and make sure my tooling calls out inexhaustive matches) so these spots are surfaced when the type changes.