The use of pure functional languages for interactive applications, especially mobile applications and games, is still rare. Reasons include the lack of libraries and frameworks that implement necessary features, poor integration with existing toolchains, and the lack of examples that demonstrate how to best structure large interactive applications in a way that is scalable in terms of performance and modularity. In this paperwe identify three specific challenges that limit the application of functional programming specifically to mobile apps and games: purity, compositionality, and abstraction. We discuss solutions to these problems, and propose a framework for mobile app programming that completely separates logic from IO, resulting in an architecture that is referentially transparent, modular, scalable, backend agnostic and trivial to test. We implement this proposal in Fawn, a collection of libraries that provide higher-level notions needed in commercial applications, like resource management, widgets, storing user preferences, audio playing, image rendering, and composable applications. We have verified the suitability of this approach by using it to build, in Haskell, six mobile games for iOS and Android.
CITATION STYLE
Zeller, C., & Perez, I. (2019). Mobile game programming in Haskell. In FARM 2019 - Proceedings of the 7th ACM SIGPLAN International Workshop on Functional Art, Music, Modeling, and Design, co-located with ICFP 2019 (pp. 37–48). Association for Computing Machinery, Inc. https://doi.org/10.1145/3331543.3342580
Mendeley helps you to discover research relevant for your work.