(Update - thanks to Chris for looking at this and not saying I'm crazy. :))
"Metaprogramming Elixir" (Chris McCord) talks about how
String.Unicode reads a text file of unicode characters at compile time and defines a separate function head for each character we might want to upcase. It says this leans on the Erlang VM's pattern matching prowess and implies (I think) that it's more performant than it would be to create a lower -> upper map at compile time and consult it at runtime.
Similarly, McCord in advocates this approach for some example code that looks up I18n keys.
By generating function heads for each translation mapping, we again let the Virtual Machine take over for fast lookup.
Although defining multiple function heads is idiomatic Elixir, this seemed odd to me. I've heard that the Erlang VM is really fast at pattern matching and hence at finding the right function f