Abstract
This paper presents PaSe, an extensible and inspectable DSL embedded in Haskell for expressing micro-animations. PaSe builds animations in compositional fashion, using parallel and sequential animations as basic building blocks. This differs from typical animation libraries which mostly focus on sequential composition and utilize callbacks and implicit effects for their expressivity. To provide similar flexibility to other animation libraries, PaSe features extensibility of operations and inspectability of animations. We present the features of PaSe with a to-do list application, discuss the PaSe implementation, and argue that the callback style of extensibility is detrimental for correctly integrating inspectability. To illustrate this, we contrast with the GreenSock Animation Platform, a professional-grade and widely used JavaScript animation library.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
Pronounced pace ( ), the name is derived from Parallel and Sequential.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
The class (https://en.wikibooks.org/wiki/Haskell/Alternative_and_MonadPlus) is not suitable as the laws are not the same.
- 12.
- 13.
Using GHC’s RebindableSyntax extension, it is possible to use the builtin syntax.
- 14.
Examples: https://greensock.com, https://animejs.com, and https://popmotion.io.
- 15.
It requires (among other extensions) and explicitly instantiating the constraint at the call-site.
- 16.
- 17.
- 18.
References
Bederson, B.B., Boltman, A.: Does animation help users build mental maps of spatial information? In: INFOVIS 1999, pp. 28–35 (1999). https://doi.org/10.1109/INFVIS.1999.801854
Capriotti, P., Kaposi, A.: Free applicative functors. In: MSFP 2014, pp. 2–30 (2014). https://doi.org/10.4204/EPTCS.153.2
Carette, J., Kiselyov, O., Shan, C.: Finally tagless, partially evaluated: tagless staged interpreters for simpler typed languages. J. Funct. Program. 19(5), 509–543 (2009). https://doi.org/10.1017/S0956796809007205
Elliott, C., Hudak, P.: Functional reactive animation. In: ICFP 1997, pp. 263–273 (1997). https://doi.org/10.1145/258948.258973
Gibbons, J.: Free delivery (functional pearl). In: Haskell 2016, pp. 45–50 (2016). https://doi.org/10.1145/2976002.2976005
Gill, A., et al.: The remote monad design pattern. In: Haskell 2015, pp. 59–70 (2015). https://doi.org/10.1145/2804302.2804311
Gonzalez, C.: Does animation in user interfaces improve decision making? In: CHI 1996, pp. 27–34 (1996). https://doi.org/10.1145/238386.238396
Heer, J., Robertson, G.G.: Animated transitions in statistical data graphics. IEEE Trans. Vis. Comput. Graph. 13(6), 1240–1247 (2007). https://doi.org/10.1109/TVCG.2007.70539
Hughes, J.: Generalising monads to arrows. Sci. Comput. Program. 37(1–3), 67–111 (2000). https://doi.org/10.1016/S0167-6423(99)00023-4
Jones, M.P.: Functional programming with overloading and higher-order polymorphism. In: Jeuring, J., Meijer, E. (eds.) AFP 1995. LNCS, vol. 925, pp. 97–136. Springer, Heidelberg (1995). https://doi.org/10.1007/3-540-59451-5_4
Kiselyov, O.: Effects without monads: non-determinism - back to the meta language. In: ML/OCaml 2017, pp. 15–40 (2017). https://doi.org/10.4204/EPTCS.294.2
Kurlander, D., Ling, D.T.: Planning-based control of interface animation. In: CHI 1995, pp. 472–479 (1995). https://doi.org/10.1145/223904.223968
van Laarhoven, T.: CPS-Based Functional References (2009). https://www.twanvl.nl/blog/haskell/cps-functional-references
Liang, S., Hudak, P., Jones, M.P.: Monad transformers and modular interpreters. In: POPL 1995, pp. 333–343 (1995). https://doi.org/10.1145/199448.199528
Lindley, S.: Algebraic effects and effect handlers for idioms and arrows. In: WGP 2014, pp. 47–58 (2014). https://doi.org/10.1145/2633628.2633636
McBride, C., Paterson, R.: Applicative programming with effects. J. Funct. Program. 18(1), 1–13 (2008). https://doi.org/10.1017/S0956796807006326
Mirlacher, T., Palanque, P.A., Bernhaupt, R.: Engineering animations in user interfaces. In: EICS 2012, pp. 111–120 (2012). https://doi.org/10.1145/2305484.2305504
Mokhov, A., Lukyanov, G., Marlow, S., Dimino, J.: Selective applicative functors. In: ICFP 2019, pp. 90:1–90:29 (2019). https://doi.org/10.1145/3341694
Mokhov, A., Mitchell, N., Peyton Jones, S.: Build systems à la carte. In: PACMPL (ICFP 2018), vol. 2, pp. 79:1–79:29 (2018). https://doi.org/10.1145/3236774
Wadler, P.: Comprehending monads. In: LFP 1990, pp. 61–78 (1990). https://doi.org/10.1145/91556.91592
Yallop, J.: Abstraction for web programming. Ph.D. thesis, University of Edinburgh, UK (2010)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2020 Springer Nature Switzerland AG
About this paper
Cite this paper
Pieters, R.P., Schrijvers, T. (2020). PaSe: An Extensible and Inspectable DSL for Micro-Animations. In: Byrski, A., Hughes, J. (eds) Trends in Functional Programming. TFP 2020. Lecture Notes in Computer Science(), vol 12222. Springer, Cham. https://doi.org/10.1007/978-3-030-57761-2_1
Download citation
DOI: https://doi.org/10.1007/978-3-030-57761-2_1
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-57760-5
Online ISBN: 978-3-030-57761-2
eBook Packages: Computer ScienceComputer Science (R0)