In category theory, “cancellative” is a synonym for all arrows are monic and epic. Thus the typical way for cancellative categories to be constructed to take a category $C$ and then restrict to a class of monic and epic morphisms closed under composition, such as all monic and epic morphisms, or isomorphisms, etc.

In fact every cancellative $C$ arises this way (in the tautological sense of applying this consideration to $C$ itself): a category$\mathcal{C}$ being cancellative means all its morphisms are monos and epis.

Equivalently, for arbitrary morphisms $f,h_0,h_1$ of $\mathcal{C}$, if $h_0 \circ f=h_1\circ f$, then $h_0=h_1$, and if $f\circ h_0=f\circ h_1$, then $h_0=h_1$.