News for hackers. Stuff that matters.
Re:Ask HN: Who regrets choosing Elixir? by neilwilson on Saturday May 23, 2020 @12:26PM (#23284231)
"Feeding an unexpected type into a function, and having it carry on as normal, is really scary."

That is how duck typing works. Generally you shouldn't use "is instance" but more use a set of "callable" checks to make sure the structure has the required functions.

Things like Go Interface types are, of course, a formalisation of duck typing and is what has helped static typing come back into fashion.

There are no comments on this comment yet.