Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/From [Update Party] to [Party]Forum ↗

From [Update Party] to [Party]

App Development3 posts364 views8 likesLast activity Oct 2020
JE
Jean_SafarOP
Oct 2020

Hi,

I iterate from a series of contracts that fetch using the map function and create a set of Parties from all the contract loaded. I then want to create a set of those parties.

However, the result of my map is a [Update Party] which I can’t do a union with a Set Party.

What is the usual pattern for that?

SA
SamirTalwar
Oct 2020

If you use mapA, you’ll get an Update [Party]. You can then use do notation to extract out the list, and from there convert it into a Set. Finally, you can union that Set Party with whatever else you need to.

It’ll look something like this:

operation contractIds = do
  contracts <- mapA fetch contractIds
  parties <- mapA getPartySomehow contracts
  -- use `parties` here
JE
Jean_Safar
Oct 2020

thanks for that @SamirTalwar!!!

← Back to Discussions