Haskell
Appeared in | 1990 |
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 | Common Lisp and Scheme, ISWIM, FP, APL, Hope and Hope+, SISAL, Miranda, ML and Standard ML, Lazy ML, Orwell, Alfl, Id, Ponder |
Influenced | 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 |
Website | http://www.haskell.org/ |
Quoting from Wikipedia:
Haskell is a standardized, general-purpose purely functional programming language, with non-strict semantics and strong static typing.
Haskell is a large, complex language, with several standardised versions, and many non-standard extensions. It shares many features in common with imperative languages, and other functional languages, as well as having a number of unique language features. The primary characteristics are:
- By-default referential transparency ("purity"),
- By-default lazy evaluation,
- A static type system based on System F,
- Optionally whitespace-sensitive syntax,
- Algebraic data types,
- Pattern matching on data,
- Type classes,
- Obiquitous use of currying
- Syntax for list comprehensions, guards, etc.
In our own words, some of the major advantages of using Haskell are listed below.
- Developing software with Haskell takes less time and effort compared to imperative programming languages1. The written code is easier to understand thanks to high-level abstractions and functions in Haskell.
- Haskell is purely functional, i.e., functions have no side effects. This leads to bug-free (and headache-free) programming.
- Haskell's built-in parallelism and concurrency is an inherent result of its purity. This a silver bullet to the problem of multiprocessor and multicore architectures.
- Haskell is expressive; it lets you express algorithms easily and in the way you actually think about them.
- Haskell uses lazy evaluation. Only Miranda (and a few other even less well-known languages) use lazy evaluation by default. This is one of the most important reasons why Haskell scores quite well in various programming benchmarks, despite being fairly new and high-level.
Reference Resources
Books
- Real World Haskell is the bible of Haskell and freely available online.
- Programming in Haskell is a good book covering basics while giving a simple mathematical background about Haskell.
- See Purely Functional Data Structures book by Chris Okasaki, which is also freely available online.
- The Haskell Road to Logic, Maths and Programming is a good introduction to foundations of mathematics and discrete math using Haskell.
- List of Haskell books at HaskellWiki.
- For absolute beginners: Learn You A Haskell For Great Good, simple, friendly and humorous.
Other Resources
- Watch Haskell videos on Vimeo Haskell channel.
- Comments on Haskell in Great Computer Language Shootout by Brent Fulgham, the organizer of the shootout.
- Official Haskell Package Database: HackageDB.
- Write Yourself a Scheme in 48 Hours tutorial by Jonathan Tang.
- Parallel Programming in Haskell: A Reading List by Don Stewart.
- Haskell research papers
- Functional Programming Fundamentals video lectures of Dr. Erik Meijer at Channel 9. (13 video lectures are waiting for you there!)
Communities
- See official HaskellWiki for various information on mailing-lists, IRC channels, blog planets, etc.
- Google interface to USENET comp.lang.haskell and comp.lang.functional groups.
- Reddit (A social news website on which users can post links to content on the Internet.) Haskell channel.
Editors
- For emacs, see haskell-mode.
- Pretty Lambda mode displays lambda character in emacs.
- leksah is an editor written in Haskell with Haskell candy.
- Eclipse Functional Programming Plug-In: eclipsefp.
- See What are my IDE/Editor choices for Haskell? thread at StackOverflow.
Editor Tweaks: Emacs
You will need haskell-mode and hpaste.el under your ~/elisp directory to be able to run below commands.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Haskell Mode Configuration
;;;
(define-key haskell-mode-map (kbd "C-c a r") 'align-regexp)
(add-to-list 'load-path "~/elisp/haskell-mode")
(require 'haskell-mode)
(require 'inf-haskell)
(add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
(setq auto-mode-alist
(append auto-mode-alist
'(("\\.[hg]s$" . haskell-mode)
("\\.hi$" . haskell-mode)
("\\.l[hg]s$" . literate-haskell-mode))))
(autoload 'haskell-mode "haskell-mode"
"Major mode for editing Haskell scripts." t)
(autoload 'literate-haskell-mode "haskell-mode"
"Major mode for editing literate Haskell scripts." t)
;;; hpaste.el
(add-to-list 'load-path "~/elisp")
(require 'hpaste)
;;; Hayoo & Hoogle
(defun haskell-hayoo (keyword)
(interactive (list (read-from-minibuffer "Keyword: " (word-at-point))))
(browse-url
(format
"http://holumbus.fh-wedel.de/hayoo/hayoo.html?query=%s&start"
keyword)))
(define-key haskell-mode-map (kbd "C-c d y") 'haskell-hayoo)
(define-key haskell-mode-map (kbd "C-c d g") 'haskell-hoogle)
page revision: 22, last edited: 03 Dec 2009 14:32