If I find out that something is a Monoid
or Monad
, I get all to use all kinds of fun functions, like foldMap
, sequence
or even mapM
. They make me happy.
What do I get if I find out that something is a Category
? Do I get anything fun besides overloading id
and (.)
?
Well, you also (should) get the laws associated with them:
As a side note: The reason that you don't get that many fun functions like
mapM
orfoldMap
is, that saying something is a category is actually saying very little about it. The most useful functions I guess are the ones defined inControl.Category
, which sometimes make code easier to read:>>>
and<<<