What's the use of the pattern?
Assume I have a function that seems partial. It wants its arguments to fulfil some requirements that seem difficult to check compile time. Also, unless I screwed up on other parts of my code, the function should never be called with non-conformant arguments because it does not make sense to call it with such arguments.
If I write a partial function and I have a bug then my program crashes. This is bad so instead...
If I follow the advice and return a
Maybe - I'll have to finally pattern-match this
Maybe sooner or later! If finally
main :: IO() receives a
Maybe when it wants to print out some sensible data, what is
main going to do?
Print out an error that says that the programmer is an idiot?
Ugh... we're precisely at what would happen if I kept the function partial. Except that I don't get an information where I screwed up that easily.
What am I missing here?