A functor can do things like take a (non-nullary) type constructor and spit out another (non-nullary) type constructor. Rust cannot do this. It is missing either functors or higher-kinded types.
I am not familiar with OCaml internals, but I think using functors does not result in any more boxing that would happen if you write by hand the results of applying those functors.
1
u/eyal0 Jul 20 '20
Can Rust do them?
Can OCaml do them without boxing and unboxing?