[Haskell-cafe] Haskell Propeganda

Niels Aan de Brugh nielsadb at gmail.com
Mon Aug 25 14:54:46 EDT 2008

Christopher Lane Hinson wrote:
>> Here's an error the Haskell run-time system might throw:
>> *** Exception: Prelude.head: empty list
>> (or whatever)
>> So now what? Action plan = [].
> rgrep " head " .
> Lists 17 items for three projects I've been working on summing to 
> 10000 lines of haskell.  Use listToMaybe or pattern matching and 
> -Wall, and raise an explicit (error "with explanation"), which is all 
> good practice in the C world as well.  Please, don't make undocumented 
> use of partial functions in serious code.
You're absolutely right, and the compiler can warn the programmer for 
such mistakes. However, I've found that analysing the run-time 
behaviour/errors (if they do occur) in a Haskell program to be harder 
than in a language like C(++) which has many very mature engineering 
tools available. No doubt this is a matter of time and money, not which 
language is better suited for "real work".


More information about the Haskell-Cafe mailing list