I personally prefer Elixir but I have to say that the more I use Erlang libraries (like for state machines, trees and graphs) the more I grow fond of it and the more I view both languages as what they really are: a brother and a sister. ^_^
Most, if not all, functional languages support pattern matching: Haskell, OCaml, Clojure, Erlang/Elixir, Purescript, Idris, Elm, etc.
The other example:
Here I used a case statement, but it also matches the shape pretty well.That's valid code, not pseudocode, you can compile it in a module an run it.
Notice how multiple function clauses separated by ; allow much nicer code patches. If a function wasn't working well, instead of adding an if statement inside, you can add another function clause instead.