Interacting with functional languages

Abstract

Functional languages are mathematically pure, and easier to reason about than their imperative rivals. Because of this, they are an attractive paradigm of programming. They allow programmers to express complex algorithms in a declarative manner, resulting in powerful programs that are also well written. Good interaction with users is important for programs which are to be used for real applications. This normally involves creating a user interface using devices such as menus, buttons and scrollbars. It is now increasingly common for the interface of programs to be developed using specialised tools allowing a faster development cycle, with less programming involved. In the past, pure functional languages have been poor at creating graphical user interfaces resulting in good applications with poor interfaces. This is due to the mixing of the user's world which involves complex multi-level interactions, with the functional world which has a single threaded state. This is not a very good abstraction of the world to interact with. When the traits of the user's world are introduced into the functional world it is found that the purity of the functional world is compromised, and the clean declarative style of functional programming is lost. If the user interaction is separated from the functional program, allowing users to communicate with functional programs using external interface programs, it is possible to preserve the natural simplicity of the functional world. This would also allow programmers to take advantage of user interface development tools. I look at current solutions for performing input and output from functional languages, with particular reference to the Monadic I/O style which is currently gaining popularity. I then present a scheme where I have deliberately separated interaction from functionality, allowing functional programmers to build programs that interact with the "Real World", with less interference of the real world into the pure environment within the functional program

    Similar works