iter
iter copied to clipboard
Sequence.(--^) inconsistent with CCList.(--^)
Sequence.(--^) returns a reversed range, while CCList.(--^) returns a range with the right bound excluded.
See:
CCList.(--^) 0 5;;
(* val _1 : int list = [0; 1; 2; 3; 4] *)
Sequence.(--^) 5 0 |> Sequence.to_list;;
(* val _2 : int list = [5; 4; 3; 2; 1; 0] *)
Sequence.(--^) 0 5 |> Sequence.to_list;;
(* val _3 : int list = [] *)
I would suggest deprecating Sequence.(--^), since the CCList behaviour is more useful and the operator looks half-open range (the hat being on the right. I would expect a reversed range to include an arrow of some sorts).
Fair point, but retrocompatibility seems to indicate it won't be possible to have a consistent state any time soon…