Haskell /ˈhæskəl/[27] is a standardized, general-purpose purely functional programming language, with non-strict semantics and strong static typing.[28] It is named after logician Haskell Curry.[1] The latest standard of Haskell is Haskell 2010. As of May 2016, a group is working on the next version, Haskell 2020.[29]
Haskell features a type system with type inference[30] and lazy evaluation.[31] Type classes first appeared in the Haskell programming language.[32] Its main implementation is the Glasgow Haskell Compiler.
Haskell is based on the semantics, but not the syntax, of the language Miranda, which served to focus the efforts of the initial Haskell working group.[33] Haskell is used widely in academia[34][35] and also used in industry.[36]
Features
Haskell features lazy evaluation, pattern matching, list comprehension, type classes, and type polymorphism. It is a purely functional language, which means that in general, functions in Haskell have no side effects. A distinct construct exists to represent 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, originally conceived as a principled way to add overloading to the language,[40] but since finding many more uses.[41]
The construct 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.
Haskell has an open, published specification,[28] and multiple implementations exist. Its main implementation, the Glasgow Haskell Compiler (GHC), is both an interpreter and native-codecompiler that runs on most platforms. GHC is noted for its high-performance implementation of concurrency and parallelism,[42] and for having a rich type system incorporating recent innovations such as generalized algebraic data types and type families.
A growing active community exists around the language, and more than 5,400 third-party open-source libraries and tools are available in the online package repository Hackage.[43]
No comments:
Post a Comment