Short version: Where can I find highly varying, small or medium-sized exercises and examples on the use, identification and instance declaration of Haskell's abstractions such as applicatives, monads, monoids, foldables, transversables and monad transformers?

I have identified a serious lack of small to medium-sized exercises on Haskell's "higher abstractions," such as applicatives, monads, monoids, foldables, transversables and monad transformers. When studying, say, the use of higher-order functions such as foldr, many materials contain a good set of exercises, starting from simple ones and proceeding to varying levels of challenge. When it comes to the "higher abstractions," the situation is, in my humble opinion, extremely poor, even after combing through many sources and trying to extract everything that is available.

To help the student understand and appreciate these abstractions I would expect to see highly varying, small to medium-sized exercises. These exercises should make the student, among other things,

• use these abstractions
• write instances of these abstractions
• identify cases where these abstractions could be defined and used
• identify cases where these abstractions can not be defined and used
• compare the use of these abstractions to not using them.

As background information, my two favourite materials are Hutton's Programming in Haskell (2nd ed.) for a solid basis and Allen's and Moronuki's Haskell Programming from First Principles for some of their material on more advanced topics.

While Hutton's Programming in Haskell is a superb text for the basics, a good example of what is missing is its chapter "Foldables and friends" on monoids, foldables and transversables. The exercise set does not contain a single exercise that would make the student practice the use of these abstractions. It does not contain a single exercise of identifying the existence of these abstractions in some domain.

These abstractions are, in my opinion, an order of magnitude more difficult to assimilate than, say, higher-order functions. There is also at least an order of magnitude difference in the number of exercises available, but it is in the wrong direction.

Granted, Haskell Programming from First Principles does make you write a lot of instances of these abstractions in classic cases. Unfortunately it missed the other parts, and made me feel a bit like having proved a bunch of lemmas with very little idea of where those lemmas might be useful.

I think this is relevant for the Haskell community in general. If we can find pointers to good exercises, or examples that can be turned into exercises, I can create a public github repo and start collecting the material into one place.

• Welcome to Computer Science Educators. Glad you picked this site as the home for your question. While Haskell is way outside my experience, I believe this is the place to find your answers, if any exist that is. I've added some tags, which you can remove if you choose, that might help sort out what others see before opening your question. – Gypsy Spellweaver Sep 18 '18 at 0:09
• Is blog.tmorris.net/posts/20-intermediate-haskell-exercises the kind of thing you are looking for? – Brent Yorgey Sep 20 '18 at 1:53
• I suggest that you ask a question like this on the SIGCSE mailing list. While the membership there overlaps with this site, you will reach a lot of additional people who may have answers. – Buffy Sep 20 '18 at 15:31
• @BrentYorgey Those exercises are of the "type tetris" variety, where instances are written without any application or domain context. Haskell Programming from First Principles contains plenty of these. You do learn to write instances from types alone. But there is no stage where abstractions would be identified in domain, nor any idea of how they might be used. – jhu Sep 22 '18 at 13:14
• I see! Yes, I am not aware of any collected exercises along those lines. – Brent Yorgey Sep 23 '18 at 21:27