3 ms·
In addition to tmhedberg's good reply, I'd observe that you are either A: excessively stuck on this particular Python implementation when people are trying to a
by jerf 14y ago
In addition to tmhedberg's good reply, I'd observe that you are either A: excessively stuck on this particular Python implementation when people are trying to argue that monadic patterns are useful in general (and in fact this Python implementation isn't even correct), or B: tautologically arguing from a base of monadic patterns being difficult to conclude that monadic patterns are difficult.
They aren't. Really. They just historically had one of the single most disastrous PR departments in the history of programming concepts. (Which has gotten better, but the old PR is still floating around the nets, screwing up everyone it meets.) It's just an interface slightly more complicated than the standard Iterable interface that happens to have a lot of useful things that can conform to it, and then a lot of useful things that can be built on it (two statements equally true of Iterable itself). It's a great deal simpler to use them when appropriate than the horrifying complexity of trying to manually implement them over and over that you've just grown so used to you can't see any more.
I do my part by trying to ensure I use the term as an adjective instead of a noun, because "monad" is like "iterable" as a term. It is unfortunate that it inherited its status as a noun from the world of math, where that happens to make sense. It does not in programming.