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

List.take function #5826

Closed
vicuna opened this issue Nov 14, 2012 · 2 comments
Closed

List.take function #5826

vicuna opened this issue Nov 14, 2012 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Nov 14, 2012

Original bug ID: 5826
Reporter: warwick
Assigned to: @alainfrisch
Status: resolved (set by @alainfrisch on 2016-12-06T15:23:27Z)
Resolution: suspended
Priority: low
Severity: feature
Category: standard library

Bug description

I think it would be really good to add a function

List.take : a' list -> int -> 'a list

which could work similarly to List.nth except for returning a list of items up to and including the 'nth' one.

This seems like a useful core function for the standard library rather than having to download an extension library to handle it.

I'd find it most useful for finding the top 'n' items in a list: doing a List.sort followed by List.take

Thanks for considering this request.

@vicuna
Copy link
Author

vicuna commented Jun 28, 2013

Comment author: @damiendoligez

A general remark about such additions to the standard library: in a perfect world, you would be using an extension library as a matter of fact for all your programs, and the standard library should probably be renamed to "the minimal library". We don't have the manpower and the will to maintain an extensive library in addition to the compiler, so this task should be (and is) picked up by the community.

@vicuna
Copy link
Author

vicuna commented Dec 6, 2016

Comment author: @alainfrisch

The policy wrt to stdlib evolutions is a bit more open now, but such proposal should come as a pull request.

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