3 ms·
Isn't parsing itself a maybe function?
by yccs27 3y ago
Isn't parsing itself a maybe function?
- mrkeen 3y agoThe author has conflated two concepts into "maybe function". Parsing is "maybe" in the sense that the parser will either return your object or fail. But it doesn't have to do any hidden, surprising behaviour like the "if (!loggedIn) {" line in the article.
- zenolove 3y agoA better name might be “sometimes function”
- quaunaut 3y agoNo. Maybe functions aren't the result of simply returning different results. It's doing or not doing something, abstracted into a function. Parsing is determining whether you should do it or not- it's about setting up a boundary from which you never attempt something that would be a maybe.