Skip to content

Sequence.(--^) inconsistent with CCList.(--^) #12

@copy

Description

@copy

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).

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions