Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which mathematical topics are most crucial for a deep understanding of Haskell?

Tags:

math

haskell

Haskell is a language with many characteristics rooted in formal mathematics. Which mathematical topics should I study to gain a deeper appreciation and understanding of the language? I imagine that Abstract Algebra and Category Theory are both good topics to explore, for example.

like image 377
Matthew Piziak Avatar asked Jul 23 '12 17:07

Matthew Piziak


2 Answers

Generally , Discrete math, Logic, think sets or relations, induction,proofs recursion, corecurssion, some basic algebra, number theory, type theory and lambda calculus, BTW there are books that cover all the math you need while diving into haskell.

like image 93
pyCthon Avatar answered Nov 09 '22 23:11

pyCthon


I don't think abstract algebra (groups, rings, etc.) is directly relevant to Haskell, though the style of thinking used in abstract algebra is very helpful for Haskell programmers. This is in contrast with imperative languages, which call for thought processes more like those used in calculus or analysis.

Knowing a little bit of category theory is very helpful in my opinion. If you can understand the Typeclassopedia, that may be enough. The wikibook http://en.wikibooks.org/Haskell/Category_theory is a good readable intro, that I found much more helpful than any number of monad tutorials. In fairness, that's about the limit of my own current knowledge of the subject, so maybe I'm missing something that I'm not aware of yet. More advanced category theory shows up in some advanced Haskell topics such as generics, but at least for now I think of those as rather specialized. I've started watching some Catsters videos (type "catsters" into the Youtube search box) and am finding them interesting towards building a view of "where Haskell comes from" but I haven't seen that many yet.

I think it is important to understand a bit about logic as well, enough to understand that a Haskell function is a proof of a predicate expressed by its type signature (the Curry-Howard correspondence). The fancier uses of this concept (as I see it from a distance) seem to come from knowledge of intuitionistic type theory as used in Coq and Agda. Last summer a lot of Haskellers were reading "Software Foundations" ( http://www.cis.upenn.edu/~bcpierce/sf/ ) which is about Coq and looks great, but I had too much going on to spend any time on it myself. It's on my list ;-).

like image 34
none Avatar answered Nov 10 '22 00:11

none