Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007309OCamlstandard librarypublic2016-07-29 22:552017-04-05 14:50
Assigned To 
PrioritynormalSeverityfeatureReproducibilityhave not tried
PlatformOSOS Version
Product Version 
Target VersionFixed in Version4.06.0 +dev/beta1/beta2/rc1 
Summary0007309: provides a `update` function for map
Descriptiontype would be

val update: key -> ('a option -> 'a) -> 'a t -> 'a t

the rational is mostly for performance, this API is also available in Haskell [^]
TagsNo tags attached.
Attached Files

- Relationships
has duplicate 0001771resolvedfrisch Add Map.{alter,alter_add} 
related to 0005220acknowledged Feature request: Hashtbl.adjust 

-  Notes
frisch (developer)
2016-07-31 16:04

I'd be interested to see benchmarks to illustrate the gains. Avoiding an extra (allocation-free) lookup could be somehow compensated by the extra allocations for the closure and the option type. Or could flambda get rid of them?
hongboz (developer)
2016-08-01 03:53

note that exception is not cheap in JS backend, while `update` is a quite common paradigm,
I am in favor of having a `update` function which does not rely on exception, but it is still a good step that we have a `update` function whether it relies on exception or not
frisch (developer)
2017-02-20 12:52 [^]

- Issue History
Date Modified Username Field Change
2016-07-29 22:55 hongboz New Issue
2016-07-31 16:04 frisch Note Added: 0016154
2016-08-01 03:53 hongboz Note Added: 0016155
2016-12-07 18:57 shinwell Category OCaml general => OCaml standard library
2016-12-09 09:23 frisch Relationship added related to 0005220
2017-02-20 12:27 frisch Relationship added has duplicate 0001771
2017-02-20 12:52 frisch Note Added: 0017380
2017-02-23 16:43 doligez Category OCaml standard library => standard library
2017-02-28 14:15 frisch Status new => resolved
2017-02-28 14:15 frisch Fixed in Version => 4.06.0 +dev/beta1/beta2/rc1
2017-04-05 14:50 doligez Resolution open => fixed

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker