Abstract
We present the concept of typelets, a specification technique for dynamic graphical user interfaces (GUIs) based on types. The technique is implemented in a dialect of ML, called MLFi, which supports dynamic types, for migrating type-level information into the object level, so-called type properties, allowing easy specification of, for instance, GUI control attributes, and type paths, which allows for type-safe access to type components at runtime. Through the use of Hindley-Milner style type-inference in MLFi, the features allow for type-level programming of user interfaces. The dynamic behavior of typelets are specified using declarative rules. The technique extends the flat spreadsheet programming model with higher-order rule composition techniques, extensive reuse, and type safety. A layout specification language allows layout programmers (e.g., end-users) to reorganize layouts in a type-safe way without being allowed to alter the rule machinery. The resulting framework is highly flexible and allows for creating highly maintainable modules. It is used with success in the context of SimCorp’s high-end performance-critical financial asset-management system with screens containing several hundreds of GUI controls located in group-boxes, sub-tabs, and menu structures and with very complex dependency structures defined using declarative rule composition.
Access provided by Autonomous University of Puebla. Download to read the full chapter text
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Bjornson, J., Tayanovskyy, A., Granicz, A.: Composing reactive GUIs in F# using WebSharper. In: Hage, J., Morazán, M.T. (eds.) IFL 2010. LNCS, vol. 6647, pp. 203–216. Springer, Heidelberg (2011)
Blume, M.: No-longer-foreign: Teaching an ML compiler to speak C “natively”. In: Workshop on Multi-language Infrastructure and Interoperability (BABEL 2001) (September 2001)
Carlsson, M., Hallgren, T.: Fudgets–a graphical user interface in a lazy functional language. In: Proceedings of the ACM Conference on Functional Programming and Computer Architectures (FPCA 1993), pp. 321–330. ACM Press (1993)
Cooper, E., Lindley, S., Yallop, J.: The essence of form abstraction. In: Ramalingam, G. (ed.) APLAS 2008. LNCS, vol. 5356, pp. 205–220. Springer, Heidelberg (2008)
Courtney, A., Nilsson, H., Peterson, J.: The Yampa arcade. In: Proceedings of the 2002 ACM SIGPLAN Workshop on Haskell, pp. 7–18. ACM Press (2002)
Courtney, A., Elliott, C.: Genuinely functional user interfaces. In: Proceedings of the 2001 Haskell Workshop (September 2001)
Elliott, C., Hudak, P.: Functional reactive animation. In: ICFP 1997. ACM, New York (1997)
Elsman, M.: SMLtoJs: Hosting a Standard ML compiler in a web browser. In: Proceeding of ACM SIGPLAN 2011 International Workshop on Programming Language and Systems Technologies for Internet Clients (PLASTIC 2011). ACM Press (October 2011)
Elsman, M., Larsen, K.F.: Typing XHTML Web Applications in ML. In: Jayaraman, B. (ed.) PADL 2004. LNCS, vol. 3057, pp. 224–238. Springer, Heidelberg (2004)
Fluet, M., Pucella, R.: Phantom types and subtyping. In: International Conference on Theoretical Computer Science (TCS 2002) (August 2002)
Frisch, A.: Runtime types. In LexiFi blog (December 2011), http://www.lexifi.com/blog/runtime-types
Järvi, J., Marcus, M., Parent, S., Freeman, J., Smith, J.N.: Property models: from incidental algorithms to reusable components. In: 7th International Conference on Generative Programming and Component Engineering (GPCE 2008), pp. 89–98 (October 2008)
Jones, S.P., Eber, J.-M., Seward, J.: Composing contracts: an adventure in financial engineering. In: Fifth International Conference on Functional Programming (ICFP 2000) (September 2000)
Leijen, D.: wxHaskell: A portable and concise GUI library for Haskell. In: Proceeding of the 2004 ACM SIGPLAN Haskell Workshop. ACM Press (September 2004)
Leijen, D., Meijer, E.: Domain specific embedded compilers. In: ACM Conference on Domain-Specific Languages. ACM Press (2000)
Meyerovich, L.A., Guha, A., Baskin, J., Cooper, G.H., Greenberg, M., Bromfield, A., Krishnamurthi, S.: Flapjax: a programming language for ajax applications. In: OOPSLA 2009. ACM, New York (2009)
Michels, S., Plasmeijer, R., Achten, P.: iTask as a new paradigm for building GUI applications. In: Hage, J., Morazán, M.T. (eds.) IFL 2010. LNCS, vol. 6647, pp. 153–168. Springer, Heidelberg (2011)
Moggi, E.: Notions of computation and monads. Information and Computation 93, 55–92 (1989)
Noble, R., Runciman, C.: Gadgets: Lazy functional components for graphical user interfaces. In: Swierstra, S.D. (ed.) PLILP 1995. LNCS, vol. 982, pp. 321–340. Springer, Heidelberg (1995)
Plasmeijer, R., Achten, P., Koopman, P., Lijnse, B., van Noort, T., van Groningen, J.: iTasks for a change—type-safe run-time change in dynamically evolving workflows. In: Proceedings of the 20th International Workshop on Partial Evaluation and Program Manipulation (PEPM 2011), pp. 151–160. ACM Press (2011)
Hinrichs, T.L.: Plato: A compiler for interactive web forms. In: Rocha, R., Launchbury, J. (eds.) PADL 2011. LNCS, vol. 6539, pp. 54–68. Springer, Heidelberg (2011)
Sage, M.: FranTk - a declarative GUI language for Haskell. In: Proceedings of the Fifth ACM SIGPLAN International Conference on Functional Programming (ICFP 2000), pp. 106–117. ACM Press (2000)
Vouillon, J.: Js_of_ocaml. Documentation at http://ocsigen.org/js_of_ocaml/manual/
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2014 Springer International Publishing Switzerland
About this paper
Cite this paper
Elsman, M., Schack-Nielsen, A. (2014). Typelets — A Rule-Based Evaluation Model for Dynamic, Statically Typed User Interfaces. In: Flatt, M., Guo, HF. (eds) Practical Aspects of Declarative Languages. PADL 2014. Lecture Notes in Computer Science, vol 8324. Springer, Cham. https://doi.org/10.1007/978-3-319-04132-2_13
Download citation
DOI: https://doi.org/10.1007/978-3-319-04132-2_13
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-04131-5
Online ISBN: 978-3-319-04132-2
eBook Packages: Computer ScienceComputer Science (R0)