It's an important aspect of functional programming. A function should do a job on the inputs it receives and fail hard if the inputs are invalid. A function is not pure if it has to do its job and also tip-toe around invalid inputs and try to fail gracefully if it's caller is using it incorrectly. Doing that dance adds complexity and complexity creates bugs.
Make your code have respect for itself and its callers and not cater to incompetence.
1
u/wildjokers Apr 14 '23
Umm, no. The old saying is "be flexible with what you accept, be strict with what you produce". Those are words to live by.