Details
-
Improvement
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
Description
The stdlib unique function can only process String and Array values and it is not possible to influence the comparison (it is always a Ruby == operation).
The unique function is really intrinsic to collections and iterators and it makes sense for it to be in Puppet instead of stdlib.
- For String and Array the function must be compatible with the stdlib version
- The function should handle all Iterables
- It should be possible to give the function a lambda that computes the value to do the equality/uniqueness check on.
- For Hash the result should be a hash with associations between the sets of keys that all have values that are computed to be equal (by the built in == or by a given lambda) and the set of those values.