Covariance and GUIs

This week, we’ve added more reference material and new lessons to two of our ongoing courses.

Reference

We wrote a short explainer about threads. Find out what is meant by “green threads,” how Haskell’s threads relate to OS threads, and what the -threaded GHC flag means.

We realized we hadn’t discussed the term levity polymorphism in our article on Primitives, levity, and boxing. Since it’s a term you see pop up in Haskell circles from time to time – usually when the GHC developers have inadvertently exposed some runtime details in the type or kind signatures GHCi displays – we thought it was worth correcting that, so we have added a short section to that article.

The page on ScopedTypeVariables has been updated with a discussion of the second thing it does; in addition to allowing lexically scoped type variables as its name implies, it also allows pattern type signatures.

Courses

The latest lesson in the Functortown course is lesson 5 that introduces the Bifunctor typeclass. It starts with an example from a previous lesson, an example that was previously law-breaking but can be made lawful and thoroughly tame by using bimap instead of fmap. We also break down the class declaration of Bifunctor a bit and discuss what the Bifunctor documentation means by “the first and second arguments are covariant.”

Chris has the second lesson in the Timepieces series. It turns out making a clock with gtk3 involves a lot more manual widgeting than we had to do with fltkhs, so this first lesson gets us a window with centered text but not yet a clock.

Reminder

Most of the reference material, albeit sometimes in condensed form, will be in the Joy of Haskell: Haskell Desk Reference. Some of the courses will be reformatted and periodically released as short books; the first of those, an improved form of the Validation course, is available as a book on Leanpub (incomplete at this time but to be finished shortly).