> Doesn't seem very erlangy. I'd expect a runtime error, as someone's passed foo() the wrong value.
It depends.
Sometimes you want to crash when handed an unexpected value.
Sometimes you expect that you'll be handed unexpected values and need to either fail more gracefully, print a warning and then fail, or warn and keep going, or whatever.
Erlang gives you a bunch of tools, and they all have their place. [0] :)
[0] With the possible exception of the if statement... which is of questionable utility.