Using Iterators as Generic Type Parameters - Abstract types - Haxe programming language cookbook
Iterators are a helpful Haxe structure. Any structure that implements the next and hasNext functions with the appropriate signature will allow you build a for loop. Arrays have an iterator() function that returns exactly this, and you don't need to call it, the for language construction does it for you.
So cool!! The more I know HAxe the more I love it.
Functional with ADT as Ocaml, F# and Haskell.
Powerful macros without that many brackets :wink: .
Extension methods.
And I could keep going.
Using Iterators as Generic Type Parameters - Abstract types - Haxe programming language cookbook
Iterators are a helpful Haxe structure. Any structure that implements the next and hasNext functions with the appropriate signature will allow you build a for loop. Arrays have an iterator() function that returns exactly this, and you don't need to call it, the for language construction does it for you.
https://code.haxe.org/category/abstract-types/using-iterators-as-generic-type-parameters.html