Qt with QML does exactly this with animations. It works very well. You don’t really need a functional language to do this kind of thing. I’ve written classes in C++ which are composed to produce different behaviors. Composition in OO is a way to accomplish this without using a functional language.