This is a demonstration that we may view traits as type constructors: that is, functions from Type to Type. This view is motivated from a categorical perspective of type theory, in which the morphisms of the category take the central role. Cf. subobjects, which are represented by morphisms, rather than objects in a different category.
I'm assuming that the category of types, Type, is bicartesian closed. The set of morphisms between
any two objects includes the set of functions denoted by Fn
, FnMut
and FnOnce
in Rust.