Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007283OCamlstandard librarypublic2016-07-05 12:212017-04-14 16:39
Reportertormen 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0007283: List Module Inconsistancy :: "map"+"mapi" "iter"+"iteri" "rev_map"... but no "rev_mapi"
DescriptionIn module List there is "map"+"mapi" "iter"+"iteri"
                "rev_map"... but no "rev_mapi" :(
Any particular reason ?

IMHO this seems like a inconsistency.
There should be either have map + mapi AND rev_map + rev_mapi OR map + rev_map.

I opt for the former (and pledge to add rev_mapi) :)
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0016036)
frisch (developer)
2016-07-05 12:53

FWIW, other iterators are missing the "i" variant as well: fold_left, fold_right, iter2, map2, fold_left2, fold_right2, rev_map2, but also for_all, exists, for_all2, exists2, find, filter, find_all, partition.
(0016037)
paurkedal (reporter)
2016-07-05 22:38
edited on: 2016-07-05 22:39

`rev_map` is just an optimisation of `rev o map`, so I see it as a pragmatic addition driven by need more than consistency. If we mark out optimisations, then we can worry about consistency for the remainder of the interface.

That said, folds don't need indexed variants, since one can just pass a counter in the accumulator. If we could also argue that indices are less useful in predicates (my guess), then we would be left with `rev_mapi` and `rev_map2i` as candidates for inclusion.


- Issue History
Date Modified Username Field Change
2016-07-05 12:21 tormen New Issue
2016-07-05 12:53 frisch Note Added: 0016036
2016-07-05 22:38 paurkedal Note Added: 0016037
2016-07-05 22:39 paurkedal Note Edited: 0016037 View Revisions
2017-02-23 16:43 doligez Category OCaml standard library => standard library
2017-04-14 16:39 doligez Status new => acknowledged


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker