You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 :)
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.
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) :
return the element equals to the first arg if any (or raise Not_found)
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
The text was updated successfully, but these errors were encountered: