I'm teaching an introductory 12-week class on Haskell
shuklan.com
shuklan.com
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.
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.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.)
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/
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.
Try the mobile site, m.xkcd.com; it has a clickable "alt-text" link to reveal the alt text in-page.
http://www.haskell.org/haskellwiki/Meta-tutorial
http://www.haskell.org/haskellwiki/Tutorials
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:
(http://shuklan.com/haskell/lec01.html#/0/6)
It's not a good slide.
Let me know if it works well.