liveBook · Manning

Morphism

As explained in Fabulous Adventures in Data Structures and Algorithms

A morphism is a structure-preserving mapping from one object in a category to another.

A morphism is an arrow connecting two objects in a category. Write a morphism from A to B as A→B: it represents a permitted way to get from one object to another. Every object has an identity morphism to itself, and composing A→B with B→C yields A→C. section 7.1

A three-object category

Choose 0, 1, and 2 as objects, and draw an arrow from each number to every number greater than or equal to it. The six resulting morphisms include the three identity arrows and the arrows from 0 to 1 and 2 and from 1 to 2. section 7.1

In programming-language categories, assignment compatibility supplies a practical kind of morphism: an expression of type X may be assigned to a variable of type Y. This viewpoint connects morphisms with covariance, contravariance, functors, and type-system design. section 7.4

How Fabulous Adventures in Data Structures and Algorithms covers it

How deep it goes
Defines arrows through identity and composition rules, then applies them to numeric categories and assignment compatibility without pursuing deeper category theory.
Examples
Uses arrows among 0, 1, and 2 and assignment compatibility between types as concrete examples.
What it assumes
Assumes familiarity with functions, objects, types, and assignment while defining category-theoretic terminology from the beginning.
What you can do after
Evaluate relationships as arrows and compose them using identity and transitivity in category and type-system examples.
How it connects
Connects morphisms with categories, identity morphisms, functors, covariance, contravariance, partial orders, and type systems.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Fabulous Adventures in Data Structures and Algorithms. The section links point to the parts of the book it draws on.