Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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.

share|improve this question
1  
I believe this discussion in SO can help: stackoverflow.com/questions/11617270/… –  Gilney Feb 4 '13 at 21:27
    
I don't really think you need to fully understand the mathematics behind the theory. Books usually talk about it, because it's interesting and useful to know, but you can still get a grasp on the logic you need to apply to problems, without having the grounding in the mathematics. –  d11wtq Mar 24 '13 at 2:18
    
LOL recipe for getting a question closed: 1. make it relevant such that people star it 2. catch the attention of a moderator –  chibro2 Mar 24 '13 at 3:42
add comment

closed as not constructive by maple_shaft Mar 22 '13 at 13:55

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers

up vote 9 down vote accepted

"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.

share|improve this answer
1  
+1 for: "If you're trying to learn the fundamentals of Haskell then you don't need any category theory.". –  Giorgio Feb 4 '13 at 8:26
2  
It's not necessary, but it's fun and it can help. At the very least, I didn't need any category theory for the "how" of Haskell, but learning the basics really helped me with the "why". –  Tikhon Jelvis Feb 5 '13 at 6:14
add comment

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.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.