6

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
  • 1
    I believe this discussion in SO can help: stackoverflow.com/questions/11617270/… Commented Feb 4, 2013 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. Commented Mar 24, 2013 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 Commented Mar 24, 2013 at 3:42

2 Answers 2

9

"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
  • 1
    +1 for: "If you're trying to learn the fundamentals of Haskell then you don't need any category theory.". Commented Feb 4, 2013 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". Commented Feb 5, 2013 at 6:14
7

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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.