Skip to main content

PaSe: An Extensible and Inspectable DSL for Micro-Animations

  • Conference paper
  • First Online:
Trends in Functional Programming (TFP 2020)

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    Pronounced pace ( ), the name is derived from Parallel and Sequential.

  2. 2.

    https://greensock.com.

  3. 3.

    https://www.renpy.org/doc/html/atl.html#parallel-statement.

  4. 4.

    https://facebook.github.io/react-native/docs/animated#parallel.

  5. 5.

    https://doc.qt.io/qt-5/animation.html.

  6. 6.

    https://github.com/rubenpieters/PaSe-hs/tree/master/PaSe-examples.

  7. 7.

    https://hackage.haskell.org/package/gloss.

  8. 8.

    https://hackage.haskell.org/package/sdl2.

  9. 9.

    https://hackage.haskell.org/package/lens.

  10. 10.

    http://hackage.haskell.org/package/mtl.

  11. 11.

    The class (https://en.wikibooks.org/wiki/Haskell/Alternative_and_MonadPlus) is not suitable as the laws are not the same.

  12. 12.

    https://github.com/rubenpieters/anim_eff_dsl/tree/master/code.

  13. 13.

    Using GHC’s RebindableSyntax extension, it is possible to use the builtin syntax.

  14. 14.

    Examples: https://greensock.com, https://animejs.com, and https://popmotion.io.

  15. 15.

    It requires (among other extensions) and explicitly instantiating the constraint at the call-site.

  16. 16.

    https://github.com/rubenpieters/PaSe-hs/tree/master/PaSe-examples/Pacman.

  17. 17.

    https://github.com/rubenpieters/pacman-ts.

  18. 18.

    https://greensock.com/js/speed.html.

References

  1. 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

  2. Capriotti, P., Kaposi, A.: Free applicative functors. In: MSFP 2014, pp. 2–30 (2014). https://doi.org/10.4204/EPTCS.153.2

  3. 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

    Article  MathSciNet  MATH  Google Scholar 

  4. Elliott, C., Hudak, P.: Functional reactive animation. In: ICFP 1997, pp. 263–273 (1997). https://doi.org/10.1145/258948.258973

  5. Gibbons, J.: Free delivery (functional pearl). In: Haskell 2016, pp. 45–50 (2016). https://doi.org/10.1145/2976002.2976005

  6. Gill, A., et al.: The remote monad design pattern. In: Haskell 2015, pp. 59–70 (2015). https://doi.org/10.1145/2804302.2804311

  7. Gonzalez, C.: Does animation in user interfaces improve decision making? In: CHI 1996, pp. 27–34 (1996). https://doi.org/10.1145/238386.238396

  8. 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

    Article  Google Scholar 

  9. 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

    Article  MathSciNet  MATH  Google Scholar 

  10. 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

    Chapter  Google Scholar 

  11. 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

  12. 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

  13. van Laarhoven, T.: CPS-Based Functional References (2009). https://www.twanvl.nl/blog/haskell/cps-functional-references

  14. 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

  15. 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

  16. McBride, C., Paterson, R.: Applicative programming with effects. J. Funct. Program. 18(1), 1–13 (2008). https://doi.org/10.1017/S0956796807006326

    Article  MATH  Google Scholar 

  17. 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

  18. 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

  19. 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

  20. Wadler, P.: Comprehending monads. In: LFP 1990, pp. 61–78 (1990). https://doi.org/10.1145/91556.91592

  21. Yallop, J.: Abstraction for web programming. Ph.D. thesis, University of Edinburgh, UK (2010)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Ruben P. Pieters .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics