|
|
|
|
|
by jonathanyc
693 days ago
|
|
I’m not even a big OCaml fan (you can use Algolia on my comment history…), but this article is just factually wrong. > For example, let's say you're iterating over some structure and collecting your results in a sequence. The most efficient data structure to use here would be a mutable dynamic array and in an imperative language that's what pretty much everyone would use. > But if you asked an OCaml programmer, they would almost certainly use a linked list instead. What? One of OCaml’s most notable features as a functional programming language is how it was designed to support mutation (see “the value restriction”, e.g. https://stackoverflow.com/questions/22507448/the-value-restr...) In my own OCaml programs I used mutation whenever appropriate (my only complaint would be that I wish there were a little more syntactic sugar around e.g. hash table access). I wanted to like this post but it seems like low-effort clickbait. |
|