How does the following work? Given a list of items [a] and a function mapping a to g b, how do I preserve the input in the resulting list?
[a] -> (a -> g b) -> g [(a,b)]
Concretely, I have a list of contract ids. I want to map every contract id to the tuple of (id, payload), where payload is some contract variable. And g b in the above example is fetch.