|Usual file extensions||
|Paradigm||functional, non-strict, modular|
|Designed by||Simon Peyton Jones, Paul Hudak, Philip Wadler, et al.|
|Typing discipline||static, strong, inferred|
|Major implementations||GHC, Hugs, NHC, JHC, Yhc|
|Influenced by||Lisp and Scheme, ISWIM, FP, APL, Hope and Hope+, SISAL, Miranda, ML and Standard ML, Lazy ML, Orwell, Alfl, Id, Ponder|
|Influenced||Agda, Bluespec, Clojure, C#, CAL, Cat, Cayenne, Clean, Curry, Epigram, Escher, F#, Factor, Isabelle, Java Generics, LINQ, Mercury, Omega, Perl 6, Python, Qi, Scala, Timber, Visual Basic 9.0|
Haskell (pronounced [ˈhæskəl]) is a standardized, general-purpose purely functional programming language, with non-strict semantics and strong static typing. It is named after logician Haskell Curry. In Haskell, "a function is a first-class citizen" of the programming language. As a functional programming language, the primary control construct is the function; the language is rooted in the observations of Haskell Curry (1934, 1958,) and his intellectual descendants, that "a proof is a program; the formula it proves is a type for the program".
Following the release of Miranda by Research Software Ltd, in 1985, interest in lazy functional languages grew: by 1987, more than a dozen non-strict, purely functional programming languages existed. Of these, Miranda was the most widely used, but was not in the public domain. At the conference on Functional Programming Languages and Computer Architecture (FPCA '87) in Portland, Oregon, a meeting was held during which participants formed a strong consensus that a committee should be formed to define an open standard for such languages. The committee's purpose was to consolidate the existing functional languages into a common one that would serve as a basis for future research in functional-language design.
The first version of Haskell ("Haskell 1.0") was defined in 1990. The committee's efforts resulted in a series of language definitions.
In late 1997, the series culminated in Haskell 98, intended to specify a stable, minimal, portable version of the language and an accompanying standard library for teaching, and as a base for future extensions. The committee expressly welcomed the creation of extensions and variants of Haskell 98 via adding and incorporating experimental features.
In February 1999, the Haskell 98 language standard was originally published as "The Haskell 98 Report". In January 2003, a revised version was published as "Haskell 98 Language and Libraries: The Revised Report". The language continues to evolve rapidly, with the Glasgow Haskell Compiler (GHC) implementation representing the current de facto standard.
In early 2006, the process of defining a successor to the Haskell 98 standard, informally named Haskell′ ("Haskell Prime"), was begun. This is an ongoing incremental process to revise the language definition, producing a new revision once per year. The first revision, named Haskell 2010, was announced in November 2009.
Haskell features Lazy evaluation, pattern matching, list comprehensions, typeclasses, and type polymorphism. It is a purely functional language, which means that in general, functions in Haskell do not have side effects. There is a distinct type for representing side effects, orthogonal to the type of functions. A pure function may return a side effect which is subsequently executed, modeling the impure functions of other languages.
Haskell has a strong, static, type system based on Hindley-Milner type inference. Haskell's principal innovation in this area is to add type classes, which were originally conceived as a principled way to add overloading to the language, but have since found many more uses.
The type which represents side effects is an example of a monad. Monads are a general framework which can model different kinds of computation, including error handling, nondeterminism, parsing, and software transactional memory. Monads are defined as ordinary datatypes, but Haskell provides some syntactic sugar for their use.
There is an active community around the language, and more than 1700 third-party open-source libraries and tools are available in the online package repository Hackage.
The main implementation of Haskell, GHC, is both an interpreter and native-code compiler that runs on most platforms. GHC is noted for its high-performance implementation of concurrency and parallelism, and for having a rich type system incorporating recent innovations such as generalized algebraic data types and Type Families.
The following is a Hello world program written in Haskell (note that except for the last line all lines can be omitted):
module Main where main :: IO () main = putStrLn "Hello World!"
Here is the factorial function in Haskell, defined in four different ways::
-- using recursion factorial 0 = 1 factorial n = n * factorial (n - 1) -- using lists factorial n = product [1..n] -- using recursion but written without pattern matching factorial n = if n > 0 then n * factorial (n-1) else 1 -- using only prefix notation and n+k-patterns factorial 0 = 1 factorial (n+1) = (*) (n+1) (factorial n)
An efficient implementation of the Fibonacci series, as an infinite sequence, is this:
fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
The following all comply fully, or very nearly, with the Haskell 98 standard, and are distributed under open source licenses. There are currently no proprietary Haskell implementations.
Since January 2007, libraries and applications written in Haskell have been collected on Hackage, an online database of open source Haskell software using Cabal packaging tool. As of March 2010 there are about 1900 packages available.
Haskell is increasingly being used in commercial situations. Audrey Tang's Pugs is an implementation for the long-forthcoming Perl 6 language with an interpreter and compilers that proved useful after just a few months of its writing; similarly, GHC is often a testbed for advanced functional programming features and optimizations. Darcs is a revision control system written in Haskell, with several innovative features. Linspire GNU/Linux chose Haskell for system tools development. Xmonad is a window manager for the X Window System, written entirely in Haskell.
Bluespec SystemVerilog is a language for semiconductor design that is an extension of Haskell. Additionally, Bluespec, Inc.'s tools are implemented in Haskell. Cryptol, a language and toolchain for developing and verifying cryptographic algorithms, is implemented in Haskell. Notably, the first formally verified microkernel, seL4 was developed in Haskell.
A series of languages inspired by Haskell, but with different type systems, have been developed, including:
Other related languages include:
Haskell has served as a testbed for many new ideas in language design. There have been a wide number of Haskell variants produced, exploring new language ideas, including:
Jan-Willem Maessen, in 2002, and Simon Peyton Jones, in 2003, discussed problems associated with lazy evaluation while also acknowledging the theoretical motivation for it, in addition to purely practical considerations such as improved performance. They note that, in addition to adding some performance overhead, laziness makes it more difficult for programmers to reason about the performance of their code (particularly its space usage).
Bastiaan Heeren, Daan Leijen, and Arjan van IJzendoorn in 2003 also observed some stumbling blocks for Haskell learners: "The subtle syntax and sophisticated type system of Haskell are a double edged sword — highly appreciated by experienced programmers but also a source of frustration among beginners, since the generality of Haskell often leads to cryptic error messages." To address these, they developed an advanced interpreter called Helium which improved the user-friendliness of error messages by limiting the generality of some Haskell features, and in particular removing support for type classes.
The Haskell community meets regularly for research and development activities. The primary events are:
Since 2007 there has been a series of organized "hackathons"—the Hac series—aimed at improving the programming language tools and libraries:
Since 2005, a growing number of Haskell User Groups have formed, in the United States, Canada, Australia, South America, Europe and Asia.
|Look up haskell in Wiktionary, the free dictionary.|
Haskell may refer to:
Haskell is one of several locations in the United States:
Haskell is a surname:
Haskell is a given name:
| This disambiguation page lists articles associated with the same title.
If an internal link led you here, you may wish to change the link to point directly to the intended article.
This page was created, but so far, little content has been added. Everyone is invited to help expand and create educational content for Wikiversity. If you need help learning how to add content, see the editing tutorial and the MediaWiki syntax reference.
To help you get started with content, we have automatically added references below to other Wikimedia Foundation projects. This will help you find materials such as information, media and quotations on which to base the development of "Haskell" as an educational resource. However, please do not simply copy-and-paste large chunks from other projects. You can also use the links in the blue box to help you classify this page by subject, educational level and resource type.
Hello, and welcome to the future home of the Haskell Computer Programming Course. We will be learning about the Haskell programming language.
All contributions are appreciated. Even newcomers are welcome to make changes, remember Be bold !