<p>Quick googling shows a paper:</p>

<p><a href="http://projects.wizardlike.ca/attachments/18/FICS2010.pdf" rel="nofollow">Safe Recursion Revisited: Categorical Semantics and Type Systems for Lower Complexity</a></p>

<p>I also remember works by Japaridze on polynomial time arithmetics, see <a href="http://arxiv.org/abs/0902.2969" rel="nofollow">http://arxiv.org/abs/0902.2969</a></p>

<p>I think you can start from there and walk by references.</p>
Is there a theory that combines category theory/abstract algebra and computational complexity?
<p>Category theory and abstract algebra deal with the way functions can be combined with other functions.  Complexity theory deals with how hard a function is to compute.  It's weird to me that I haven't seen anyone combine these fields of study, since they seem like such natural pairs.  Has anyone done this before?</p>

<hr>

<p>As a motivating example, let's take a look at monoids.  It's well known that if an operation is a monoid, then we can parallelize the operation.</p>

<p>For example in Haskell, we can trivially define that addition is a monoid over the integers like this:</p>

<pre><code>instance Monoid Int where
    mempty = 0
    mappend = (+)
</code></pre>

<p>Now if we want to compute the sum of 0 to 999, we could do it sequentially like:</p>

<pre><code>foldl1' (+) [0..999]
</code></pre>

<p>or we could do it in parallel</p>

<pre><code>mconcat [0..999] -- for simplicity of the code, I'm ignoring that this doesn't *actually* run in parallel
</code></pre>

<p>But parallelizing this monoid makes sense only because mappend runs in constant time.  What if this weren't the case?  Lists, for example, are monoids where mappend does not run inconstant time (or space!).  I'm guessing this is why there is no default parallel mconcat function in Haskell.  The best implementation depends on the complexity of the monoid.</p>

<hr>

<p>It seems like there should be a convenient way to describe the differences between these two monoids.  We should then be able to annotate our code with these differences and have programs automatically choose the best algorithms to use depending on a monoid's complexity.</p>