Motivation to Learn Haskell

Dear All, It is my first post to this list and please do not take it as an attempt to start any flamewar. From time to time, I try to find the motivation to learn at least the fundamentals of another programming language. I normally use R and Python on a daily basis (but I am not that much into OO programming) and have a good knowledge of Fortran and a rather superficial one of C. Beside learning a new language as a sort of mind expanding exercise, I try to figure out how and if it can save me some time in my work and how it measures up against other languages. These days I tend to rely on R for data analysis and visualization whereas I use Python (in particular Numpy+SciPy) for number crunching (it is very convenient to use scipy/numpy to solve ODE's, manipulate arrays and so on). Now, I wonder what benefit I would gain from learning Haskell since I mainly write codes for numerical simulations/data analysis. I know Haskell is gaining momentum e.g. in the financial environment (I happened to see Haskell knowledge as a specification in some quant jobs) hence it must be more than suitable for numerical work and, by the little I have understood so far, it allows one to write code really resembling mathematical expressions (I was impressed by guards and curried functions). However, it also looks to me (correct me if I am mistaken) that Haskell is a far cry from the wealth of standard and contributed scientific modules you have in Python or R and thanks to which you do not re-implement the wheel yourself. Any thoughts/suggestions are really appreciated. Cheers Lorenzo

From time to time, I try to find the motivation to learn at least the fundamentals of another programming language. I normally use R and Python on a daily basis (but I am not that much into OO
You might find this discussion started by a skeptic interesting (I did):
http://www.reddit.com/r/haskell/comments/cs54i/how_would_you_write_du_in_has...
The topic is different, but the responses tell me:
- Lots of library code that I expect to be written already doesn't exist for
Haskell.
- This isn't so bad as the code you have write is relatively succinct.
- You still have to write the missing code. Which sucks (tm).
I'm using Haskell for lots of one-off data processing. It is generally quick to
develop. It generally yields type errors rather than gibberish when I write
something stupid in my code. I recommend it. But I've never used SciPy so I
can't comment on the relative depth of the libraries.
With all that said, there are are libraries with the obvious statistical
methods:
http://hackage.haskell.org/package/#cat:statistics
http://hackage.haskell.org/package/statistics
http://hackage.haskell.org/packages/archive/hstats/0.3/doc/html/Math-Statist...
If you do jump in, I'd recommend the Real World Haskell book or the The Haskell
School of Expression book.
Good luck,
Tim
----- Original Message ----
From: Lorenzo Isella

Tim Perry
If you do jump in, I'd recommend the Real World Haskell book or the The Haskell School of Expression book.
Another interesting title is _Programming in Haskell,_ by Graham Hutton (see http://www.cs.nott.ac.uk/~gmh/book.html). Duncan Coutts has written a review on the title (see http://www.cs.nott.ac.uk/~gmh/book-review.pdf). As for motivation for learning Haskell, one motivator is the purely functional nature of the language, which is referentially transparent and therefore facilitates reasoning about programs. Haskell has roots in category theory, and therefore, it is frequently possible to use category-theoretical reasoning to reason about the correctness of programs; this cannot be said of most other programming languages. -- Benjamin L. Russell
Good luck, Tim
----- Original Message ---- From: Lorenzo Isella
To: beginners@haskell.org Sent: Fri, September 3, 2010 3:57:26 PM Subject: [Haskell-beginners] Motivation to Learn Haskell From time to time, I try to find the motivation to learn at least the fundamentals of another programming language. I normally use R and Python on a daily basis (but I am not that much into OO
Dear All, It is my first post to this list and please do not take it as an attempt to start any flamewar. programming) and have a good knowledge of Fortran and a rather superficial one of C. Beside learning a new language as a sort of mind expanding exercise, I try to figure out how and if it can save me some time in my work and how it measures up against other languages. These days I tend to rely on R for data analysis and visualization whereas I use Python (in particular Numpy+SciPy) for number crunching (it is very convenient to use scipy/numpy to solve ODE's, manipulate arrays and so on). Now, I wonder what benefit I would gain from learning Haskell since I mainly write codes for numerical simulations/data analysis. I know Haskell is gaining momentum e.g. in the financial environment (I happened to see Haskell knowledge as a specification in some quant jobs) hence it must be more than suitable for numerical work and, by the little I have understood so far, it allows one to write code really resembling mathematical expressions (I was impressed by guards and curried functions). However, it also looks to me (correct me if I am mistaken) that Haskell is a far cry from the wealth of standard and contributed scientific modules you have in Python or R and thanks to which you do not re-implement the wheel yourself. Any thoughts/suggestions are really appreciated. Cheers
Lorenzo _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
-- Benjamin L. Russell / DekuDekuplex at Yahoo dot com http://dekudekuplex.wordpress.com/ Translator/Interpreter / Mobile: +011 81 80-3603-6725 "Furuike ya, kawazu tobikomu mizu no oto." -- Matsuo Basho^

My tuppence worth is the wonderful conciseness of programs, the way
abstraction works, it almost forces you into creating simple very testable
functions. These functions will have a well defined uncomplicated
transformation, and as such may be re-used to build more complex functions.
As a beginner, the templtation is to resist the temptation to implemrnt
imperative code, but to link functions together in my thinking like a shell
script. With a shell script programs are stated left to right with the
output of the leftmost being fed into the next one to the right. I think
with Haskell on a similar pattern with a pipeline of functions feed from the
right-most one. The next thing is to learn associativity rules and the use
of parenthesis, and $ operators.
Read everything on www.haskell.org.
Confuse yourself by trying to read Prelude source code!
--
Andrew Edinburgh,Scotland
On 4 September 2010 01:30, Benjamin L. Russell
Tim Perry
writes: If you do jump in, I'd recommend the Real World Haskell book or the The Haskell School of Expression book.
Another interesting title is _Programming in Haskell,_ by Graham Hutton (see http://www.cs.nott.ac.uk/~gmh/book.htmlhttp://www.cs.nott.ac.uk/%7Egmh/book.html). Duncan Coutts has written a review on the title (see http://www.cs.nott.ac.uk/~gmh/book-review.pdfhttp://www.cs.nott.ac.uk/%7Egmh/book-review.pdf ).
As for motivation for learning Haskell, one motivator is the purely functional nature of the language, which is referentially transparent and therefore facilitates reasoning about programs. Haskell has roots in category theory, and therefore, it is frequently possible to use category-theoretical reasoning to reason about the correctness of programs; this cannot be said of most other programming languages.
-- Benjamin L. Russell
Good luck, Tim
----- Original Message ---- From: Lorenzo Isella
To: beginners@haskell.org Sent: Fri, September 3, 2010 3:57:26 PM Subject: [Haskell-beginners] Motivation to Learn Haskell Dear All, It is my first post to this list and please do not take it as an attempt
From time to time, I try to find the motivation to learn at least the fundamentals of another programming language. I normally use R and Python on a daily basis (but I am not that much into OO
start any flamewar. programming) and have a good knowledge of Fortran and a rather superficial one of C. Beside learning a new language as a sort of mind expanding exercise, I
figure out how and if it can save me some time in my work and how it measures up against other languages. These days I tend to rely on R for data analysis and visualization whereas I use Python (in particular Numpy+SciPy) for number crunching (it is very convenient to use scipy/numpy to solve ODE's, manipulate arrays and so on). Now, I wonder what benefit I would gain from learning Haskell since I
to try to mainly
write codes for numerical simulations/data analysis. I know Haskell is gaining momentum e.g. in the financial environment (I happened to see Haskell knowledge as a specification in some quant jobs) hence it must be more than suitable for numerical work and, by the little I have understood so far, it allows one to write code really resembling mathematical expressions (I was impressed by guards and curried functions). However, it also looks to me (correct me if I am mistaken) that Haskell is a far cry from the wealth of standard and contributed scientific modules you have in Python or R and thanks to which you do not re-implement the wheel yourself. Any thoughts/suggestions are really appreciated. Cheers
Lorenzo _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
-- Benjamin L. Russell / DekuDekuplex at Yahoo dot com http://dekudekuplex.wordpress.com/ Translator/Interpreter / Mobile: +011 81 80-3603-6725 "Furuike ya, kawazu tobikomu mizu no oto." -- Matsuo Basho^
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

I have explored the possibility of making this switch (numpy/scipy ->
Haskell) occasionally (aka - not VERY thoroughly), but a big hindrance
is Haskell's lack of a matplotlib equivalent.
LAPACK/ODE and cousins are comparatively easier to tackle using the C
FFI. But even there, absence of a SWIG module for Haskell is
inconvenient. SWIG alternatives for haskell might exist, but they
aren't as useful as SWIG for many reasons.
On Sat, Sep 4, 2010 at 4:27 AM, Lorenzo Isella
Dear All, It is my first post to this list and please do not take it as an attempt to start any flamewar. From time to time, I try to find the motivation to learn at least the fundamentals of another programming language. I normally use R and Python on a daily basis (but I am not that much into OO programming) and have a good knowledge of Fortran and a rather superficial one of C. Beside learning a new language as a sort of mind expanding exercise, I try to figure out how and if it can save me some time in my work and how it measures up against other languages. These days I tend to rely on R for data analysis and visualization whereas I use Python (in particular Numpy+SciPy) for number crunching (it is very convenient to use scipy/numpy to solve ODE's, manipulate arrays and so on). Now, I wonder what benefit I would gain from learning Haskell since I mainly write codes for numerical simulations/data analysis. I know Haskell is gaining momentum e.g. in the financial environment (I happened to see Haskell knowledge as a specification in some quant jobs) hence it must be more than suitable for numerical work and, by the little I have understood so far, it allows one to write code really resembling mathematical expressions (I was impressed by guards and curried functions). However, it also looks to me (correct me if I am mistaken) that Haskell is a far cry from the wealth of standard and contributed scientific modules you have in Python or R and thanks to which you do not re-implement the wheel yourself. Any thoughts/suggestions are really appreciated. Cheers
Lorenzo _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
-- Rohit Garg http://rpg-314.blogspot.com/

I think the financial industry is attracted to Haskell because it's lazy. (ba-dum dum!) I'm in a similar spot as you are, and I'm making a second or third attempt to get a handle on Haskell (depending on how you count). I'm doing it for much the same reasons you are, and for similar applications. In my case, most of the simulation work is done in Matlab, and partially in C. C is undisciplined and error prone, which makes it slow to develop simulations in, and which is why people tend towards Matlab. Matlab is much slower, and has the unfortunate tendency to treat everything in the world as though it were linear algebra-- but it's relatively rapid for development. I've dropped my pursuit of Haskell a couple times after a few days each time for the reasons you're alluding to (and because the type system hurts my head), but I'm back at it again because it feels like there's something of value in it. In part, it feels more elegant-- in the same way that Scheme felt elegant (hey, don't judge me...). In particular, lazy-functional seems like a really good match for simulation work: it feels right to represent the world as f(t) and to feed it time as an infinite list rather that write a loop that basically says "while the world hasn't ended, do:". It also holds the promise of straight-forward parallelization which is critical for anything requiring performance on a modern platform. I haven't worked with R, so I can't comment on it, but for me Haskell is different enough from the other languages I work with that it forces me to (which I hope later means "allows me to") look at problems differently. I think that's what you mean by a mind expanding exercise, and it's a benefit I found in learning C++ after C, but not a benefit I found in learning Python after C++ because they're just too similar in concept. There is quite a wealth of libraries available through the hackage system, but I'm choosing to treat the lack of established libraries in some areas as an opportunity-- I find writing algorithms I'm familiar with is a great way to get comfortable. Once I know more of what I'm doing, I'll probably start pulling in more established packages just for their better optimized implementations and for compatibility reasons. Cheers-- Greg On Sep 3, 2010, at 3:57 PM, Lorenzo Isella wrote:
Dear All, It is my first post to this list and please do not take it as an attempt to start any flamewar. From time to time, I try to find the motivation to learn at least the fundamentals of another programming language. I normally use R and Python on a daily basis (but I am not that much into OO programming) and have a good knowledge of Fortran and a rather superficial one of C. Beside learning a new language as a sort of mind expanding exercise, I try to figure out how and if it can save me some time in my work and how it measures up against other languages. These days I tend to rely on R for data analysis and visualization whereas I use Python (in particular Numpy+SciPy) for number crunching (it is very convenient to use scipy/numpy to solve ODE's, manipulate arrays and so on). Now, I wonder what benefit I would gain from learning Haskell since I mainly write codes for numerical simulations/data analysis. I know Haskell is gaining momentum e.g. in the financial environment (I happened to see Haskell knowledge as a specification in some quant jobs) hence it must be more than suitable for numerical work and, by the little I have understood so far, it allows one to write code really resembling mathematical expressions (I was impressed by guards and curried functions). However, it also looks to me (correct me if I am mistaken) that Haskell is a far cry from the wealth of standard and contributed scientific modules you have in Python or R and thanks to which you do not re-implement the wheel yourself. Any thoughts/suggestions are really appreciated. Cheers
Lorenzo _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
participants (6)
-
A Smith
-
DekuDekuplex@Yahoo.com
-
Greg
-
Lorenzo Isella
-
Rohit Garg
-
Tim Perry