this is no directly roc related, but how one does map when there is 2d structure to be modified, one has to combine list of lists somehow or there is some native support for that?
I'm not totally sure if I'm understanding your question right, but if you want to map over every element in a list of lists, you could use nested List.map
s:
listOfLists = [[1, 2, 3], [4, 5, 6]]
List.map listOfLists \list ->
List.map list \num ->
num + 1
# => [[2, 3, 4], [5, 6, 7]]
If you want to "flatten out" the structure while mapping, you could use List.joinMap
plus backpassing https://gist.github.com/drewolson/3c5a44e4ea177995a675541fbc50aee2
Last updated: Jul 06 2025 at 12:14 UTC