Haskell in practice

From HaskellWiki
Jump to navigation Jump to search

This page is obsolete. More up to date content may be found here:

Applications Written in Haskell

Haskell is a general purpose programming language, and many, many applications have been written in it. The following free Haskell programs may serve as examples for constructing large applications in Haskell. Many more examples can be found in the Compilers and interpreters and Libraries and tools pages. A great many more Haskell projects are documented in the community reports and in the archives of the Haskell Weekly News.

"Real World Applications of Functional Programming"
Wadler's page on the subject mentions several large applications written in Haskell (Equational Reasoning Assistant (see Haskell Equational Reasoning Assistant), Mitre Speech Recognition System the LOLITA Natural Language Processing System (abandoned in 2000), etc.)
An implementation of Perl6.
A shoot 'em up game using OpenGL. Takayuki Muranushi also wrote a couple of other games in Haskell.
DoCon, the Algebraic Domain Constructor
The DoCon computer algebra system implements a good-sized piece of commutative algebra. One of the project aims is to test the efficiency of a real-world CA system based on pure functionality and "lazy" computation.
Dumatel, a prover based on equational reasoning
This is a study in combining Computer algebra, Term rewriting and Automatic proofs. The system is presented as a library of Haskell functions.
Postmaster and Dukan
A mail transport agent (MTA) written in Haskell. The primary focus of the project is to provide an MTA that's a lot more flexible than the current implementations, in particular when it comes to implementing junk mail countermeasures.
A simple and lightweight Wiki clone written in plain Haskell 98 using the hierarchical libraries. There is a running trial copy.
AMuZed and ZooM
AMuZed is a graphical editing tool for the creation of mu-charts or microcharts. mu-charts consist of the 'well-defined' part of the Statecharts found in UML -- in that they have a semantics and, via the Z translation, a logic too. ZooM is a tool which takes the .muz file output of a created chart from AMuZed and generates a series of .tex files which contain the Z specification for that chart.
A tool that processes first-order logic problems and tries to find finite-domain models for them.
A tool for downloading RDF site summaries and showing news in a text file and in an HTML file.
David's Advanced Revision Control System is yet another replacement for CVS. It is written in Haskell, and has been tested on Linux and MacOS X. darcs includes a cgi script, which can be used to view the contents of your repository.
David Tweeds Haskell Programs
Currently David offers a LaTeX preprocessor.
An application for construction and running of finite state transducers.
Haskell in Space
An asteroids-like game.
A Haskell Compiler Front-End
This is a stand alone version of a compiler front-end, which was built by Norbert Klose as part of his master's thesis and which is described in detail there. See also his Lucky parser[2]
LPS: Language Prototyping System
A project that uses Haskell to build interpreters from monadic semantic descriptions.
Knit is a component definition and linking language for systems programming based on the Unit component programming model. Knit lets you turn ordinary C code (e.g., bits of the Linux kernel) into components and link them together to build new programs. Since the freedom to do new things brings with it the freedom to make new errors, Knit provides a simple constraint system to catch component configuration errors. Knit also provides a cross-component inliner and schedules initialization and finalization of components.
Knit is released under a BSD-style license, is written in Haskell (and a little C) and includes a C parser and pretty-printer. A useful little utility included in the distribution is a tool for renaming symbols in ELF-format object files.
The current Knit release acts post-compilation: we compile C code as normal and then rename symbols in object files before linking. We are rewriting Knit to act pre-compilation: manipulating the source code before compilation. This will bring the much needed ability to import and export types from modules.
A heart-beat monitor for local network links for Linux.
Utrecht Attribute Grammar System
We have used this attribute grammars sytem in the construction of our haskell compilers. It has proven to be an indispendable tool in keeping the various aspects apart.
A simple action game; see also his Plot4, a clone of Connect Four.
Quake Haskell (for the source, see Image:Quake.tar.gz)
Truth is a platform for the verification of distributed systems.
TSL is a language for describing hierarchies of schedulers and reasoning about what kinds of locks can legally be used at each level and what race conditions those locks can prevent.
VOP - Vision of Persistance
VOP is a program that parses POV-Ray scene description files and renders them using OpenGL.
A Web Server written in Haskell
It has been extended to produce HWS-WP, the Haskell Web Server With Plugins.
Interpreters for lambda calculus and combinatory logic.
A large IRC bot, dynamically extensible via plugins.
A first person 3D game written in Haskell.
An extensible text editor, reminiscent of vim.
A curses-based mp3 player.
A Haskell API search engine
Magic Cookies!
A commercial Android game using SDL2 multimedia written in the FRP flavour Yampa.
A breakout game with Kinect and Wiimote support, SDL multimedia, written in the FRP DSL Yampa.
JSON Class Generator
A Mac application that allows the user to define classes and enums in an editor and provides the ability to generate Objective-C source code for them, that contain functions for serializing/deserializing to/from JSON.

See also Libraries and tools and the Commercial Users of Functional Programming workshop.

Embedded Domain Specific Languages

Haskell has become quite popular for the development of domain specific languages. Instead of implementing an interpreter or compiler in Haskell, Haskell is enriched by libraries for domain specific data types and functions, that turn Haskell into a domain specific language, for example for describing music, pictures, animations or hardware. Even parsing combinators can be understood as domain specific languages. These embedded languages are filed as libraries and tools.

Reports on Experiences with Haskell

Financial and insurance contracts do not sound like promising territory for functional programming and formal semantics, but in fact we have discovered that insights from programming languages bear directly on the complex subject of describing and valuing a large class of contracts.

We introduce a combinator library that allows us to describe such contracts precisely, and a compositional denotational semantics that says what such contracts are worth. We sketch an implementation of our combinator library in Haskell. Interestingly, lazy evaluation plays a crucial role.

See also this article in the Risk Magazine, a journal of the financial engineering industry.

  • Haskell vs. Ada vs. C++ vs. Awk vs. ..., An Experiment in Software Prototyping Productivity by Paul Hudak and Mark P. Jones, 16 pages.
    Description of the results of an experiment in which several conventional programming languages, together with the functional language Haskell, were used to prototype a Naval Surface Warfare Center requirement for Geometric Region Servers. The resulting programs and development metrics were reviewed by a committee chosen by the US Navy.

    The results indicate that the Haskell prototype took significantly less time to develop and was considerably more concise and easier to understand than the corresponding prototypes written in several different imperative languages, including Ada and C++.

  • Benchmarking implementations of functional languages with pseudoknot, a Float-Intensive benchmark by P. H. Hartel, M. Feeley, M. Alt, L. Augustsson, P. Baumann, M. Beemster, E. Chailloux,C. H. Flood, W. Grieskamp, J. H. G. van Groningen, K. Hammond, B. Hausman, M. Y. Ivory, R. E. Jones, J. Kamperman, P. Lee, X. Leroy, R. D. Lins, S. Loosemore, N. Röjemo, M. Serrano, J.-P. Talpin, J. Thackray, S. Thomas, P. Walters, P. Weis, and P. Wentworth. J. Functional Programming, 6(4):621--655, Jul 1996.
  • The Great Computer Language Shootout
    Comparative benchmarks of a number of different languages and compilers, including Haskell with GHC. GHC has often lead the pack, with frequent 1st places in 2006; as of February 2008, it ranks somewhere around 6th or 7th place, with the closely related language Clean ~3 places up.
  • Colin Runciman and David Wakeling (ed.): Applications of Functional Programming, UCL Press, 1995, ISBN 1-85728-377-5 HB.
    From the cover:

    This book is unique in showcasing real, non-trivial applications of functional programming using the Haskell language. It presents state-of-the-art work from the FLARE project and will be an invaluable resource for advanced study, research and implementation.

  • A Comparative Study of Language Support for Generic Programming Ronald Garcia, Jaakko Jrvi, Andrew Lumsdaine, Jeremy G. Siek, and Jeremiah Willcock. In Proceedings of the 2003 ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications (OOPSLA'03), October 2003.
    An interesting comparison of generic programming support across languages, including: Haskell, SML, C++, Java, C#. Haskell supports all constructs described in the paper -- the only language to do so.