Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
copy opened this issue Nov 1, 2017 · 1 comment
Open

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

copy opened this issue Nov 1, 2017 · 1 comment
Assignees

Comments

@copy
Copy link
Contributor

copy commented Nov 1, 2017

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

@c-cube
Copy link
Owner

c-cube commented Nov 4, 2017

Fair point, but retrocompatibility seems to indicate it won't be possible to have a consistent state any time soon…

@c-cube c-cube self-assigned this Nov 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants