Idiomatic Elixir does this with pattern matching on function parameters so you end up with things like the following, raw if statements are discouraged because of this:
def classify(:ok)
def classify({:error, reason})
def classify([first | rest])
def classify(%{name: name, age: age}) when age >= 18
def classify(%{name: name, age: age}) when age < 18