
Applied Category Theory - lelf
https://ocw.mit.edu/courses/mathematics/18-s097-applied-category-theory-january-iap-2019/index.htm
======
eindiran
If anyone is looking to get into Category Theory as a programmer, I would
recommend giving Bartosz Milewski's Category Theory for Programmers a shot[0].
Quite good, and you can read it as a blog post on that site or get the
ebook/physical book to leaf through.

For a more theoretical/less applied approach that's still relevant to computer
science/programming, check out Benjamin Pierce's Basic Category Theory for
Computer Scientists[1]. It's a very good introduction to the parts of Category
Theory that are useful for [theoretical] CS, and delves into semantics of
programming languages, types, and concurrency a fair amount.

[0] [https://bartoszmilewski.com/2014/10/28/category-theory-
for-p...](https://bartoszmilewski.com/2014/10/28/category-theory-for-
programmers-the-preface/)

[1] [https://mitpress.mit.edu/books/basic-category-theory-
compute...](https://mitpress.mit.edu/books/basic-category-theory-computer-
scientists)

~~~
armitron
I watched a little less than the first half of Bartosz video lectures and I
still don't see what the fuss is about from the perspective of an engineer
that is looking to get better at engineering.

I can't find something there that would help me implement better systems. What
I do see is an attempt to shoehorn a mathematical model onto certain
programming paradigms in order to be able to say that these paradigms are
instances of the model. In short, a lot of talk about abstractions (or
"abstract nonsense") but very little of engineering significance. Please let
me know if I'm missing something by listing concrete examples of how category
theory can help me with engineering problems.

Disclaimer: I'm not a mathematician.

~~~
xelxebar
I'd say that you can safely ignore CT until you find the need or desire to
learn more. The field is still very young and it probably shines most within
pure mathematics, for now at least.

I think of CT as the study of "composability" in its purest form.
Mathematicians are finding that this language is really good at translating
domain-specific knowledge between disparate fields, not unlike the babelfish
from the Hitchhiker's Guide.

FWIW, some researchers are apparently finding interesting applications in the
development of biological models. John Baez has talked about applications in
this direction via control theory [0].

[0]:[https://classes.golem.ph.utexas.edu/category/2015/04/categor...](https://classes.golem.ph.utexas.edu/category/2015/04/categories_in_control.html)

~~~
YorkshireSeason
Category theory studies the composition of (things that look like) functions.
So each thing has a domain, and a codomain, and if we compose A --f--> B with
B --g--> C then the intermediate B goes away. This doesn't sit nicely with how
parallel composition works, e.g. If I talk to Google, that doesn't prevent you
from talking to Google.

That's the essence of why category theory works nicely with pure functional
programming, but beyond that simply fails to be useful. In particular, there
has been virtually no progress in useful categorical models of parallel
computation.

~~~
eru
What about eg [http://lambda-the-ultimate.org/node/4823](http://lambda-the-
ultimate.org/node/4823) ?

~~~
YorkshireSeason
I don't see much / any category theory in the two papers linked. So I'm not
sure what to say.

------
outlace
The course is based on this free book
[http://math.mit.edu/~dspivak/teaching/sp18/7Sketches.pdf](http://math.mit.edu/~dspivak/teaching/sp18/7Sketches.pdf)

~~~
chombier
I am currently reading it, it is very nicely written and accessible. Each
chapter starts off gently so you can skip to the next whenever you feel lost,
only to come back later.

So far: introduction/preorders, monoidal preorders/wiring diagrams,
categories/application to database schemas.

For those reading on a ebook, the book sources are available on its arxiv page
[https://arxiv.org/abs/1803.05316](https://arxiv.org/abs/1803.05316) so you
can build a custom pdf for your device.

------
btilly
Note.

A mathematician's idea of "applied" and a normal person's idea of the same
bear little resemblance.

~~~
neel_k
It may be professional deformation speaking, but they seem to be using
"applied category theory" in a coherent and natural sense: they mean the
theory of monoidal categories, (a) viewed as a generalization of linear
algebra, and (b) omitting logic and programming language semantics as
applications.

Given the centrality of linear algebra to applied mathematics (even in places
where you wouldn't first expect, like the theory of regular expressions and
finite automata), this seems like a perfectly sensible coinage.

(Even though I must admit I get my back up at the omission of categorical
proof theory, it's perfectly natural as a sales pitch -- type theorists don't
need to be convinced of the utility of category theory!)

~~~
luxbock
> Given the centrality of linear algebra to applied mathematics (even in
> places where you wouldn't first expect, like the theory of regular
> expressions and finite automata)

Where can I read more about this?

~~~
doneata
Stephen Dolan's pearl "Fun with semirings" might be relevant:

[http://stedolan.net/research/semirings.pdf](http://stedolan.net/research/semirings.pdf)

But I would also like to know what other resources Neel has to recommend.

~~~
eru
If you like Matlab more than Haskell, try
[https://www.goodreads.com/book/show/11768822-graph-
algorithm...](https://www.goodreads.com/book/show/11768822-graph-algorithms-
in-the-language-of-linear-algebra)

------
wisnesky
David Spivak has a company, [http://conexus.ai](http://conexus.ai), that is
applying category theory to data migration as described in 7 sketches. It will
soon be expanding and soliciting proposals to fund applied category theory
start-ups in many domains, as well as providing some example proposal ideas.
Watch [http://ventures.conexus.ai](http://ventures.conexus.ai) over the coming
weeks for details.

------
formalsystem
Generally, I tend to care more about math if it relates to my specific
interests. I'm in ML and robotics so I've found it useful to understand
algebra, topology, real analysis.

I've tried to get into Category theory a few times but couldn't keep my
motivation high enough once things got too technical. Anyone know how category
theory could be useful for someone in ML or robotics?

~~~
vivekseth
Recently, I've been into learning about CRDTs a class of data structures which
can be edited independently and merged without conflicts. They can be used to
build experiences similar to Google Docs (although Gdocs uses a different
approach called OT).

I'm interested in learning Category/Set Theory to better understand the
underlying math of how they work.

I have very little experience with ML/Robotics, but CRDTs might be useful for
distributed learning, or coordination between independent robots.

~~~
adamnemecek
What class was this if I may ask?

~~~
vivekseth
When I said "class", I really just meant "type".

CRDTs are relatively new so there may not be many classes yet that teach them.
If you want to learn about them, I recommend you first watch this video:
[https://www.youtube.com/watch?v=OOlnp2bZVRs&list=WL&index=56...](https://www.youtube.com/watch?v=OOlnp2bZVRs&list=WL&index=56&t=0s)
and then read this paper:
[https://pages.lip6.fr/Marc.Shapiro/papers/RR-7687.pdf](https://pages.lip6.fr/Marc.Shapiro/papers/RR-7687.pdf)
. The video explains a lot of the math in a very easy to digest way and will
make the paper much easier to understand.

~~~
adamnemecek
I’m sorry, I misread. I was aware of CRDTs and I thought that they were taught
in some class.

------
weeksie
What's category good for? It's a serious question so please don't say
"monads", I understand monads just fine without knowing category theory. I'm
down to put in the work if the reward is there.

~~~
lisper
Imagine if you took a mathematical construct and replaced all of the familiar
terminology with gensyms. For example:

"A florb is brazzle of carnatious snoggles. A florb is itself a snoggle and so
can be a fnizzle of another florb."

This is actually the definition of what is normally called (in English) a SET,
under the following mapping of vocabulary:

florb = set

brazzle = collection

carnatious = distinct

snoggle = object

fnizzle = member

Category theory is about extracting the fundamental structure of mathematical
definitions so that these kinds of equivalences can be studied with
mathematical rigor.

~~~
whitten
I agree with others that this comment has increased my understanding greatly.
Perhaps since this is a linguistic example, it resonates. Thank you for
replying.

To add a bit of info, there is a system named Attempto Controlled English
which uses a subset of Natural Language to express axioms. It is available
here [https://github.com/chrisdone/ace](https://github.com/chrisdone/ace) and
here [https://github.com/Attempto/APE](https://github.com/Attempto/APE)

How would one associate patterns of axioms with appropriate relations in
Category Theory ?

~~~
lisper
Not a clue. I don't actually know much at all about category theory, just
enough to offer up that explanation of what it's about. And I had never heard
of Attempto before you mentioned it.

------
tgbugs
When I saw the title I suspect that this would be David Spivak, and happily it
is, I am also please to learn that he now has a new co-conspirator in the form
of Brendan Fong. I first encountered Spivak's work via Category Theory for
Scientists [0] which inspired me to try to come up with ways to use it for
documenting scientific protocols. My chief complaint at the time was that
someone had not already implemented many of the ideas expressed in his work.
Despite the usual treatment of category theory as something mystical and
opaque, I find Spivak's work to bring such clarity to communicating complex
ideas. Those ideas are always going to be complex, but the way we communicate
about them does not have to be. From a quick skim Sketches will provide
further inspiration.

0\.
[http://math.mit.edu/~dspivak/teaching/sp13/CT4S.pdf](http://math.mit.edu/~dspivak/teaching/sp13/CT4S.pdf)

~~~
state_less
I’ve appreciated his explanation of dB schemas as categories.

------
aghillo
Is there any accessible work using Category Theory that looks at API
composition? I’m thinking here about data intensive systems that are often
composed of different elements (e.g. Kafka, Cassandra, bespoke microservices,
...) and are glued together in an application. Could Category Theory help in
getting a grip on this complexity?

~~~
arianvanp
[http://hackage.haskell.org/package/pipes](http://hackage.haskell.org/package/pipes)
is the first that comes to mind.

And just Haskell programming in general involve composition Effects are monads
and program composition is composition over kleisli arrows .

~~~
aghillo
That looks very interesting and could be source of interesting ideas. Thank
you.

------
marquis-chacha
Watched the first lecture, loved the format: start with a question that you
can logically answer, then build up the math to formalize your intuition by
the end of the lecture.

------
radicaldreamer
Sort of related... but is David Spivak related to the author of that famous
Calculus textbook by Michael Spivak...?

------
smadge
Nice, now I can have sole video lectures to accompany my self printed copy of
“Seven Sketches in Composability”

------
revskill
When i was in College, my wish when learning Math is that:

\- Hey, wait! You don't tell me why we need to learn this concept

Yes, most of my lecturers use Math to teach Math. It's not useful to me, or i
can't learn that way.

A wish is just a wish though.

~~~
ambicapter
What if the aim is to solve problems that have never been solved before? In
which case, you don't know which tools you will need before. You are stuck
just learning a bunch of tools and hoping you learned the correct ones.

That's how life is. Some (most) times you don't know what tools you will need
in the future.

~~~
kian
All tools were created to solve at least one problem. Explaining what that
problem is, and how the tool is useful for solving it, goes a long way towards
making it easy to figure out the abstract template of tool application. Going
a step further and explicitly explaining why the tool works and when it
doesn't is the marrow of an actual education that can be used out of context.

------
anonymous5133
Looks like a good course but nothing cringes me more than seeing the
Massachusetts institute of TECHNOLOGY still using chalk boards....I mean come
on now.

~~~
tylerhou
What better alternatives are there?

“Smart” boards — expensive, and high drawing latency makes writing on them
uncomfortable. Also, text is hard to read from a distance. (They may be better
for accessibility.)

Dry-erase boards — boards and markers are expensive. Markers generate a lot of
waste.

Chalk — cheap, naturally occurring (and safe to dispose of) material. Easy to
read at long distances.

~~~
AnimalMuppet
Chalk is really nasty on your hands when you're the lecturer. And nobody ever
said "like fingernails on a whiteboard" for a reason.

~~~
tylerhou
I don't know about you, but I always get marker on my hands when I use dry
erase markers, and chalk is a hell of a lot easier to clean off than ink.

Also, don't put your fingernails on the chalkboard...?

~~~
AnimalMuppet
But ink doesn't dry and erode your skin. I _hate_ the feel of chalk.

