dirty-haskell.org: Exercises in Category Theory — 1.1

It's not crazy — it's having fun with types.

Sets and functions do form a category \ca{Set}.

The objects of \ca{Set} are sets and its arrows are functions.

For any set A we identify \idarr{A} with the identity function on A, \id : A \to A.

\circ is indeed associative.

Each poset is a category.

The objects of each poset are its elements and we construct an arrow \arr{a}{\leq}{b} for every pair of objects (a, b) iff a \leq b.

Reflexivity (a \leq a) and transitivity (a \leq b \land b \leq c \implies a \leq c) provide a construction for \idarr{a} and \circ, respectively.

Each monoid is a category.

The objects of each monoid are its elements and we construct for every pair of elements (a, b) an arrow \arr{a}{\cdot b}{a \cdot b}.

The existence of an identity element and associativity, as required by the monoid structure, immediately provide us with a construction for \id and associativity of \circ.