[Haskell-beginners] Re: Is Haskell for me?
mauricio.antunes at gmail.com
Fri Nov 6 10:28:41 EST 2009
> - how could I program something like this in Haskell: ..
> generate random population
Since Haskell is a "pure" language, after you attribute a value
to a variable they are glued together forever. So, the language
itself can't have such a thing as a random number. (Here, someone
with technical knowledge will probably correct me, but you get
the poing.) Dealing with this (and other "outside world" stuff)
requires learning how to deal with a special type construct
called "Monad". It's the major step you will have to as a Haskell
begginer. It's, though, extremely interesting, and extremely
powerfull after you understand it.
> - Although I always liked math, I no longer have the knowledge
> I used to have several years ago. Is this important to help
> program in this funcional language?
No. But if you like math, you're probably going to find links to
really interesting math while you learn.
> (...) is it easy to connect it to a Python (or C) library?
To C libraries the answer is yes. Actually, if I want to do C, I
prefer to do it in Haskell :) A friend of mine, who uses neural
networks in his MSc work, was impressed that in half an hour I
could get better results using a low-level binding from libfann to
Haskell (link below) than his own hand written code.
> - Is code easily reusable in different future projects? Since it
> has no objects... how can it be done?
Yes, to a point you may find too radical at first. Even the most
basic constructs are usually combinations of other pieces. After
some time, you will start any code you write by searching pieces
to join together instead of writing everything yourself. It is,
though, usually easier to write code from scratch in Haskell than
reuse code in imperative languages :)
Biased opinions, of course, but I hope they help. Best,
More information about the Beginners