Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

that means that the visitor pattern can be replaced with multiple dispatch (true) but neither map nor fmap imply that (and in fact many languages have the latter but not the former)


Clojure has both map and multimethods. It's trivial to map over a collection and dispatch to a different implementation for every element in the collection. With multiple collections, this extends to multiple dispatch over the corresponding elements in each collection.


I will rephrase myself: the original statement is

    you can do V with F
to which the reply was

    no, you can't do V with F
and the subsequent reply was

    but you can do V with M
and I pointed out that F does not imply V. Your current reply is

   Clojure has both F and M and can do V
which is obvious, since M implies V already, but still unrelated to what F can do.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: