Hacker News new | ask | show | jobs
by conradfr 1282 days 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
1 comments

Use a `case` in the body of the function. Why do you absolutely need to pattern match in the function header?