[Haskell] Newbie: what are the advantages of Haskell?

Udo Stenzel u.stenzel at web.de
Sat Apr 28 11:17:20 EDT 2007


phiroc at free.fr wrote:
> what are the advantages of haskell over semi-functional programming languages
> such as Perl, Common Lisp, etc.?

A fundamental building block that is superior in maintainability and
reusability to objects and procedures, a type system that is actually of
help and not a hindrance, and mathematical purity.


> What are the mysterious "side effects" which are avoided by using Haskell, which
> everyone talks about? Null pointers?

Side effects are changes made to the environment by a procedure (beyond
returning its result), particularly those that you forgot about, that
get executed in the wrong order, and that change values under your feet
when you least expect it.

 
> Don't you ever get null pointers in Haskell, including when doing IO?

What's a pointer?  But we do get bottoms sometimes (rarely, the type
system often prevents you from stumbling over them), which is simply the
price you have to pay if you want a Turing-complete system.


> Aren't Haskell's advantages outweighed by its complexity (Monads, etc.) and
> rigidity?

You know about Design Patterns?  *Those* are complex.  Dozens of
Rube-Goldberg-Machines designed to circumvent inadequacies in languages
that should have been abandoned 20 years ago.  

If you try to apply the Design Patterns book to Haskell, half of the
patterns vanish, because they solve non-problems, most of the rest
becomes much simpler and only a few are added.  One particularly simple
new pattern is the Monad, which the gang of four couldn't discover for
lack of a language powerful enough to express it.  (Monad easily
subsumes Composite, generalizing and simplifying it in the process.  The
application of Monad to IO is straight forward, and then Monad also
subsumes Command.)

Btw, there's nothing rigid about Haskell.  I can adapt my Haskell code
much quicker to new requirements than is possible with either C or Perl,
and the Haskell code has the added benefit of still working after the
change.

 
> Last but not least, I would like to learn from those among you who are former
> PERL developers, why you switched to Haskell.

Because Perl is a royal PITA and Haskell is not.  Haskell also has no
inclination to yell "ARRAY(0xdeadbeef)" or "no method 5 in package
FooImpl" at me instead of producing sensible output (see also: type
system).


-Udo
-- 
I can ALWAYS build faster code if it doesn't have to work. (unknown source)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell/attachments/20070428/f2277948/attachment.bin


More information about the Haskell mailing list