Done
The game is still a work-in-progress, but it's playable... added scoring and tweaked the CPU player a bit, which makes it more fun. Probably going to tweak it more and add some post-processing effects to the WebGL renderer to make it feel like a TV screen or something...
I'm wondering about this too... my current thinking is that it's fine, because generating the trajectory function is extremely cheap. For example, in the demo above - it's changed by creating a new instance of a type, the function itself is defined on the typeclass and doesn't do anything until it's evaluated.
Without that typeclass stuff, even if it were just using lambdas and Cells directly, I think it'd be roughly the same idea since it doesn't call the trajectory function until it needs to evaluate it, and creating the lambda is inexpensive (it's calling the lambda which costs - but that's unavoidable and the same as a procedural approach too, difference I guess is calling a function which changes vs. calling a function with internal branching logic that changes... I don't think that's a major difference, but maybe it becomes a factor at scale... though it might be that the lambda approach is even better in some scenarios! It'd be interesting to see case studies!).