In Category Theory, a natural transformation is an arrow between pairs of functors, making it a 2-morphisms in the category Cat. Given; functors, A natural transformation is a family of functors such that, for all pairs , and arrows the following commutes:

\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
FA \arrow[d, "Ff"] \arrow[r, "\alpha_A"] & GA \arrow[d, "Gf"] \\
FB \arrow[r, "\alpha_B"] & GB
\end{tikzcd}
\end{document}

All types in languages like haskell are natural transformations.

Duplicate Content 1

Let be categories. Let be functors. A natural transformation is defined as a family of morphisms for every object such that the following β€˜naturality square’ commutes:

\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
F x \arrow[d, "\alpha_x"'] \arrow[r, "Ff"] & F y \arrow[d, "\alpha_y"] \\
G x \arrow[r, "Gf"'] & G y
\end{tikzcd}
\end{document}