News for hackers. Stuff that matters.
Re:What it's like to use Haskell by delluminatus on Wednesday March 26, 2014 @09:39AM (#7473225)
Those are pattern matches [1]. In Haskell, you have a very powerful pattern matching system for describing and deconstructing function arguments. So quicksort here is defined as

    quicksort [] = []
    quicksort (p:xs) = ...
The first pattern, [], matches an empty list. The second pattern, (p:xs), matches a list of length 1 or greater, and binds the first element of the list to the variable p, and the rest of the list to the variable xs. In other words, p is the head, xs is the tail. Note that in the case of a 1-element list, the tail will be empty.

This is a valid pattern match because AFAIK the colon (:) is a type constructor in Haskell, and it's used to create lists. For instance, 1 : [] == [1], and 1 : 2 : [3, 4] = [1, 2, 3, 4].

Because (:) is a type constructor, and not an operator (unlike (+) for instance), you can use it in pattern matching expressions to deconstruct lists. This is quite useful for many things, as you might imagine.

[1]: https://en.wikibooks.org/wiki/Haskell/Pattern_matching

Re:What it's like to use Haskell by hikarudo on Wednesday March 26, 2014 @09:46AM (#7473268)
(:) is a data constructor, not a type constructor, and its type is a -> [a] -> [a]. Examples of type constructors: [], Maybe, Either.
Re:What it's like to use Haskell by sold on Wednesday March 26, 2014 @01:56PM (#7475084)
To be clear: [] can refer to two different entities, a data constructor (empty list) and a type constructor (the list type).
Re:What it's like to use Haskell by delluminatus on Wednesday March 26, 2014 @11:46AM (#7474194)
Thanks for the clarification. You might be able to tell, that I am only in the first stages of trying to learn Haskell.