|
![](/i/fill.gif) |
Warp wrote:
> You seriously claiming that if you make a typo in Haskell, it always
> magically knows that and gives you an error message?
What's magic?
If you type something wrong, it might be a syntax error. (Any
half-decent compiler will catch these.) If you type the wrong name by
mistake, it's probably a type error. If you assume that a certain list
will always contain 3 items (for example) and actually it doesn't,
you'll get an exception when you try to access a non-existent element.
It's not *guaranteed* that all mistakes will be caught. If you
accidentally write "x + x" instead of "x + y", no error (just the wrong
result). Same as any other language.
Let's look at this the other way around: There is no typo you can
possibly make which will result in a segfault. (Unless you're doing
something *very* special, like calling an external C routine or
something.) About the worst that can happen is that your program eats
craploads of RAM or goes into an infinite loop. (Or, if you're using
explicit concurrency with locks, you might deadlock or something.)
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
![](/i/fill.gif) |