Haskell Language

Haskell is a purely Functional Programming Language using Non Strict Semantics (typically implemented as Lazy Evaluation) and a polymorphic type system (an extension of the classical Hindley Milner Type Inference algorithm). It was named after Haskell Curry.

Some nice features:

Functions can be defined by Pattern Matching, as in several other functional languages.

List Comprehensions provide a nice way to write mapping and filtering operations.

Syntactic support for a simple variety of Literate Programming.

You can define your own infix operators.

Type Classes allow the introduction of overloaded functions.

Readily available package system, Hackage Db (hackage.haskell.org ) and user-side tool 'cabal', with thousands of open-source packages.

Indentation-sensitive syntax and curly brace syntax are both possible, depending on your preference.

I/O is done via monads (see On Monads). Monads (which have far wider applications than just I/O) are hard for some to grasp, but there are a lot of good tutorials right now on the net that deal with them. A good place to start is www.haskell.org .


Implementation


Books


David Mertz has a small tutorial on Haskell (gnosis.cx ).


Jim Bender maintains a growing "Online Bibliography of Haskell Research" at haskell.readscheme.org that references many research papers about monads and their even more abstract and scary generalization, arrows. Haskell Arrows were introduced by John Hughes and are also explained at www.haskell.org .


In "Wearing the hair shirt: a retrospective on Haskell" (2003, available as a set of Power Point slides at www.research.microsoft.com ) Simon Peyton Jones provides an overview of the (rather short) history of Haskell. He concludes that Lazy Evaluation is rather less important than one might think while purity and type classes and monads are essential. "Our biggest mistake: using the scary term 'Monad' rather than 'Warm Fuzzy Thing' "


Haskell now has its very own International Obfuscated Code Contest (see www.ScannedInAvian.org ).

Broken Link as of 16 February 2010, but available through Wayback Machine at web.archive.org .

And its very own Lambdacats site (see arcanux.org ).


See Quick Sort In Haskell for a short example of Haskell code. See The Evolution Ofa Haskell Programmer for some more examples.


Some people are running the Language Of The Year project over on the Pragmatic Programmer mailing list and chose Haskell as Language Of The Year 2002. Check it out: groups.yahoo.com .


Q IBM article In 2001 (www-106.ibm.com ) advocated use of Haskell Language based Ha Xml to overcome the limitations of XML processing tools. Is his idea a flash in the pan? Are there better alternatives to DOM/SAX/XSLT?

A The combinators of Ha Xml are designed to do about the same thing as XSLT. However, have you ever tried using XSLT? Anything that does the same will be simpler and easier to use. Ha Xml, being embedded in Haskell gives the full power of a programming language on top of the easy XML transformations. Another popular Haskell XML library is HXT, which is also notable in that one way to use it is through its arrow-based API.

Q Is there a good IDE usable for Haskell under Windows?

A www.haskell.org (mentions hIDE and jCreator)

I've also heard of editor support in jEdit, Eclipse, and some other editors. I'm mostly happy with the haskell-mode in Emacs.

See also www.haskell.org for a Haskell plugin for Visual Studio (not to be confused with a similar project at www.cin.ufpe.br ). This plugin ties directly into the GHC compiler, providing all of the usual VS features like syntax highlighting and name completion, but it also goes a step further. If the plugin doesn't squiggly-highlight any code in your program, it is guaranteed to compile with GHC. -- Michael Sparks


I love Haskell mostly for the elegant and beautiful syntax you get when doing Point Free Programming. However, Haskell's strict FP discipline and affinity for abstruse concepts like Arrows really hurts when trying to put together quick scripts, or when just hacking for fun. Are there other languages that support the inline . and $ operators or other syntax like it? I just can't go back to (compose #'foo #'bar) after getting used to foo . bar, to say nothing of all the fun with the $ operator in avoiding needless parenthesis.

You might find Concatenative Languages interesting, such as Forth Language, Joy Language, or Factor Language. Unlike Applicative Languages, juxtaposition of symbols indicates a composition operation (e.g., A B means to compute A first, then compute B on A's results; this is equivalent to B $ A or B . A in Haskell, depending on your precise context). -- Samuel Falvo


Sounds like it isn't a Real Programming Language

... I suppose I can't hold my breath on that, since to get point-free programming, I also need automatic currying, which I've only seen in Ml Languages. I suppose I can live with Sml Language and the 'o' operator, but no $ operator I'm aware of.

Abstruse concepts? I have a whole book about abstruse concepts sitting on my shelf, only it's imported from that other, backwards world, where functions are only known as methods and abstruse concepts are sold as Design Patterns, where the capital letters apparently enchant them into something desirable... Really, compared to Rube Goldberg Devices like Visitor, Arrows and Monads are astonishingly simple. Perhaps that's why imperative programmers distrust these powerful structures.

Monads rhymes with..

That would make a nice T-shirt: "I have the GONADS to work with MONADS."


With languages with pervasive effects such as C, you need machinery such as Hoare logic to handle proofs about programs. One of the benefits of Haskell's purity is that its expressions are already in the right form for traditional mathematical proof. You can even use Haskell functions in specifications because they are pure.


The Lindows Os folks have apparently standardized on Haskell for core operating system development. See urchin.earth.li


A useful reference to details of Haskell is at www.zvon.org



See original on c2.com