@antoinechambertloir@MartinEscardo@oantolin - There is a rather elaborate and carefully worked out esthetic of formulating definitions in categorical logic, aimed to ensure that everything works out as smoothly as possible, e.g. that everything you say about a functor is invariant under natural isomorphisms, and everything you say about a category is invariant under equivalence. Equations between objects can easily break these principles so we call them 'evil'; this then pressures us to take an approach where we don't need to check that the source of one morphism equals the target of the next.
A common approach is to make morphisms 'dependently typed', so that for each pair of objects (a,b) you have a set of morphisms hom(a,b). You never talk about the set of all morphisms, so you never mention source and target maps. Composition is not a single partially defined function, but instead a bunch of functions hom(a,b) × hom(b,c) → hom(a,c). So, you never need to check that the source of one morphism equals the target of another: it's impossible to even dream of composing morphisms unless you already know you can do it!