4 ms·
This severely underestimates the weirdness of the visitor pattern. It's far more complicated than monads.
by chowells 2y ago
This severely underestimates the weirdness of the visitor pattern. It's far more complicated than monads.
- Smaug123 2y agoI claim the visitor pattern isn't that weird. The `visit` function is the natural way to move from continuation-passing style to direct style, being of type signature `forall 'ret . (MyObject -> 'ret) -> 'ret`.
- mmaniac 2y agoExplanations of monads are vastly more complicated than monads. Any Javascript programmer will recognise what .flatMap() is and does - you don't even need to know design patterns for that.
- Smaug123 2y ago> So the wise soul does without doing, teaches without talking. Ursula Le Guin translating the Tao Te Ching, verse 2.