Open kenbot opened 7 years ago
If we have multiple changes to make to a structure, how can we perform them all without it looking terrible?
val game1 = set"$game.currentLevel.player.health" := 100 val game2 = set"$game1.currentLevel.player.ammo" := 70 val game3 = set"$game2.currentLevel.player.status" = Status.Alive ...
or nested:
set"${set"${set"$game.currentLevel.player.status" = Status.Alive}.currentLevel.player.ammo" := 70}.currentLevel.player.health" := 100
Ew.
But how to do this? A 2d syntax?
val game1 = set"""$game.currentLevel.player.health | .ammo | .status""" = (100,70,Status.Alive)
That's really weird though. Maybe using the tuple syntax suggested in #10?
set"""$game.currentLevel.player.(health, ammo, status)" := (100, 70, Status.Alive)
This might not be powerful enough though. What do other Lens implementations do? Haskell? Is this needed at all?
If we have multiple changes to make to a structure, how can we perform them all without it looking terrible?
or nested:
Ew.
But how to do this? A 2d syntax?
That's really weird though. Maybe using the tuple syntax suggested in #10?
This might not be powerful enough though. What do other Lens implementations do? Haskell? Is this needed at all?