
Stanford CS240h, Functional Systems in Haskell - rohshall
https://github.com/bos/stanford-cs240h
======
dmmalam
When I was at student at Imperial College, London, programming 1 was all
taught in Haskell <http://www.doc.ic.ac.uk/teaching/coursedetails/120.1>

It seemed like a silly idea then, but in hindsight was a genius move. It
normalised the class (prior knowledge in a real didn't matter), and taught
programming from first principles. Picking up new languages after this was
significancy easier.

~~~
rohshall
You are lucky. For first 8 years of my software career, I did not know
anything other than C-based languages (except Lisp). Haskell made me realize
what 'real' computer science is.

------
pav3l
I am not a computer scientist by training. Can someone experienced in Haskell
convince me why I should take time to learn it? I do tons of
technical/statistical computing (python, Matlab, R) and some web-based
projects (database driven mostly). Having math background I can see how FP is
elegant and sexy, but what are real practical advantages over OOP or Matlab-
style programming?

~~~
rauljara
I've tried a few times to learn Haskell, but always tend to lose steam. Last
time I got as far as monads before petering out. So I am definitely not a
great person to try explaining the practical benefits of Haskell programming,
because I've never written anything more complicated than a moderately
difficult project euler solution.

However, despite never actually reaching escape velocity with the language, I
don't feel like I've wasted any time at all. It's made me a much better
programmer. The restrictions that the language places on you (e.g., the
inability to change a value once you declare it) forces you to really grapple
with functional principles.

As a result, I am so much better at reasoning recursively, and figuring out
how to compose functions, that I hardly believe it. As a ruby programmer, I
thought I understood recursion. I thought I understood higher order functions.
And I did. But at such a basic level that I had no idea how basic my
understanding was. Haskell totally opened my eyes.

So, imho, even if you never use haskell, even if you never even fully learn
it, the attempt will almost certainly make you a better programmer. Unless, of
course, you've been already messing around with one of the other nearly pure
functional programming languages out there.

~~~
Ixiaus
It took 3-4 years of learning Erlang and Scheme first before I could fully
grok Haskell concepts. Monads aren't as bad as you think they are, read this
if you haven't: <http://ertes.de/articles/monads.html>

Haskell's strengths: it's succinct, safe, feature-rich, and compiles to fast
programs.

* Succinct: due to Haskell's strong focus on mathematical abstraction (I may be abusing that term here) it makes reasoning about programs easier on a general level - if you get the general case right then any potential problem that fits it will be solved by it. Succinctness also makes writing the code much faster (it's kind of like escape velocity with Emacs - takes a while to get a reasonable map down in your head, but once you do you're 5-10x more productive than you were before). * Safe: this one's obvious - Haskell's type system is brilliant in every way and paired with flymake for haskell can make writing robust code _very_ straightforward. * Feature-rich: lots of libraries, native support for multi-processor/multi-core concurrency - I'm still waiting on something like OTP for Haskell though; Erlang takes the cake there simple because of OTP. * It's _fast_ too; granted you have to be careful to not let non-strictness bite you in the ass, but that's generally very easy to profile and nail down if you can't.

I love Haskell, I use Erlang at my startup and I'm working on some big
personal projects in Haskell.

~~~
surrealize
> I'm still waiting on something like OTP for Haskell though; Erlang takes the
> cake there simple because of OTP

Have you looked at cloud haskell? e.g.,
<http://www.haskell.org/haskellwiki/Cloud_Haskell>

It's still a work in progress, but it's aimed at some of the same distributed
use cases as OTP (AFAIK--I know relatively little about OTP).

------
krat0sprakhar
Is it just me or does anyone else always feels overwhelmed reading the project
suggestions? I find the projects listed to be extremely challenging. Project
suggestions - <http://www.scs.stanford.edu/11au-cs240h/labs/project.html>

~~~
gwern
I was amused at these suggestions:

> You could implement a 'bot that executes untrusted code along the lines of
> Lambdabot. Lambdabot was written before Haskell was typesafe, and as a
> result is fairly hairy code and very limited in functionality. Using type
> safety you ought to be able to achieve something much cleaner and simpler,
> and that provides far more functionality. > Implement some sort of end-user
> programmable web-site (like Wikipedia, but for code rather than for
> information). > Implement an online Haskell REPL environment such as Try
> Haskll. Using Safe Haskell and some of the recent support in GHC 7.3 for
> data declarations in GHCi you should be able to provide a far more powerful
> feature set then existing websites.

Try that, and you'll discover that much of the complexity in
lambdabot/mueval/tryhaskell-mueval-fork is due to stuff that Safe Haskell
won't help with! eg. good luck dealing with 'let x = x + 1 in x'

------
metaguri
To my dismay CS240h was not offered again this year, probably because David
Mazieres is teaching CS140 (Operating Systems) instead.

------
rohshall
I went through the notes. They are concise, but not too concise. A nice
tutorial for people who already know the basics.
<http://www.scs.stanford.edu/11au-cs240h/notes/>

------
Toshio
At first I thought "Oh wow, video lectures a la Coursera, awesome",
unfortunately these are just written materials.

I'm a little surprised at how little love FP gets at the Courseras, EDXs and
Udacities of the world. The only thing that's going on at the moment is Martin
Odersky's FP principles in Scala.

~~~
nightowl03d
That is funny, every time I see a course with a bunch of video lectures and no
notes and reading list I move on. My strong preference for on-line learning is
a reading list, ideally spread between no more than 3 or 4 books, a syllabus,
and list of exercises.

If there are videos I listen to them while I am doing the homework associated
with the video, but usually I get the homework done before the video finishes.

Disclaimer: I can probably get away with this because I already have a PhD and
so I have a lot of practice in learning things

~~~
dlo
It's really cool how you're able to complete homework while you're watching
video. Can you get into more detail about how you're able to do this?

My roadblocks to doing this would be that I wouldn't be able to pay attention
to what's going on while thinking about a homework problem, that some things
need to turn over in my head before I understand it at the level needed to
apply it, and that solutions often take a long time to type up, especially
proofs and programming assignments.

~~~
nightowl03d
When I was an undergrad and graduate student I got into the habit of always
doing the readings pencil in hand, which involves filling in the details of
the important proofs, and doing some simple problems of my own devising before
going to the lecture. I still do that before I work the exercises for an
online course.

Of course whether I finish the exercises before the lecture completes really
depends on the course. If it is implementing a simple algorithm and devising
some test cases for it then it is often the case. If it is implementing an ML
algorithm over a large data set, of course not.

Also I have been working in open offices for a long time, so I have learned to
focus when there is a lot of background noise. I usually do not start paying
attention to the lectures unless it sounds like there is a good joke, or I am
getting stuck doing the exercises.

I also do not actually watch the lectures, I only listen to them unless I get
stuck in the exercises.

