Hello! Can someone provide a nicer looking altern...
# announcements
z
Hello! Can someone provide a nicer looking alternative to the following. Let’s say I have a bunch of pure functions that operate on an instance of a data class, and I want to run a bunch of functions. Right now, I have something that looks like this:
Copy code
data class Game()

var game = Game()
game = DoSomethingTo(game)
game = DoAnotherThingTo(game)
game = YetAnotherThingTo(game)
return game
I know one solution would be to make those functions member functions of game and introduce a fluent api, but then they would no longer be pure functions. Is there a way to achieve the above with nicer looking code?