Haskell

From RogueBasin
Revision as of 02:40, 14 December 2013 by Mikon (talk | contribs) (typo)
Jump to navigation Jump to search

Background

Haskell began as a research language but has evolved into a platform suitable for general-purpose development. Haskell programs are concise and expressive, minimizing the "semantic gap" between the programmer's intentions and the text of the source code. The most recent revision of the Haskell standard is Haskell 2010.

Haskell is purely functional, meaning that functions, in general, map inputs to outputs, but can not perform side-effects, such as writing to disk. This limitation is comparable to the decision to remove 'GOTO' from most modern programming languages -- it greatly eases the task of proving the correctness of functions.

Haskell libraries provide IO and mutable state using an abstraction called a Monad. A monad is a mathematical concept that captures our intuitive notion of imperative programming.

Haskell is non-strict (often called "lazy"), meaning that it does not initialize data structures in memory until they are specifically needed. For example, it would be possible to perform find-and-replace on a 20GB file represented by a linked list -- only a small working segment of the list would actually exist in RAM at any given time.

The GHC compiler features a rigorous optimization pass so that idiomatic Haskell runs at speeds comparable to C/C++.

Haskell has an advanced type system, featuring abstract data types, parametric polymorphism, type classes (type-indexed functions), associated types (type-indexed types), and existential quantification. Haskell uses type inference to determine the types of values that are not explicitly indicated by the programmer.

Language Characteristics

  • Purely functional
  • Non-strict
  • Static typing
  • Closures
  • Strong semantics for concurrent and parallel programming
  • Platform independence
  • Automatic garbage collection
  • Foreign Function Interface to interoperate with C/C++

Haskell Roguelikes

Related Links