Haskell Cheat Sheets (Part 1) 2014-03-04
haskell, cheatsheet, typeclass
tl;dr: : see this.
If you look for Haskell cheat sheets on the web, you get:
- Code Slower 14 pages cheat sheet
- Haskell Wiki Reference Card
- A short one with the basics
- And another one
- Ultimate Haskell Cheat Sheet
Personally, I find none of them particular useful. While the last three are useful for the absolute beginner, it seems that there’s a gap from there forward.
Of course, the usual answer is why do you need a cheat sheet, if there is hoogle, but while hoogle and hayoo are great, they only help you when you know what you are looking for exactly, namely the type signature.
Sometimes, it is useful to just have a lot information condensed in such a way that’s easy to analyse, so that you can make informed decisions or just easily discover additional functions.
With that purpose in mind, I plan to launch some Haskell cheat sheets, with different levels of complexity and applicability, but with some clear goals in mind:
- Ready to print, for the paper lovers like me
- Frequently updated and thus, one expects, always correct
The first Haskell sheet cheat I’ll be releasing is one were I illustrate:
- Semigroup , Monoid , Alt , Plus , Apply , Applicative , Alternative , Bind , Monad , MonadPlus hierarchy
- Fundamental operations supported by each type class
- Semantics of the binary operation (Choice, Combination, Both, Neither)
- Type Class restrictions
You can get it here.
If you don’t know half of those type classes, please see my next post, for a quick and dirty introduction.
These tables were made incrementally as I was learning each type class. They are still incomplete (namely the second page is still a partial copy-paste of the first), and they are - get ready to puke - in LibreOffice format, not Latex. But for these really complex tables I find it more useful: but I’m open to suggestions.
There are probably some lingering errors, and the table were not, unfortunately, made through automated code analysis. I would very much like that, but right now I see it as a very time consuming task…
Please feel free to identify mistakes, make suggestions or otherwise give your feedback on these. The original file is at GitHub.
Thanks!comments powered by Disqus