Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005826OCamlstandard librarypublic2012-11-15 00:142016-12-06 16:23
Assigned Tofrisch 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0005826: List.take function
DescriptionI 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.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
doligez (administrator)
2013-06-28 18:00

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.
frisch (developer)
2016-12-06 16:23

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

- Issue History
Date Modified Username Field Change
2012-11-15 00:14 warwick New Issue
2013-06-28 18:00 doligez Note Added: 0009638
2013-06-28 18:00 doligez Status new => acknowledged
2016-12-06 16:23 frisch Note Added: 0016645
2016-12-06 16:23 frisch Status acknowledged => resolved
2016-12-06 16:23 frisch Resolution open => suspended
2016-12-06 16:23 frisch Assigned To => frisch
2017-02-23 16:43 doligez Category OCaml standard library => standard library

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker