I just started learning Haskell and it seems like you can’t get too far in the language without being comfortable ( or at least exposed ) to certain branches of mathematics. Unfortunately I have major holes in such areas and am wondering what is a good introductory textbook that covers all the concepts Haskell uses?
For what it’s worth, I have an undergraduate engineering degree ( not comp-sci or EE ), though the math I was exposed to was of the hand-wave and memorize variety. I also took an intro to comp-sci course where we did a few weeks of oCaml.
3
“Basic Category Theory for Computer Scientists” by Benjamin C. Pierce is a pretty good introduction to elementary category theory. It’s been a while seen I’ve looked through it but I think the code examples are in Haskell. If you’re trying to learn the fundamentals of Haskell then you don’t need any category theory. Knowing some basic type theory is enough.
2
I doubt any such book exists, and the closest you’ll get would be from a book about Haskell.
The problem is that Haskell makes shallow use of concepts from a wide range of relatively deep mathematics. For anyone who isn’t already a mathematician, learning enough of the math to help understand Haskell is very unlikely to be easier than just learning Haskell directly.
This is particularly true of category theory, where introductions aimed at mathematicians tend to use motivating examples that assume substantial prior knowledge of other fields of mathematics, and introductions aimed at Haskell programmers, unsurprisingly, use motivating examples in Haskell.
I recommend just continuing with Haskell. You can look up unfamiliar terms on Wikipedia–it often has definitions that are accessible enough that you can at least relate things back to programming. If you get stuck and need help on something specific, ask about it on Stack Overflow or the #haskell IRC channel on Freenode.
In short, just treat the math as opaque jargon–it’s not like programming isn’t full of that already, good grief–and learn what it means as you go. You can return to the mathematics itself later, if you’re interested, to get a deeper understanding of the underlying abstractions.