4 ms·
What would be the correct way to pattern match here? def foo(<I want to pattern match the value returned by GreatModule.constant_substitute()>), do: "bar"
by conradfr 4y ago
What would be the correct way to pattern match here?
def foo(<I want to pattern match the value returned by GreatModule.constant_substitute()>), do: "bar"
def foo(value), do: value
- marcofiset 4y agoUse a `case` in the body of the function. Why do you absolutely need to pattern match in the function header?