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.
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.)
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...
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.
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.
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/
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?
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!
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.
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.