
Category Theory abstractions for Clojure - michaelsbradley
http://funcool.github.io/cats/latest/
======
winterlight
What is the value of Category Theory for programming? I'm genuinely
interested, as my knowledge about this subject is little to none.

~~~
5outh
Category Theory is all about composing things and being able to reason about
them mathematically. In programs, we compose lots of things (functions, types,
objects, systems...), and being able to abstract that away is valuable.
Bartosz Milewski has been putting together a nice series ("Category Theory for
Programmers") for a little while now, that seems to be pretty well-received
and may give you the answer you're looking for:
[http://bartoszmilewski.com/2014/10/28/category-theory-for-
pr...](http://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-
the-preface/)

~~~
winterlight
Thank you. I've just finished the first chapter and it has been a pleasant
reading so far. The mapping of "real world" onto Category Theory surely makes
the matter more approachable.

------
dikaiosune
It seems like within a week of me trying in earnest to adopt Clojure as
another language in my arsenal, HN starts having a lot more regular Clojure
visitors to the front page. Is this just confirmation bias, or does it seem to
other HNers like Clojure is getting more traction and attention these days?

~~~
hoprocker
Clojure certainly seems one of the darling languages on HN (along with
Haskell, Rust, Go). The thing that _I'm_ noticing all of a sudden is the
uptick in articles on category theory -- which, similarly, I was only made
aware of about 3 weeks ago.

Is there a graphical representation somewhere of buzzwords appearing on HN
over time? If not -> hack-a-thon project.

------
mjt0229
Neat. You should know that cats is also the name of a Scala library [1] that
includes a lot of similar concepts.

[1] [https://github.com/non/cats](https://github.com/non/cats)

------
ChristianMarks
Not a great deal of explicit category theory in this. Somone ought to
implement Moggi's paper on exceptions and show exactly what the constructions
mean.

~~~
michaelsbradley
This paper?

[http://www.cs.cmu.edu/afs/cs/user/crary/www/819-f09/Moggi91....](http://www.cs.cmu.edu/afs/cs/user/crary/www/819-f09/Moggi91.pdf)

~~~
ChristianMarks
Yes. Many category theorists would find Moggi91 opaque. It could benefit from
commentary and more detail than would be standard for a published paper, if
the intention is to make the categorical semantics of functional programming
with side effects accessible to a wide audience. I guess one could suss this
out of Robert Harper's book on the foundations of programming languages, but I
was thinking of something more direct.

------
kenko
The "monads" library they ding for not-great documentation is
[https://github.com/bwo/monads/](https://github.com/bwo/monads/) (the
documentation is admittedly not great).

------
bkirkbri
Exciting! I was looking for a ClojureScript monad library just last month.
Can't wait to dig in to this one.

I think there is a lot of potential to help with the complexities of
asynchronous failures.

------
jonnybgood
I wish the author didn't make the same mistake as Haskell by calling it
_return_. But i guess it has become convention now.

~~~
vilhelm_s
Yeah. I guess "return" is still an improvement on the previous name, η. :)

