Infer the variants from the alternative pattern match #4996
Closed
0riginaln0
started this conversation in
Ideas & suggestions
Replies: 1 comment
-
Gleam doesn't have subtyping, so there isn't a For this code I recommend rewriting it to be one case expression. This will be faster, less code, and will remove the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
While solving a problem from Exercism, I came up with the following code
Despite the fact that
next_symbol
is a string, it should be possible to infer its variants from the alternative pattern of the outer case"]" | "}" | ")" ->
so we won't need to write_ -> panic as "Never happen"
in the inner case.Beta Was this translation helpful? Give feedback.
All reactions