Hacker News new | ask | show | jobs
by Zababa 1709 days ago
> Strictly speaking, in an immutable world, your iterator only gives you access to the head of your collection.

That's true, but I was talking about iterators in general. My point was that functors, applicative and monads may seem weird and special, but we use the same thing in everyday life. Same thing about the signatures: iterator is that, just a signature, but nobody complains about it.

Your explanation about functional iterators is great, I think it shows really well how iterators are about treating any data structure as if it was the simplest data structure. In a imperative language, it's the array, in a functional language, it's the list.