Hacker News new | ask | show | jobs
by 3PS 2420 days ago
> Functor isn’t the only algebraic structure either.

I actually wouldn't call it an algebraic structure at all. A functor really isn't just a set with some finitary operations. A quick search online [1] tells me I'm not alone.

https://www.quora.com/Why-is-functor-considered-to-be-an-alg...

3 comments

Very much agree... but also want to be a little soft here. It's a very specific line of reasoning needed to discuss the difference between a "structured set", an algebra, a "theory" (algebraic or geometric or otherwise), et al.

Generally, we're all talking about the same sort of thing. But also, generally, there isn't one good formal apparatus for discussing the whole of these things without inducing just tons of complexity. Why? Because we want to talk about specific and complex things and we often want to use specific and complex language as opposed to working through 8 levels of encoding every time.

So anyway, right there with you! But also happy to guide people down that path step-by-step.

A very nuanced take, certainly. Thank you.
I guess this is an easy point of confusion. Are specific instances of functor algebras, then? (What about f-algebras?) What would be the more appropriate word for the category theoretical things the author is trying to refer to here, functor and monad and so on?
A monad (on Set) is an "algebraic structure" (eg. the notion of a group). An algebra for that monad is an "algebra" (eg. one individual group).

This is the original use for monads in universal algebra, before they were interpreted as computational effects. An algebraic structure like a group or monoid is traditionally given by a signature: a list of what operations it has and what rules the operations need to follow. You can generalize from a signature Sig to a monad M. If a is a set, then Ma is "the set of expressions with constants from a": the set of formal expressions built from elements of a and the operations in Sig and where two expressions are regarded as equal if you can manipulate one into the other using the rules from Sig. The list monad for example corresponds to the signature for monoids.

The monad laws can thus be read as expressing "how to do algebra" at the most general level (ie. the level that is common to all algebraic structures). I would gloss them as "the order you evaluate an expression does not matter".

edflsafoiewq's answer is good, but they didn't really mention functors. If you want an umbrella to put functors under, I'd say "higher order structure". It's a map between structures that respects structure.
As a mathematician first (only an amature programmer), I wholeheartedly agree.