Abstract
Pure, functional programming languages offer several solutions to construct Graphical User Interfaces (GUIs). In this paper we report on a project in which we port the Clean Object I/O library to Haskell. The Clean Object I/O library uses an explicit environment passing scheme, based on the uniqueness type system of Clean. It supports many standard GUI features suchas windows, dialogues, controls, and menus. Applications can have timing behaviour. In addition, there is support for interactive processes and message passing. The standard functional programming language Haskell uses a monadic framework for I/O. We discuss how the Object I/O library can be put in a monadic framework without loosing its essential features. We give an implementation of an essential fragment of the Object I/O library to demonstrate the feasibility. We take especial consideration for the relevant design choices. One particular design choice, how to handle state, results in two versions.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Achten, P. M., van Groningen, J. H. G., and Plasmeijer, M. J. High Level Specification of I/O in Functional Languages. In Launchbury, J., Sansom, P. eds., Proceedings Glasgow Workshop on Functional Programming, Ayr, Scotland, 6–8 July 1992. Workshops in Computing, Springer-Verlag, Berlin, 1993, pp. 1–17.
Achten, P. M. and Plasmeijer, M. J. The ins and outs of Clean I/O. In Journal of Functional Programming 5(1)-January 1995, Cambridge University Press, pp. 81–110.
Achten, P. M. and Plasmeijer, M. J. Concurrent Interactive Processes in a Pure Functional Language. In Vliet, J. C. van, ed., Proceedings Computing Science in the Netherlands, CSN’95, Jaarbeurs Utrecht, The Netherlands, November 27–28, Stichting Mathematisch Centrum, Amsterdam, 1995, pp. 10–21.
Achten, P. M. and Plasmeijer, M. J. Interactive Functional Objects in Clean. In Clack, C., Hammond, K. and Davie, T. eds., Proceedings 9th International Workshop Implementation of Functional Languages, IFL’97, St. Andrews, Scotland, UK, September 1997, selected papers, LNCS 1467, Springer, pp. 304–321.
Achten, P. M. and Plasmeijer, M. J. The implementation of interactive local state transition systems in Clean. In Koopman, P., Clack, C. eds., Proceedings 11th International Workshop Implementation of Functional Languages, IFL’99, Lochem, The Netherlands, September 1999, selected papers, LNCS 1868, Springer, pp. 115–130.
Achten, P. M. and Wierich, M. A Tutorial to the Clean Object I/O Library-version 1.2. Technical Report CSI-R0003, February 2, 2000, Computing Science Institute, Faculty of Mathematics and Informatics, University of Nijmegen, The Netherlands.
Barendsen, E. and Smetsers, J. E. W. Uniqueness Type Inference. In [14], 189–206.
8. Bjørner, D., Broy, M., Pottosin, I. V. eds. Perspectives of System Informatics, Second International Andrei Ershov Memorial Conference Akademgorodok, Novosibirsk, Russia, June 25–28, 1996, Proceedings, LNCS 1181, Springer.
Brus, T., Eekelen, M. C. J. D. van, Leer, M.O. van, and Plasmeijer, M. J. Clean: A Language for Functional Graph Rewriting. In Kahn. G. ed. Proceedings of the Third International Conference on Functional Programming Languages and Computer Architecture, Portland, Oregon, USA, LNCS 274, Springer-Verlag, pp. 364–384.
Carlsson, M. and Hallgren, Th. Fudgets-A Graphical User Interface in a Lazy Functional Language. In Proceedings of Conference on Functional Programming Languages and Computer Architecture, Copenhagen, Denmark, 9–11 June 1993, ACM Press, pp. 321–330.
Finne, S. A Haskell foreign function interface. Available as GHC extension, see: http://www.haskell.org/ghc/docs/latest/set/sec-foreign.html.
Finne, S., Leijen, D., Meijer, E., and Peyton Jones, S. Calling hell from heaven and heaven from hell. In ACM SIGPLAN International Conference on Functional Programming (ICFP’99), Paris, ACM Press, pp. 114–125.
Frauenstein, Th., Grieskamp, W., Pepper, P., and Südholt. Communicating Functional Agents and Their Application to Graphical User Interfaces. In [8], pp. 386–397.
Hermenegildo, M. and Swierstra, S. D. eds. Proceedings of Seventh International Symposium on Programming Languages: Implementations, Logics and Programs, Utrecht, The Netherlands, 20–22 September 1995, LNCS 982, Springer-Verlag.
Hudak, P., Peyton Jones, S., Wadler, Ph., Boutel, B., Fairbairn, J., Fasel, J., Hammond, K., Hughes, J., Johnsson, Th., Kieburtz, D., Nikhil, R., Partain, W., Peterson, J. Report on the programming language Haskell, In ACM SigPlan Notices, 27(5): 1–164.
Noble, R. and Runciman, C. Gadgets: Lazy Functional Components for Graphical User Interfaces. In [14], pp. 321–340.
Nöcker, E. G. J. M. H., Smetsers, J. E. W., Eekelen, M. C. J. D. van, and Plasmeijer, M. J. Concurrent Clean. In Aarts, E. H. L., Leeuwen, J. van, Rem, M., eds., Proceedings of Parallel Architectures and Languages Europe, June, Eindhoven, The Netherlands. LNCS 506, Springer-Verlag, pp. 202–219.
Peyton Jones, S. L. and Wadler, Ph. Imperative Functional Programming. In Proceedings of the 20th Annual ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, Charleston, South Carolina, January 10–13, 1993, 71–84.
Peyton Jones, S., Gordon, A., Finne, S. Concurrent Haskell. In 23rd ACM Symposium on Principles of Programming Languages (POPL’96), January 1996, St.Petersburg Beach, Florida, ACM, pp. 295–308.
Peyton Jones, S. and Hughes, J. eds. Report on the Programming Language Haskell 98-A Non-strict, Purely Functional Language, 1 February 1999.
Plasmeijer, M. J. and van Eekelen, M. C. J. D. Functional Programming and Parallel Graph Rewriting. Addison-Wesley Publishing Company 1993.
Sage, M. TclHaskell. http://www.dcs.gla.ac.uk/~meurig/TclHaskell/.
Scholz, E. Pidgets-Unifying Pictures and Widgets in a Constraint-Based Framework for Concurrent GUI Programming. In Kuchen, H., Swierstra, S. D. eds. Proceedings of eighth International Symposium on Programming Languages: Implementations, Logics, and Programs, Aachen, Germany, September 1996, LNCS 1140, Springer, pp. 363–377.
Smetsers, J. E. W., Barendsen, E., Eekelen, M. C. J. D. van, and Plasmeijer, M. J. Guaranteeing Safe Destructive Updates througha Type System withUniqueness Information for Graphs. In Schneider, H. J., Ehrig, H. eds. Proceedings Workshop Graph Transformations in Computer Science, Dagstuhl Castle, Germany, January 4–8, 1993, LNCS 776, Springer-Verlag, Berlin, pp. 358–379.
Vullinghs, T., Schulte, W., and Schwinn, Th. The Design of a Functional GUI Library Using Constructor Classes. In [8], pp. 398–408.
Vullinghs, T., Tuijnman, D., and Schulte, W. Lightweight GUIs for Functional Programming. In [14], pp. 341–356.
Wadler, Ph. Comprehending monads. In Proceedings of the ACM Conference on Lisp and Functional Programming, Nice, 1990, ACM Press, pp. 61–78.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2001 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Achten, P., Peyton Jones, S. (2001). Porting the Clean Object I/O Library to Haskell. In: Mohnen, M., Koopman, P. (eds) Implementation of Functional Languages. IFL 2000. Lecture Notes in Computer Science, vol 2011. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45361-X_12
Download citation
DOI: https://doi.org/10.1007/3-540-45361-X_12
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-41919-8
Online ISBN: 978-3-540-45361-1
eBook Packages: Springer Book Archive