I am using hashr::hash to write a version of purrr::map which only computes on the unique elements in the list, but I only want to recurse one layer down and I don't know what the values one layer down will be. So I currently have to do the following:
nonrecursive_hash <- function(x) {
if(inherits(x, c("list", "character"))) hashr::hash(ix, recursive=FALSE)
else hashr::hash(x)
}
single_layer_hash <- function(x) {
purrr::map_int(x, nonrecursive_hash)
}
It would be great if hash.default was able to take recursive=FALSE. It could error if TRUE was passed.