Archive for the ‘Category Theory’ Category

No Properties/No Structure – But, Subject Identity

Thursday, September 8th, 2016

Jack Park has prodded me into following some category theory and data integration papers. More on that to follow but as part of that, I have been watching Bartosz Milewski’s lectures on category theory, reading his blog, etc.

In Category Theory 1.2, Mileski goes to great lengths to emphasize:

Objects are primitives with no properties/structure – a point

Morphism are primitives with no properties/structure, but do have a start and end point

Late in that lecture, Milewski says categories are the “ultimate in data hiding” (read abstraction).

Despite their lack of properties and structure, both objects and morphisms have subject identity.


I think that is more than clever use of language and here’s why:

If I want to talk about objects in category theory as a group subject, what can I say about them? (assuming a scope of category theory)

  1. Objects have no properties
  2. Objects have no structure
  3. Objects mark the start and end of morphisms (distinguishes them from morphisms)
  4. Every object has an identity morphism
  5. Every pair of objects may have 0, 1, or many morphisms between them
  6. Morphisms may go in both directions, between a pair of morphisms
  7. An object can have multiple morphisms that start and end at it

Incomplete and yet a lot of things to say about something that has no properties and no structure. 😉

Bearing in mind, that’s just objects in general.

I can also talk about a specific object at a particular time point in the lecture and screen location, which itself is a subject.

Or an object in a paper or monograph.

We can declare primitives, like objects and morphisms, but we should always bear in mind they are declared to be primitives.

For other purposes, we can declare them to be otherwise.

Category Theory 1.2

Tuesday, August 30th, 2016

Category Theory 1.2 by Bartosz Milewski.

Brief notes on the first couple of minutes:

Our toolset includes:

Abstraction – lose the details – things that were different are now the same

Composition –


Identity – what is identical or considered to be identical

Composition and Identity define category theory.

Despite the bad press about category theory, I was disappointed when the video ended at the end of approximately 48 minutes.

Yes, it was that entertaining!

If you ever shied away from category theory, start with Category Theory 1.1 and follow on!

Or try Category Theory for Programmers: The Preface, also by Bartosz Milewski.

Category Theory 1.1

Thursday, August 25th, 2016

Motivation and philosophy.

Bartosz Milewski is the author of the category series: Category Theory for Programmers.


Elementary Category Theory and Some Insightful Examples

Saturday, August 13th, 2016

Elementary Category Theory and Some Insightful Examples (video)

From the description:

Eddie Grutman
New York Haskell Meetup (
July 27, 2016

It turns out that much of Haskell can be understood through a branch of mathematics called Category Theory. Concepts such as Functor, Adjoints, Monads and others all have a basis in the Category Theory. In this talk, basic categorical concepts, starting with categories and building through functors, natural transformations, and universality, will be introduced. To illustrate these, some mathematical concepts such as homology and homotopy, monoids and groups will be discussed as well (proofs omitted).

Kudos to the NYC Haskell User’s Group for posting videos of its presentations.

For those of us unable to attend such meetings, these videos are a great way to remain current.

Category theory definition dependencies

Friday, August 5th, 2016

Category theory definition dependencies by John D. Cook.

From the post:

The diagram below shows how category theory definitions build on each other. Based on definitions in The Joy of Cats.


You will need John’s full size image for this to really be useful.

Prints to 8 1/2 x 11 paper.

There’s a test of your understanding of category theory.

Use John’s dependency graph and on (several) separate pages, jot down your understanding of each term.

Functor Fact @FunctorFact [+ Tip for Selling Topic Maps]

Tuesday, June 28th, 2016

JohnDCook has started @FunctorFact, tweets “..about category theory and functional programming.”

John has a page listing his Twitter accounts. It needs to be updated to reflect the addition of @FunctorFact.

BTW, just by accident I’m sure, John’s blog post for today is titled: Category theory and Koine Greek. It has the following lesson for topic map practitioners and theorists:

Another lesson from that workshop, the one I want to focus on here, is that you don’t always need to convey how you arrived at an idea. Specifically, the leader of the workshop said that if you discover something interesting from reading the New Testament in Greek, you can usually present your point persuasively using the text in your audience’s language without appealing to Greek. This isn’t always possible—you may need to explore the meaning of a Greek word or two—but you can use Greek for your personal study without necessarily sharing it publicly. The point isn’t to hide anything, only to consider your audience. In a room full of Greek scholars, bring out the Greek.

This story came up in a recent conversation about category theory. You might discover something via category theory but then share it without discussing category theory. If your audience is well versed in category theory, then go ahead and bring out your categories. But otherwise your audience might be bored or intimidated, as many people would be listening to an argument based on the finer points of Koine Greek grammar. Microsoft’s LINQ software, for example, was inspired by category theory principles, but you’d be hard pressed to find any reference to this because most programmers don’t want to know or need to know where it came from. They just want to know how to use it.

Sure, it is possible to recursively map subject identities in order to arrive at a useful and maintainable mapping between subject domains, but the people with the checkbook are only interested in a viable result.

How you got there could involve enslaved pixies for all they care. They do care about negative publicity so keep your use of pixies to yourself.

Looking forward to tweets from @FunctorFact!

Functors, Applicatives, and Monads in Plain English

Saturday, April 23rd, 2016

Functors, Applicatives, and Monads in Plain English by Russ Bishop.

From the post:

Let’s learn what Monads, Applicatives, and Functors are, only instead of relying on obscure functional vocabulary or category theory we’ll just, you know, use plain english instead.

See what you think.

I say Russ was successful.


Databases are categories

Tuesday, April 19th, 2016

Databases are categories by David I. Spivak.

Slides from a presentation 2010/06/03.

If you are more comfortable with databases than category theory, you may want to give these a spin.

I looked but was unable to locate video of the presentation. That would be a nice addition.


Physics, Topology, Logic and Computation: A Rosetta Stone

Monday, February 22nd, 2016

Physics, Topology, Logic and Computation: A Rosetta Stone by John C. Baez and Mike Stay.


In physics, Feynman diagrams are used to reason about quantum processes. In the 1980s, it became clear that underlying these diagrams is a powerful analogy between quantum physics and topology. Namely, a linear operator behaves very much like a ‘cobordism’: a manifold representing spacetime, going between two manifolds representing space. This led to a burst of work on topological quantum field theory and ‘quantum topology’. But this was just the beginning: similar diagrams can be used to reason about logic, where they represent proofs, and computation, where they represent programs. With the rise of interest in quantum cryptography and quantum computation, it became clear that there is extensive network of analogies between physics, topology, logic and computation. In this expository paper, we make some of these analogies precise using the concept of ‘closed symmetric monoidal category’. We assume no prior knowledge of category theory, proof theory or computer science.

While this is an “expository” paper, at some 66 pages (sans the references), you best set aside some of your best thinking/reading time to benefit from it.


A Gentle Introduction to Category Theory (Feb 2016 version)

Monday, February 8th, 2016

A Gentle Introduction to Category Theory (Feb 2016 version) by Peter Smith.

From the preface:

This Gentle Introduction is work in progress, developing my earlier ‘Notes onBasic Category Theory’ (2014–15).

The gadgets of basic category theory fit together rather beautifully in mul-tiple ways. Their intricate interconnections mean, however, that there isn’t asingle best route into the theory. Different lecture courses, different books, canquite appropriately take topics in very different orders, all illuminating in theirdifferent ways. In the earlier Notes, I roughly followed the order of somewhatover half of the Cambridge Part III course in category theory, as given in 2014by Rory Lucyshyn-Wright (broadly following a pattern set by Peter Johnstone;see also Julia Goedecke’s notes from 2013). We now proceed rather differently.The Cambridge ordering certainly has its rationale; but the alternative orderingI now follow has in some respects a greater logical appeal. Which is one reasonfor the rewrite.

Our topics, again in different arrangements, are also covered in (for example)Awodey’s good but uneven Category Theory and in Tom Leinster’s terrific – and appropriately titled – Basic Category Theory. But then, if there are some rightly admired texts out there, not to mention various sets of notes on category theory available online (see here), why produce another introduction to category theory?

I didn’t intend to! My goal all along has been to get to understand what light category theory throws on logic, set theory, and the foundations of mathematics. But I realized that I needed to get a lot more securely on top of basic category theory if I was eventually to pursue these more philosophical issues. So my earlier Notes began life as detailed jottings for myself, to help really fix ideas: and then – as can happen – the writing has simply taken on its own momentum. I am still concentrating mostly on getting the technicalities right and presenting them in apleasing order: I hope later versions will contain more motivational/conceptual material.

What remains distinctive about this Gentle Introduction, for good or ill, is that it is written by someone who doesn’t pretend to be an expert who usually operates at the very frontiers of research in category theory. I do hope, however,that this makes me rather more attuned to the likely needs of (at least some)beginners. I go rather slowly over ideas that once gave me pause, spend more time than is always usual in motivating key ideas and constructions, and I have generally aimed to be as clear as possible (also, I assume rather less background mathematics than Leinster or even Awodey). We don’t get terribly far: however,I hope that what is here may prove useful to others starting to get to grips with category theory. My own experience certainly suggests that initially taking things at a rather gentle pace as you work into a familiarity with categorial ways of thinking makes later adventures exploring beyond the basics so very much more manageable.

Check the Category Theory – Reading List, also by Peter Smith, to make sure you have the latest version of this work.

Be an active reader!

If you spot issues with the text:

Corrections, please, to ps218 at cam dot ac dot uk.

At the category theory reading page Peter mentions having retired after forty years in academia.

Writing an introduction to category theory! What a great way to spend retirement!

(Well, different people have different tastes.)

Category Theory – Reading List

Thursday, February 26th, 2015

Category Theory – Reading List by Peter Smith.

Notes along with pointers to other materials.

About Peter Smith:

These pages are by me, Peter Smith. I retired in 2011 from the Faculty of Philosophy at Cambridge. It was my greatest good fortune to have secure, decently paid, university posts for forty years in leisurely times, with a very great deal of freedom to follow my interests wherever they led. Like many of my generation, I am sure I didn’t at the time really appreciate just how lucky I and my contemporaries were. Some of the more student-orientated areas of this site, then, such as the Teach Yourself Logic Guide, constitute my small but heartfelt effort to give something back by way of thanks.

There is much to explore at Peter’s site beside his notes on category theory.

Category theory for beginners

Monday, February 23rd, 2015

Category theory for beginners by Ken Scrambler

From the post:

Explains the basic concepts of Category Theory, useful terminology to help understand the literature, and why it’s so relevant to software engineering.

Some two hundred and nine (209) slides, ending with pointers to other resources.

I would have dearly loved to see the presentation live!

This slide deck comes as close as any I have seen to teaching category theory as you would a natural language. Not too close but closer than others.

Think about it. When you entered school did the teacher begin with the terminology of grammar and how rules of grammar fit together?

Or, did the teacher start you off with “See Jack run.” or its equivalent in your language?

You were well on your way to being a competent language user before you were tasked with learning the rules for that language.

Interesting that the exact opposite approach is taken with category theory and so many topics related to computer science.

Pointers to anyone using a natural language teaching approach for category theory or CS material?

Categories Great and Small

Saturday, December 27th, 2014

Categories Great and Small by Bartosz Milewski.

From the post:

You can get real appreciation for categories by studying a variety of examples. Categories come in all shapes and sizes and often pop up in unexpected places. We’ll start with something really simple.
No Objects

The most trivial category is one with zero objects and, consequently, zero morphisms. It’s a very sad category by itself, but it may be important in the context of other categories, for instance, in the category of all categories (yes, there is one). If you think that an empty set makes sense, then why not an empty category?
Simple Graphs

You can build categories just by connecting objects with arrows. You can imagine starting with any directed graph and making it into a category by simply adding more arrows. First, add an identity arrow at each node. Then, for any two arrows such that the end of one coincides with the beginning of the other (in other words, any two composable arrows), add a new arrow to serve as their composition. Every time you add a new arrow, you have to also consider its composition with any other arrow (except for the identity arrows) and itself. You usually end up with infinitely many arrows, but that’s okay.

Another way of looking at this process is that you’re creating a category, which has an object for every node in the graph, and all possible chains of composable graph edges as morphisms. (You may even consider identity morphisms as special cases of chains of length zero.)

Such a category is called a free category generated by a given graph. It’s an example of a free construction, a process of completing a given structure by extending it with a minimum number of items to satisfy its laws (here, the laws of a category). We’ll see more examples of it in the future.

The latest installment in literate explanation of category theory in this series.

Challenges await you at the end of this post.


Types and Functions

Saturday, November 29th, 2014

Types and Functions by Bartosz Milewski.

From the post:

The category of types and functions plays an important role in programming, so let’s talk about what types are and why we need them.

Who Needs Types?

There seems to be some controversy about the advantages of static vs. dynamic and strong vs. weak typing. Let me illustrate these choices with a thought experiment. Imagine millions of monkeys at computer keyboards happily hitting random keys, producing programs, compiling, and running them.

monkey with keyboard

With machine language, any combination of bytes produced by monkeys would be accepted and run. But with higher level languages, we do appreciate the fact that a compiler is able to detect lexical and grammatical errors. Lots of monkeys will go without bananas, but the remaining programs will have a better chance of being useful. Type checking provides yet another barrier against nonsensical programs. Moreover, whereas in a dynamically typed language, type mismatches would be discovered at runtime, in strongly typed statically checked languages type mismatches are discovered at compile time, eliminating lots of incorrect programs before they have a chance to run.

So the question is, do we want to make monkeys happy, or do we want to produce correct programs?

That is a sample of the direct, literate prose that awaits you if you follow this series on category theory.

Category: The Essence of Composition

Wednesday, November 5th, 2014

Category: The Essence of Composition by Bartosz Milewski.

From the post:

I was overwhelmed by the positive response to my previous post, the Preface to Category Theory for Programmers. At the same time, it scared the heck out of me because I realized what high expectations people were placing in me. I’m afraid that no matter what I’ll write, a lot of readers will be disappointed. Some readers would like the book to be more practical, others more abstract. Some hate C++ and would like all examples in Haskell, others hate Haskell and demand examples in Java. And I know that the pace of exposition will be too slow for some and too fast for others. This will not be the perfect book. It will be a compromise. All I can hope is that I’ll be able to share some of my aha! moments with my readers. Let’s start with the basics.

Bartosz’s post includes pigs, examples in C and Haskell, and ends with:


  1. Implement, as best as you can, the identity function in your favorite language (or the second favorite, if your favorite language happens to be Haskell).
  2. Implement the composition function in your favorite language. It takes two functions as arguments and returns a function that is their composition.
  3. Write a program that tries to test that your composition function respects identity.
  4. Is the world-wide web a category in any sense? Are links morphisms?
  5. Is Facebook a category, with people as objects and friendships as morphisms?
  6. When is a directed graph a category?

My suggestion is that you follow Bartosz’s posts and after mastering them, try less well explained treatments of category theory.

Category Theory & Programming

Wednesday, November 5th, 2014

Category Theory & Programming by Yann Esposito. (slides)

Great slides on category theory with this quote on slide 6:

One of the goal of Category Theory is to create a homogeneous vocabulary between different disciplines.

Is the creation of a homogeneous vocabulary responsible for the complexity of category theory or is the proof of equivalence between different disciplines?

As you know, topic maps retains the vocabularies of different disciplines as opposed to replacing them with a homogeneous one. Nor do topic maps require proof of equivalence in the sense of category theory.

I first saw this in a tweet by Sam Ritchie.

Category Theory Applied to Functional Programming

Wednesday, November 5th, 2014

Category Theory Applied to Functional Programming by Juan Pedro Villa Isaza.


We study some of the applications of category theory to functional programming, particularly in the context of the Haskell functional programming language, and the Agda dependently typed functional programming language and proof assistant. More specifically, we describe and explain the concepts of category theory needed for conceptualizing and better understanding algebraic data types and folds, functors, monads, and parametrically polymorphic functions. With this purpose, we give a detailed account of categories, functors and endofunctors, natural transformations, monads and Kleisli triples, algebras and initial algebras over endofunctors, among others. In addition, we explore all of these concepts from the standpoints of categories and programming in Haskell, and, in some cases, Agda. In other words, we examine functional programming through category theory.

Impressive senior project along with Haskell source code.

I first saw this in a tweet by Computer Science.

Category Theory for Programmers: The Preface

Tuesday, October 28th, 2014

Category Theory for Programmers: The Preface by Bartosz Milewski.

From the post:

For some time now I’ve been floating the idea of writing a book about category theory that would be targeted at programmers. Mind you, not computer scientists but programmers — engineers rather than scientists. I know this sounds crazy and I am properly scared. I can’t deny that there is a huge gap between science and engineering because I have worked on both sides of the divide. But I’ve always felt a very strong compulsion to explain things. I have tremendous admiration for Richard Feynman who was the master of simple explanations. I know I’m no Feynman, but I will try my best. I’m starting by publishing this preface — which is supposed to motivate the reader to learn category theory — in hopes of starting a discussion and soliciting feedback.

I will attempt, in the space of a few paragraphs, to convince you that this book is written for you, and whatever objections you might have to learning one of the most abstracts branches of mathematics in your “copious spare time” are totally unfounded.

My optimism is based on several observations. First, category theory is a treasure trove of extremely useful programming ideas. Haskell programmers have been tapping this resource for a long time, and the ideas are slowly percolating into other languages, but this process is too slow. We need to speed it up.

Second, there are many different kinds of math, and they appeal to different audiences. You might be allergic to calculus or algebra, but it doesn’t mean you won’t enjoy category theory. I would go as far as to argue that category theory is the kind of math that is particularly well suited for the minds of programmers. That’s because category theory — rather than dealing with particulars — deals with structure. It deals with the kind of structure that makes programs composable.

Composition is at the very root of category theory — it’s part of the definition of the category itself. And I will argue strongly that composition is the essence of programming. We’ve been composing things forever, long before some great engineer came up with the idea of a subroutine. Some time ago the principles of structural programming revolutionized programming because they made blocks of code composable. Then came object oriented programming, which is all about composing objects. Functional programming is not only about composing functions and algebraic data structures — it makes concurrency composable — something that’s virtually impossible with other programming paradigms.

See the rest of the preface and the promise to provide examples in code for most major concepts.

Are you ready for discussion and feedback?

General Theory of Natural Equivalences [Category Theory – Back to the Source]

Saturday, October 4th, 2014

General Theory of Natural Equivalences by Samuel Eilenberg and Saunders MacLane. (1945)

While reading the Stanford Encyclopedia of Philosophy entry on category theory, I was reminded that despite seeing the citation Eilenberg and MacLane, General Theory of Natural Equivalences, 1945 uncounted times, I have never attempted to read the original paper.

Considering I had a graduate seminar on running biblical research back to original sources (as nearly as possible), a severe oversight on my part. An article comes to mind that proposed inserting several glyphs into a particular inscription. Plausible, until you look at the tablet in question and realize perhaps one glyph could be restored, but not two or three.

It has been my experience that was not a unique case nor is it limited to biblical studies.

Category Theory (Stanford Encyclopedia of Philosophy)

Saturday, October 4th, 2014

Category Theory (Stanford Encyclopedia of Philosophy)

From the entry:

Category theory has come to occupy a central position in contemporary mathematics and theoretical computer science, and is also applied to mathematical physics. Roughly, it is a general mathematical theory of structures and of systems of structures. As category theory is still evolving, its functions are correspondingly developing, expanding and multiplying. At minimum, it is a powerful language, or conceptual framework, allowing us to see the universal components of a family of structures of a given kind, and how structures of different kinds are interrelated. Category theory is both an interesting object of philosophical study, and a potentially powerful formal tool for philosophical investigations of concepts such as space, system, and even truth. It can be applied to the study of logical systems in which case category theory is called “categorical doctrines” at the syntactic, proof-theoretic, and semantic levels. Category theory is an alternative to set theory as a foundation for mathematics. As such, it raises many issues about mathematical ontology and epistemology. Category theory thus affords philosophers and logicians much to use and reflect upon.

Several tweets contained “category theory” and links to this entry in the Stanford Encyclopedia of Philosophy. The entry was substantially revised as of October 3, 2014, but I don’t see a mechanism that allows discovery of changes to the prior text.

For a PDF version of this entry (or other entries), join the Friends of the SEP Society. The cost is quite modest and the SEP is an effort that merits your support.

As a reading/analysis exercise, treat the entries in SEP as updates to Copleston‘s History of Philosophy:

A History of Philosophy 1: Greek and Rome

A History of Philosophy 2: Medieval

A History of Philosophy 3: Late Medieval and Renaissance

A History of Philosophy 4: Modern: Descartes to Leibniz

A History of Philosophy 5: Modern British, Hobbes to Hume

A History of Philosophy 6: Modern: French Enlightenment to Kant

A History of Philosophy 7: Modern Post-Kantian Idealiststo Marx, Kierkegaard and Nietzsche

A History of Philosophy 8: Modern: Empiricism, Idealism, Pragmatism in Britain and America

A History of Philosophy 9: Modern: French Revolution to Sartre, Camus, Lévi-Strauss


Functional Examples from Category Theory

Tuesday, August 12th, 2014

Functional Examples from Category Theory by Alissa Pajer.


Alissa Pajer discusses through examples how to understand and write cleaner and more maintainable functional code using the Category Theory.

You will need to either view at full screen or download the slides to see the code.

Long on category theory but short on Scala. Still, a useful video that will be worth re-watching.

Toposes, Triples and Theories

Friday, August 1st, 2014

Toposes, Triples and Theories by Michael Barr and Charles Wells.

From the preface:

Chapter 1 is an introduction to category theory which develops the basic constructions in categories needed for the rest of the book. All the category theory the reader needs to understand the book is in it, but the reader should be warned that if he has had no prior exposure to categorical reasoning the book might be tough going. More discursive treatments of category theory in general may be found in Borceux [1994], Mac Lane [1998], and Barr and Wells [1999]; the last-mentioned could be suitably called a prequel to this book.

So you won’t have to dig the references out of the bibliography:

M. Barr and C. Wells, Category Theory for Computing Science, 3rd Edition. Les Publications CRM (1999).
Online at:

F. Borceux, Handbook of Categorical Algebra I, II and III. Cambridge University Press (1994).
Cambridge Online Books has these volumes but that requires an institutional subscription.

S. Mac Lane, Categories for the Working Mathematician 2nd Edition. Springer-Verlag, 1998.
Online at:


Using Category Theory to design…

Tuesday, July 29th, 2014

Using Category Theory to design implicit conversions and generic operators by John C. Reynolds.


A generalization of many-sorted algebras, called category-sorted algebras, is defined and applied to the language-design problem of avoiding anomalies in the interaction of implicit conversions and generic operators. The definition of a simple imperative language (without any binding mechanisms) is used as an example.

The greatest exposure most people have to implicit conversions is that they are handled properly.

This paper dates from 1980 so some of the category theory jargon will seem odd but consider it a “practical” application of category theory.

That should hold your interest. 😉

I first saw this in a tweet by scottfleischman.

Basic Category Theory (Publish With CUP)

Monday, July 28th, 2014

Basic Category Theory by Tom Leinster.

From the webpage:

Basic Category Theory is an introductory category theory textbook. Features:

  • It doesn’t assume much, either in terms of background or mathematical maturity.
  • It sticks to the basics.
  • It’s short.

Advanced topics are omitted, leaving more space for careful explanations of the core concepts. I used earlier versions of the text to teach master’s-level courses at the University of Glasgow.

The book is published by Cambridge University Press. You can find all the publication data, and buy it, at the book’s CUP web page.

It was published on 24 July 2014 in hardback and e-book formats. The physical book should be in stock throughout Europe now, and worldwide by mid-September. Wherever you are, you can (pre)order it now from CUP or the usual online stores.

By arrangement with CUP, a free online version will be released in January 2016. This will be not only freely downloadable but also freely editable, under a Creative Commons licence. So, for instance, if parts of the book are unsuitable for the course you’re teaching, or if you don’t like the notation, you can change it. More details will appear here when the time comes.

Freely available as etext (6 months after hard copy release) and freely editable?

Show of hands. How many publishers have you seen with those policies?

I keep coming up with one, Cambridge University Press, CUP.

As readers and authors we need to vote with our feet. Purchase from and publish with Cambridge University Press.

It may take a while but other publishers may finally notice.

Abstract Algebra, Category Theory, Haskell

Monday, July 28th, 2014

Abstract Algebra, Category Theory, Haskell: Recommended Reading Material

A great annotated reading list for Abstract Algebra, Category Theory, and Haskell.

As an added feature, there are links to the cited works on Google Books. You won’t be able to see entire works but enough to choose between them.

Make Category Theory Intuitive!

Tuesday, June 17th, 2014

Make Category Theory Intuitive! by Jocelyn Ireson-Paine.

From the post:

As I suggested in Chapter 1, the large, highly evolved sensory and motor portions of the brain seem to be the hidden powerhouse behind human thought. By virtue of the great efficiency of these billion-year-old structures, they may embody one million times the effective computational power of the conscious part of our minds. While novice performance can be achieved using conscious thought alone, master-level expertise draws on the enormous hidden resources of these old and specialized areas. Sometimes some of that power can be harnessed by finding and developing a useful mapping between the problem and a sensory intuition.

Although some individuals, through lucky combinations of inheritance and opportunity have developed expert intuitions in certain fields, most of us are amateurs at most things. What we need to improve our performance is explicit external metaphors that can tap our instinctive skills in a direct and repeatable way. Graphs, rules of thumb, physical models illustrating relationships, and other devices are widely and effectively used to enhance comprehension and retention. More recently, interactive pictorial computer interfaces such as those used in the Macintosh have greatly accelerated learning in novices and eased machine use for the experienced. The full sensory involvement possible with magic glasses may enable us to go much further in this direction. Finding the best metaphors will be the work of a generation: for now, we can amuse ourselves by guessing.

Hans Moravec, in Mind Children [Moravec 1988].

This is an essay on why I believe category theory is important to computer science, and should therefore be promoted; and on how we might do so. While writing this, I discovered the passage I’ve quoted above. My ideas are closely related, and since there’s nothing more pleasing than being supported by such an authority, that’s why I’ve quoted it here.

Category theory has been around since the 1940s, and was invented to unify different treatments of homology theory, a branch of algebraic topology [Marquis 2004; Natural transformation]. It’s from there that many examples used in teaching category theory to mathematicians come. Which is a shame, because algebraic topology is advanced: probably post-grad level. Examples based on it are not much use below that level, and not much use to non-mathematicians. The same applies to a lot of the other maths to which category theory has been applied.

An interesting essay with many suggestions for teaching category theory. Follow this essay with a visit to Jocelyn’s homepage and the resources on category theory cited there. Caution: You will find a number of other very interesting things on the homepage. You have been warned. 😉

Spreadsheets too! What is it with people studying something that is nearly universal in business and science? Is that why vendors make money? Pandering to the needs of the masses? Is that a clue on being a successful startup? Appeal to the masses and not the righteous?

If you try the Category Theory Demonstrations, be aware the page refreshes with a statement: “Your results are here” near the top of the page. Follow that link for your results.

In a thread on those demonstrations, Jocelyn laments the lack of interest among those who already understand category theory in finding more intuitive ways of explaining it. I have no explanation to offer but can attest to the same lack of interest among lawyers, academics in general, etc. in making their knowledge more “intuitive.”

So how do you successfully promote projects designed to make institutions or disciplines more “transparent?” A general public interest in “transparency” doesn’t translate easily into donations or institutional support. Suggestions?

Categorical Databases

Thursday, May 29th, 2014

Categorical Databases by David I. Spivak.

From Slide 2 of 58:

There is a fundamental connection between databases and categories.

  • Category theory can simplify how we think about and use databases.
  • We can clearly see all the working parts and how they fit together.
  • Powerful theorems can be brought to bear on classical DB problems.

The slides are “text heavy” but I think you will find that helpful rather than a hindrance in this case. 😉

From David Spivak’s homepage:

Purpose: I study information and communication, working towards a mathematical foundation for interoperability.

If you are looking for more motivation to get into category theory, this could be the place to start.

I first saw this in a tweet by Jim Duey.


Saturday, May 24th, 2014

Fluokitten: Category theory concepts in Clojure – Functors, Applicatives, Monads, Monoids and more.

From the “getting started” page:

This is a brief introductory guide to Fluokitten that aims to give you the necessary information to get up and running, as well as a brief overview of some available resources for learning key category theory concepts and how to apply them in Clojure with Fluokitten.


Fluokitten is a Clojure library that enables programming paradigms derived from category theory (CT). It provides:

  • A core library of CT functions uncomplicate.fluokitten.core;
  • Protocols for many CT concepts uncomplicate.fluokitten.protocols;
  • Implementations of these protocols for standard Clojure constructs (collections, functions, etc.) uncomplicate.fluokitten.jvm;
  • Macros and functions to help you write custom protocol implementations.
  • Accompanying website with learning resources.

Not your first resource on Clojure but certainly one to consult when you want to put category theory into practice with Clojure.

Functional Pearl:…

Tuesday, May 13th, 2014

Functional Pearl: Kleisli arrows of outrageous fortune by Conor McBride.


When we program to interact with a turbulent world, we are to some extent at its mercy. To achieve safety, we must ensure that programs act in accordance with what is known about the state of the world, as determined dynamically. Is there any hope to enforce safety policies for dynamic interaction by static typing? This paper answers with a cautious ‘yes’.

Monads provide a type discipline for effectful programming, mapping value types to computation types. If we index our types by data approximating the ‘state of the world’, we refine our values to witnesses for some condition of the world. Ordinary monads for indexed types give a discipline for effectful programming contingent on state, modelling the whims of fortune in way that Atkey’s indexed monads for ordinary types do not (Atkey, 2009). Arrows in the corresponding Kleisli category represent computations which a reach a given postcondition from a given precondition: their types are just specifications in a Hoare logic!

By way of an elementary introduction to this approach, I present the example of a monad for interacting with a file handle which is either ‘open’ or ‘closed’, constructed from a command interface
specfied Hoare-style. An attempt to open a file results in a state which is statically unpredictable but dynamically detectable. Well typed programs behave accordingly in either case. Haskell’s dependent type system, as exposed by the Strathclyde Haskell Enhancement preprocessor, provides a suitable basis for this simple experiment.

Even without a weakness for posts/articles/books about category theory, invoking the Bard is enough to merit a pointer.

Rest easy, the author does not attempt to render any of the sonnets using category theory notation.

I first saw this in a tweet by Computer Science.

Categories from scratch

Monday, May 12th, 2014

Categories from scratch by Rapahel ‘kena’ Poss.

From the post:


The concept of category from mathematics happens to be useful to computer programmers in many ways. Unfortunately, all “good” explanations of categories so far have been designed by mathematicians, or at least theoreticians with a strong background in mathematics, and this makes categories especially inscrutable to external audiences.

More specifically, the common explanatory route to approach categories is usually: “here is a formal specification of what a category is; then look at these known things from maths and theoretical computer science, and admire how they can be described using the notions of category theory.” This approach is only successful if the audience can fully understand a conceptual object using only its formal specification.

In practice, quite a few people only adopt conceptual objects by abstracting from two or more contexts where the concepts are applicable, instead. This is the road taken below: reconstruct the abstractions from category theory using scratches of understanding from various fields of computer engineering.


The rest of this document is structured as follows:

  1. introduction of example Topics of study: unix process pipelines, program statement sequences and signal processing circuits;
  2. Recollections of some previous knowledge about each example; highlight of interesting analogies between the examples;
  3. Identification of the analogies with existing concepts from category theory;
  4. a quick preview of Goodies from category theory;
  5. references to Further reading.

If you don’t already grok category theory, perhaps this will be the approach that tips the balance in your favor!