swarm-game / swarm

Resource gathering + programming game
Other
820 stars 51 forks source link

Change `meetAll` to return a list #1998

Closed byorgey closed 3 days ago

byorgey commented 4 days ago

As implemented in #920 , and as discussed at #306, the meetAll command currently has type

meetAll : (b -> Actor -> Cmd b) -> b -> Cmd b

i.e. you give it a callback function which will be run on every nearby robot. However, now that we have recursive types (#1894) we should consider changing it to just return a list of robots, i.e.

meetAll : Cmd (rec l. Unit + Actor * l)

This would make the command simpler to use and would also allow us to remove some complex CESK machinery (we currently need some special states just to implement this command!).