Live data from Hacker News

Haskell is not category theory

pema.dev

21–30 of 54 posts

Re: Haskell is not category theory

#21
IMO after the first section the headings in the post are misleading: - A functor is "not a functor" because not all endofunctors on Hask can be written as Haskell Functors. - A monad is "not a monad" because you can implement a monad without satisfying all the monad laws.

I don't think either of these statements _really_ evidence the claims the headings make. Good post though, I always find that it's useful to think about the subtleties between mathematical objects and their implementation.

Re: Haskell is not category theory

#22

And you definitely don't need to learn category theory or know anything about it to start writing programs in Haskell or to maintain and build large Haskell applications. A lot of category theory is fun to learn and knowing it will help you in many ways but it is not a necessary requirement. I mention this because a lot of people seem to think it is. Definitely a nice article for the math-oriented/curious/etc! It's n…

> A lot of category theory is fun to learn and knowing it will help you in many ways I agree with your statement except that part. W.r.t coding, learning functional programing will help you in many ways. Learning category theory will just allow you to say "ah I've seen that concept before" - but it won't really help much.

The number of times I’ve heard someone say that some academic topic was not helpful and they were right is close to zero. It’s a pretty good heuristic to not adopt that attitude.

Re: Haskell is not category theory

#23

> If you are looking to learn the language, I recommend Learn You A Haskell. I definitely don't recommend this. While cute, Learn You A Haskell is lacking a lot of pragmatic advice about how to write software in haskell. It's good for getting you up to the FAM trio of type classes but leaves out a lot of practical advice around things like navigating base (what to use and ditch from it), the available community libra…

This conversation reminds me I need to get back to No starch's book about learning Physics with Haskell. Grabbed it cheap but haven't gotten back to it.

Re: Haskell is not category theory

#24
Andrej Bauer wrote a popular post in 2016 (Hask is not a category):

https://math.andrej.com/2016/08/06/hask-is-not-a-category/

Mathematicians are still thinking about this stuff.

A recent post by Mike Shulman, asking about Agda (Haskell for mathematicians):

https://proofassistants.stackexchange.com/questions/1887/cat...

Re: Haskell is not category theory

#25
Haskell is a pretty fun language to learn and if you’re interested in trying to translate concepts from category theory into programming, it’s probably a good language to use.

Haskell is not category theory in the same sense that arithmetic is not group theory: there’s only really one category. Well sort-of because type constructors let you work in different subcategories.

Category theory is about different categories and the nature of the relationships between them. It usually operates at a level of ‘let C be a category…’ with concrete categories or functors being examples. Haskell operates at a level even more concrete than single objects in a single category: the objects are types and Haskell operates on the values of those types. Of course Haskell can work at slightly higher levels too, but it never really escapes categories that look a lot like Hask.

Maybe that statement is too strong though. I’d be keen to see some interesting actual-category-theory level things in Haskell. (Maybe I’m being unfair and these do exist but I am considering them to not count as ‘actual category theory’)

I thought that the ‘categorical theory of patches’ thing was a good example of category theory applied to programming but note that it didn’t require any kind of general notion of e.g. push-outs in a programming language.

Re: Haskell is not category theory

#26

> If you are looking to learn the language, I recommend Learn You A Haskell. I definitely don't recommend this. While cute, Learn You A Haskell is lacking a lot of pragmatic advice about how to write software in haskell. It's good for getting you up to the FAM trio of type classes but leaves out a lot of practical advice around things like navigating base (what to use and ditch from it), the available community libra…

> While cute, Learn You A Haskell is lacking a lot of pragmatic advice about how to write software in haskell.

No book can give pragmatic advice on that topic, it's an ecosystem that evolves poorly and (lately) quite fast.

You recommend HPFFP but it's also a dated resource for anything but learning nowadays.

Re: Haskell is not category theory

#29

This post is literally the "Ackchyually" meme. There is a reason why "fast and loose reasoning is morally correct".

I might be a counterexample to the claim that "this is pedantic and the differences they're mentioning are meaningless in practice". I learned about functors in uni and only later took a look at Haskell. I was genuinely very confused by the naming of Functor: functors map both morphisms and elements, but this isn't the case in Haskell. So I was left wondering whether I had missed something.

Re: Haskell is not category theory

#30
post #6

Earlier quoted context omitted.

I thought fanboyism was one of the first principles.

The only language I've seen where developers are less fanboys of it than Haskell is C++. Try asking one what is wrong with the language.

Haskell feels like a language that's full of great ideas but overall nobody really likes it. Maybe it just needs to simmer for 30 years until someone comes up with whatever Haskell's equivalent of C++'s Rust is.
Post reply on HN