top | item 7368669

Intro to Haskell for Erlangers

134 points| waffle_ss | 12 years ago |bob.ippoli.to

54 comments

order
[+] jerf|12 years ago|reply
This is how I came to Haskell. If you're a polyglot sort and you eventually want to get to Haskell, but Erlang also looks interesting, it's not a bad path. Erlang can get you over the basics of working with immutable data structures (in particular it can get you past "But how can I write a program without mutable values?!?"), has enough interesting stuff to learn on its own about reliable programming to justify learning it on its own merits, and then when you go to Haskell, you won't be trying to swallow quite as much in one go. You can focus on what Haskell actually has to say, instead of being stuck on the basics. The downside is after that, Erlang's deficiencies as a functional language will be pretty obvious and quite frustrating. (I'm not kidding that it's worth learning, probably much moreso than the next C(#/++/)-etc variant, but there's a certain klunkiness to Erlang that gets old after a while.)
[+] mercurial|12 years ago|reply
On the other hand, I find myself unable to plateau in Haskell, it seems that there is always new abstractions behind the corner. Want to thread exceptions through your monad transformers? Learn MonadState. Want accessors which do not suck? Learn Lens. And then you have free monads, comonads, Operational, Kleisli arrows, Pipes/Conduits/IO Streams/Iteratees...

It may be an issue with the language: make a powerful language, and many things which ought to be part of the core system are going to be in a library. And as Haskell's syntax unfortunately allows library designers to go wild with ASCII symbols, you can easily end up with really hard-to-grok code (especially with the right amount of point-free style). Bonus if you use one-character variables. Unfortunately, in the real world code is read more than it is written, and the prevalent cleverness doesn't really help with that.

[+] mulligan|12 years ago|reply
I attended this talk and it was very well done. Most intro to $LANGUAGE talks try to share a few very simple examples of the language. Something most people could read about and absorb on their own in 10-15 minutes. Bob's slides and presentation went for breadth, acknowledging that this was not a tutorial but a way to present listeners with a great sense of what the language does, how it contrasts with Erlang, and [what I found the most useful] a good explanation of how to approach some of the more difficult to explain concepts. Now when I sit down to actually learn Haskell, I have a useful mental model on a bunch of the not so obvious concepts.

I think video of the talk that goes with these slides will eventually be uploaded at: http://www.youtube.com/user/ErlangSolutions

Some of the presentations from just a couple days ago are already up, so I hope to see the rest soon.

[+] pohl|12 years ago|reply
I love how dense but clear slide 125 is. I look forward to the upload.
[+] louthy|12 years ago|reply
> Cabal; easily fetch more packages from Hackage

Having spent the past two days trying to recover from Cabal Install's dependency hell (still ongoing), I must disagree on this. OSX seems to be particularly shonky (on mavericks), Windows has been relatively plain sailing.

http://ivanmiljenovic.wordpress.com/2010/03/15/repeat-after-...

Don't let that put you off though, Haskell really is a beautiful language, I quite often find myself just sitting back and looking at the code thinking "Damn that looks good".

[+] nbouscal|12 years ago|reply
Cabal still has a little ways to go, but it has been improving rapidly. Sandboxes came out recently and have helped a lot.
[+] louthy|12 years ago|reply
Heh, 1 min after posting this I fixed my dependency hell! Finally. Clearly I just needed a bit of HN distraction :)
[+] lallysingh|12 years ago|reply
I just cabal init in each new project directory, add my deps as desired there, and cabal-dev install it. Pretty easy.
[+] DiabloD3|12 years ago|reply
As someone that knows Erlang but doesn't Haskell and wants to learn, this might come in handy.
[+] glesica|12 years ago|reply
Having seen this talk, I highly recommend it, even if you don't know Erlang (just skip the Erlang slides). It's a great overview of Haskell for anyone looking to quickly become productive(-ish) with the language!
[+] spullara|12 years ago|reply
This seems like a vanishingly small set of people. You're introducing the 49th[1] most popular language to people that program in a 50+ language. If you are trying to get more converts to Haskell, I would go after a larger set of programmers. If it is just for fun, cool.

[1] http://www.tiobe.com/index.php/content/paperinfo/tpci/index....

[+] nox_|12 years ago|reply
You do realise that this talk was given at an Erlang-only conference which you have to pay to attend to it (well, everyone but the speakers)? How people are so focused on language popularity will never cease to amaze me.
[+] banachtarski|12 years ago|reply
Ippolito is well known in the Erlang world for his work at Mochiweb and he is sharing with his community his explorations in Haskell. What's the matter with this?

Juxtapositions between Haskell and Erlang have historically always come up so a comprehensive summary is always welcome.

Also, out of all the possible epenis measurement metrics for 1337est programming languages, popularity is the absolute dumbest one and is the bastion of mediocre codemonkeys.

[+] pohl|12 years ago|reply
Think of it as targeted marketing: smaller set of people, but higher likelihood of buy-in.
[+] glesica|12 years ago|reply
So he should have out-of-the-blue applied to talk about Haskell at PyCon or whatever conference PHP developers have?
[+] chongli|12 years ago|reply
Functional language cannibalism at its finest!

Seriously, it seems like the more people agree on something the more they bikeshed over it.

[+] lostcolony|12 years ago|reply
Can't wait for the talk to be made available. I missed out on Erlang Factory this year, but this is one talk I am definitely looking forward to seeing uploaded.
[+] lclarkmichalek|12 years ago|reply
Anyone know of anything similar going the other way around?
[+] subleq|12 years ago|reply
In what way is Haskell's pattern matching not as clever as Erlang's?
[+] lostcolony|12 years ago|reply
It shows later in the slideshow, no? Slides 40-41.
[+] peteretep|12 years ago|reply
Consider:

    evaluate([ A,A,A, _,_,_, _,_,_ ]) when A != b -> { winner, A };
    evaluate([ _,_,_, A,A,A, _,_,_ ]) when A != b -> { winner, A };
    evaluate([ _,_,_, _,_,_, A,A,A ]) when A != b -> { winner, A };
I don't think I can do that as eloquently in Haskell using pattern matching, but I'd love for you to show me.
[+] judk|12 years ago|reply
Nice, a slide show using a bleeding edge layout/display framework that doesn't work on mobile. Way to spread your ideas.
[+] thu|12 years ago|reply
It seems those are slides for a live presentation, so I guess you might also complain about the lack of sound or about how pointless it is to post slides on the internet. Or you might make a constructive comment. Or no comment at all.

Still I was curious to find out what "doen't work" means in the context of your comment. I tried on my Nexus 4 and everything was nice. So maybe you should complain about how a slack the original author is to not try his intended-for-a-live-presentation slides on all possible devices a careful reader like you could see them.

[+] runejuhl|12 years ago|reply
Because of your comment I tried the site in my installed browsers: stock CyanogenMod browser, Firefox, Chrome, Opera and Dolphin. I tried looking at the source of the page, and I've looked at it in w3m and elinks.

Bottom line? Works great.

[+] nbouscal|12 years ago|reply
It worked really nicely on my iPhone.
[+] coldtea|12 years ago|reply
Yes, because mobile users are entitled to his presentation right?
[+] jeffdavis|12 years ago|reply
What specific device and software are you using? Perhaps the problem can be fixed once it's identified.