Haskell in practice

From HaskellWiki
Jump to navigation Jump to search

Haskell in Practice

Applications written in Haskell

The following free Haskell programs may serve as examples for constructing large applications in Haskell.

Real World Applications of Functional Programming
Includes several large applications written in Haskell (Equational Reasoning Assistant, Mitre Speech Recognition System, the LOLITA Natural Language Processing System, ...).
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.
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 Partial Evaluator
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. It has not yet been optimized for speed, so it runs a little slowly on large projects. 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 and a C++ prettifier.
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.
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.
Micro attribute grammar system
This is a small attribute grammar system written in Haskell. It has been bootstrapped and is now included in the set of modules that is distributed with Doaitse Swierstra's parser combinator library.
A simple action game.
Quake Haskell ;-)
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.

Note that some of the implementations Haskell systems and many of the tools and libraries are written in Haskell as well.

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/ tools and libraries].

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.

  • 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.