powered by
Apply a function to each element of a list returned by a lens. Using over in such cases would require a "lifted" function, which is often unergonomic.
over
over_map(d, l, f)
The modified data structure
The data structure to modify
The list-returning lens to apply
The function to apply to each element of the list
d <- list(list(a = 1, b = 2), list(a = 4, b = 9)) l <- map_l(index_l("a")) over_map(d, l, sqrt)
Run the code above in your browser using DataLab