kytrinyx/exercism.io — pull request #465 by etrepum (2013-08-11 21:11:53+00:00)
Title: Don't handle nil where string arguments should go in Elixir

From https://github.com/kytrinyx/exercism.io/commit/4f5c26f204dec40a034a8796eb1ad52c8409861c#commitcomment-3835719 and the discussion here http://exercism.io/submissions/5207d10e162e6154b200003a

This is the wrong thing to do in Elixir or any other language that doesn't have [nullable types](http://en.wikipedia.org/wiki/Nullable_type) by default. I'd strongly recommend that this test be removed, because it forces the participants to write bad code in order to pass the test.

The cases in a language like Elixir or Erlang where nil or some other atom is acceptable in the same place you might expect a string are few and far between. Generally speaking, you'll only see a sum type of nil plus something else in Elixir where you'd see an option type in other functional languages (e.g. Maybe in Haskell or Option in Scala), some examples of that would be search or extractions that might fail (String.at/2, String.first/1, String.last/1, String.slice/3). Note that exported functions that accept nil as a valid argument are *very* rare, it's only really acceptable to *return* nil and the caller is responsible for doing the right thing with it.