I think you could create an animation library that doesn't store any functions in its model and still be able to let a user provide whatever easing function they want.
E.g. remove the ease key from your AnimRecord and let all functions that currently take an Animation have an additional parameter easingFunction: animate : EasingFunction -> Time -> Animation -> Float This way a user of your library doesn't have to put any functions in their model and you get both a function free model and endless customization by providing whatever easing function a user needs. Am I missing something? On Wednesday, 5 October 2016 07:56:04 UTC+2, Max Goldstein wrote: > > Serialization: animations are view state. They can safely be left out of a > serialized and persisted model. > > Print out the model: True, but if you're using animation in an app, you're > beyond poking at the model in the REPL. > > Harder to equate: My animation library provides an "equals" function. In > addition to sampling the easing function, it accounts for a few other ways > animations can have different representations but be considered equal (e.g. > start at time t with delay k == start at time t+k with no delay). > > "just store the things needed to create the function" -> This is > essentially the "EasingDescription" idea I talked about above. The problem > is that easing functions can be created in many way (sinusoids, > polynomials, exponentials, bounces) and I want to allow the client to > specify any function. > -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.