Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to implement a notion of a category, monoidal category and braided monoidal category in haskell. And I'm not sure if [a] or Data.Set a is a correct notion for representing an objects in a category.

share|cite|improve this question
Not in general. See wikipedia. – Rasmus Aug 25 '11 at 15:33
@Andrew: There are the class “Category” in “base” and the classes “Monoidal”, “Braided” in “category-extras”. Maybe this is not what you need, as I do not understand “implementing”. Haskell is for computing, not for reasoning. – beroal Aug 25 '11 at 16:00
here is nice implementation by Edward Kmett – max taldykin Aug 25 '11 at 16:06
btw, it's possible to define categories without notion of object, with arrows only – max taldykin Aug 25 '11 at 16:08
How to implement the notion of a category in Haskell depends on whether you want categories to be values, types, or something else entirely. If a category is a value, as you seem to be wanting, there's no good answer to your question, but I think it may make more sense to make the category be an entire type, rather than just a list or set. That said, I think this is really more of a Haskell question than a math question; I'd suggest posting it on for better answers. – Tanner Swett Aug 25 '11 at 19:52
up vote 3 down vote accepted

Most categories do not have a set of objects. When this does happen, you have what is called a small category. Despite this, many categories have what is known as a small skeleton, meaning that the category of objects up to isomorphism is small. Such a category is said to be essentially small, and examples of such categories include finite dimensional $k$-vector spaces (for some field $k$) and finite sets.

share|cite|improve this answer
“essentially small” or svelte – PseudoNeo Sep 2 '11 at 7:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.