@Drup and myself have the pleasure to announce the first release of Iter (née
Sequence). Its version is 1.2, following Sequence 1.1. We renamed
Iter to remove some confusion with
Seq (the stdlib’s iterator type).
Iter provides combinators to create, consume, and transform iterators of type
('a -> unit) -> unit; in other words, partially applied
iter function such as
Array.iter, etc. It has a wealth of advanced combinators and performs very well even with nested
map, etc. A very simple example that manipulates a series of integers:
# #require "iter";; # let p x = x mod 5 = 0 in Iter.(1 -- 5_000 |> filter p |> map (fun x -> x * x) |> fold (+) 0);; - : int = 8345837500
Here is a comparison with the standard Seq, explaining their differences and the use case for both.