Hacker News new | past | comments | ask | show | jobs | submit login
I'm teaching an introductory 12-week class on Haskell (shuklan.com)
204 points by BinRoo on Jan 9, 2013 | hide | past | favorite | 52 comments

"Nothing is evaluated unless necessary

head (sort ls)

The list will only be sorted enough to find the minimum"

This may be technically true, but is a pretty bad example with much hand waving - what exactly does it mean to be "sorted enough to find the minimum" given that Haskell uses a merge sort implementation internally?

A better example of Haskell's lazy nature (taken from the Learn You A Haskell book) would be:

take 10 (repeat 5) - it's very easy to comprehend taking the first 10 elements of an infinitely long list without needing to compute the entire list.

Yep, the "sort only to get head" trick only works fully with selection sort, where it reduces complexity from O(n^2) to O(n) (reduces to a simple max/min). But it also confers some advantage in the case of standard merge sort: the last two sorted sublists will not be merged.

Regarding "repeat", I find it pretty much awesome that it is implemented as a circular linked list with a single element, as in:

    repeat x = xs where xs = x : xs
which ensures that it will take up constant space no matter how "far" in it is evaluated.

Nice presentation. Friendly notes:

1. Ctrl+Shift+K opens the web console in Firefox, not your secret notes.

2. Please don't present naive "quicksort" in Haskell as equivalent to a real quicksort unless you're also going to prove that the cute Haskell example is as efficient in all senses as the in-place C implementation. (Good luck with that, as my American friends say.)

In regard to your second point, I completely agree. I'm considering ways to rephrase that part.

Great mobile support by the way. But regarding secret notes, although reveal.js and bootstrap looks great on mobile, there is no way that I could find to view the secret note on Android chome...

Maybe on Android 4.x, but on older devices, it's useless. The slides do not auto-fit the screen.

re 1: yes, that's where the secret notes are.

I'm having a hard time keeping up with all these awesome classes.

Coursera's PL class is starting in a few days: https://www.coursera.org/course/proglang

Brown's Intro to PL class: http://cs.brown.edu/courses/cs173/2012/Videos/

Great work so far. I like the organization. Any plans to release video lectures?

+1 for videos. They make it much more enjoyable but it can be a lot of work :( Are you going to publish quizzes and assignments?

+1, does UVA do any kind of OpenCourseWare[0]?

[0] http://www.ocwconsortium.org/

+1 for video.

+1 for video.

Awesome! Thanks for posting about this. I just started Erik Meijer's 13-lecture video series on Channel 9, and look forward to bolster my learning with your course.

Every slide has a secret note

Any idea how to show that on something like an iPad? Once per day to see the alt text on xkcd is already too much to bear.

> Once per day to see the alt text on xkcd is already too much to bear.

Try the mobile site, m.xkcd.com; it has a clickable "alt-text" link to reveal the alt text in-page.

You can turn on Safari's awful console in the Settings app, I think under "advanced".

Will you be sending out email reminders when every new lecture is posted? I'd love to follow along, but find it very hard to remember all of the classes I subscribed to.

Yup. Please enroll so that I keep everyone up to date https://docs.google.com/spreadsheet/viewform?formkey=dGtrcXZ...


May want a few pointers to a huge number of tutorials and books:



Unfortunately, the wiki for books is out of date, I would suggest looking at those by Thompson (3rd ed), Hutton, Bird (Pearls of Functional), Hudak: http://haskell.cs.yale.edu/testnewtemplate/

also lots of cheats:


Yet another attempt/excuse for learning Haskell!

Really? A picture of a kid with Down's Syndrome wearing a Superman outfit?

And the original image has a Lisp column, conveniently removed from this one ;-)


Apparently I overlooked that when I found it online. The image is now modified. Thank you pointing this out.

On this slide.


It's not a good slide.

well it does get the point across. Should he also edit out the one with a person with higher than average body fat, so that we don't risk upsetting any people with higher than average body fat?

Very nice. Was this of your own initiative or was it the department?

Thank you! Yes, this was my own initiative.

Looks like it's going to be a great course! On an unrelated note, how did you generate the slides? They're very cool.

I'm not a fan of slides presented sans context, but these are very nicely done.

please, replace the slide 6 pic with this one: http://4.asset.soup.io/asset/0750/2820_15d5_960.jpeg (you can't just pretend Lisp doesn't exist, you know ;) )

Was just hit with the desire to learn more about Haskell this weekend, after stumbling on some notes from a Language Paradigms class in school...can't wait to check this out!

I'm taking this course next semester at UVa. Can't wait!

Get excited!

Awesome. Learning Haskell has been on my list for a long time, and I really appreciate that both books are available for free online. Thanks!

first time I learned Haskell it was great; gave me a new insight on how to think differently while coding other languages.

Favorite pairs from the 'X as seen by Y' slide: {{Java, C}, {C, Java}, {PHP, Java}, {Ruby, Java}, {PHP, Ruby}}

{Java, Ruby} and {C, Ruby} both gave me the simultaneous "LOL" and "nailed it!" reaction. {Ruby, Java} and {Ruby, Haskell} were pretty funny too.

I don't understand the Ruby as seen by PHP square

There is some complexity to that meme, but put very simply it illustrates that PHP people sometimes view Rubyists as either cultic and/or atheistic about programming religion.

I believe it's the flying spaghetti monster

This looks awesome. Thanks! I will definitely be following along.

Nice presentation. Did you use a tool to create the slides?

Could you make these available for download, by any chance?

Try this feature https://github.com/BinRoot/Haskell-Lectures#pdf-export

Let me know if it works well.

Very interesting way to solve the problem. It works great. Thank you!

It’s beautiful. How did you create the slides?


Beautiful slides. :)

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact