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

Additional feature for module set #4489

Closed
vicuna opened this issue Jan 23, 2008 · 1 comment
Closed

Additional feature for module set #4489

vicuna opened this issue Jan 23, 2008 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Jan 23, 2008

Original bug ID: 4489
Reporter: Christophe
Assigned to: @alainfrisch
Status: resolved (set by @alainfrisch on 2016-12-07T17:31:09Z)
Resolution: fixed
Priority: normal
Severity: feature
Version: 3.10.0
Fixed in version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Category: standard library
Tags: patch
Related to: #2748

Bug description

I upload a module Myset that contains the Set module plus additional VERY useful functions :

val max_elt_lt : elt -> t -> elt
return the largest element lower than the first arg
val min_elt_gt : elt -> t -> elt
return the smallest element greater thant the first arg

The next two function are very useful when the order is only a preorder (when different elements x y are equals using Ord.compare) :

val get_eq : elt -> t -> elt

return the element equals to the first arg if any (or raise Not_found)

val split_elt : elt -> t -> t * elt option * t

same as split but it returns the element equals to the first arg (if any)

PLEASE, add it to the Set module into the next release :)

Christophe

File attachments

@vicuna
Copy link
Author

vicuna commented Dec 7, 2016

Comment author: @alainfrisch

Set.find_first/find_last in 4.05 can be used to implement easily all these function on the user side. I'm unsure about the actual need for split_elt. If you feel strongly about it, please open a new ticket (or, better, a PR) with more motivation.

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